实验9 根据材料编程
1.补全程序t1.asm,完成在屏幕上输出内存单元中的十进制二位数。
assume cs:code,ds:data data segment db 12 db ?,? data ends code segment start: mov ax,data mov ds,ax mov ah,0 mov al,ds:[0] mov bl,10 div bl mov ds:[1],al mov ds:[2],ah mov ah,2 mov dl,ds:[1] add dl,30h int 21h mov ah,2 mov dl,ds:[2] add dl,30h int 21h mov ax,4c00h int 21h code ends end start
2.补全程序t2.asm,完成在屏幕上输出data段定义的5个十进制两位数,数据和数据 之间以空格间隔。
assume cs:code,ds:data data segment db 12,35,96,55,67 data ends code segment start: mov ax,data
mov ds,ax
mov bx,0
mov cx,5
s: mov ah,0
mov al,ds:[bx]
mov dl,10
div dl
mov ds:[5],al
mov ds:[6],ah
mov ah,2
mov dl,ds:[5]
add dl,30h
int 21h
mov al,ds:[bx]
mov dl,10
div dl
mov ds:[5],al
mov ds:[6],ah
mov ah,2
mov dl,ds:[5]
add dl,30h
int 21h
mov ah,2
mov dl,ds:[6]
add dl,30h
int 21h
mov dl,ds:[6]
add dl,30h
int 21h
mov ah,2
mov dl,' '
int 21h
mov dl,' '
int 21h
inc bx
loop s
mov ax,4c00h
int 21h
int 21h
code ends
end start
3.
assume ds:data, cs:code,ss:stack data segment db 'welcome to masm!' db 2H,24H,71H data ends code segment start: mov ax,data mov ds,ax mov ax,0b800H mov es,ax mov cx,3 mov al,0 mov si,0 mov di,0 mov bx,0 s0: mov bl,0 push cx mov cx,10h s: mov al,ds:[bx] mov es:[si+0720h],al inc si mov al,ds:[di+10h] mov es:[si+0720h],al inc si inc bx loop s inc di pop cx add si,80h loop s0 mov ax,4c00h int 21h code ends end start