实验九
Posted gerjin
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了实验九相关的知识,希望对你有一定的参考价值。
1. 补全程序t1.asm,完成在屏幕上输出内存单元中的十进制两位数
运行结果:
12
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,[bx]
mov dl,10
div dl
mov dh,ah
mov dl,al
mov ah,2
add dl,30h
int 21h
mov dl,dh
mov ah,2
add dl,30h
int 21h
mov dl,20h
mov ah,2
int 21h
inc bx
loop s
mov ax,4c00h
int 21h
code ends
end start
运行结果:
3. 教材实验9(P187)
assume ds:data, cs:code
data segment
db ‘welcome to masm!‘
db 2H,24H,71H
data ends
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 bx,0
mov bp,16
mov di,071ch
mov cx,3
s: mov bx,cx
mov si,0
mov cx,16
s0: mov ax,0
mov al,[si]
mov ah,[bp]
mov es:[di],ax
inc si
add di,2h
loop s0
add di,80h
mov cx,bx
inc bp
loop s
mov ax,4c00h
int 21h
code ends
start: mov ax,data
mov ds,ax
mov ax,0b800H
mov es,ax
mov bx,0
mov bp,16
mov di,071ch
mov cx,3
s: mov bx,cx
mov si,0
mov cx,16
s0: mov ax,0
mov al,[si]
mov ah,[bp]
mov es:[di],ax
inc si
add di,2h
loop s0
add di,80h
mov cx,bx
inc bp
loop s
mov ax,4c00h
int 21h
code ends
end start
运行结果:
以上是关于实验九的主要内容,如果未能解决你的问题,请参考以下文章