实验九
Posted 101whw
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了实验九相关的知识,希望对你有一定的参考价值。
1
assume cs:code, ds:data
data segment
db 12
db 0,0
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:[0],al
mov ds:[1],ah
data segment
db 12
db 0,0
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:[0],al
mov ds:[1],ah
mov ah,2
mov dl,ds:[0]
add dl,30h
int 21h
mov dl,ds:[0]
add dl,30h
int 21h
mov ah,2
mov dl,ds:[1]
add dl,30h
int 21h
mov dl,ds:[1]
add dl,30h
int 21h
mov ax,4c00h
int 21h
code ends
end start
int 21h
code ends
end start
实验截图:
2
assume ds:data, cs:code
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
实验截图:
3
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
实验截图:
实验总结:简单掌握了十进制两位数输出的方法 ,通过实验及看书理解了80×25彩色字符模式显示原理 ,锻炼了如何综合应用寻址方式和汇编指令完成应用编程。
以上是关于实验九的主要内容,如果未能解决你的问题,请参考以下文章