字符显示dispc
dispc :显示一个字符 入口:AL=字符的ASCII码
;利用库函数显示字符
include io.inc
.model small
.stack
.data
.code
.startup
mov al,'A'
call dispc ;调用库函数,显示al的字符
.exit
end
自己实现dispc
;字符显示
;include io.inc
.model small
.stack
.data
.code
.startup
mov al,'A'
call dispc ;调用库函数,显示al的字符
.exit
dispc proc
;利用功能号AH=02H 人口参数DL=显示的字符
push ax
push dx
mov dl,al
mov ah,2
int 21h
pop dx
pop ax
ret
dispc endp
end
读取字符readc
readc 输入一个字符(回显)出口:AL=字符的ASCII码
;字符读入
include io.inc
.model small
.stack
.data
.code
.startup
;readc 输入一个字符(回显)出口:AL=字符的ASCII码
call readc ;调用库函数,显示al的字符
call dispc
.exit
end
自己实现readc
readc 输入一个字符(回显)出口:AL=字符的ASCII码
;字符读入
;include io.inc
.model small
.stack
.data
.code
.startup
;readc 输入一个字符(回显)出口:AL=字符的ASCII码
call readc
call dispc
.exit
readc proc
;功能号AH=01H 键盘输入字符 AL=输入的字符
mov ah,1
int 21h
ret
readc endp
dispc proc
;利用功能号AH=02H 人口参数DL=显示的字符
push ax
push dx
mov dl,al
mov ah,2
int 21h
pop dx
pop ax
ret
dispc endp
end
实现dispcrlf
dispcrlf 光标到下一行首位置(回车换行)
回车:’\r’, 13(d) , 0CH
换行:’\n’ 10(d),0AH
;include io.inc
.model small
.stack
.data
.code
.startup
;readc 输入一个字符(回显)出口:AL=字符的ASCII码
call dispcrlf
.exit
dispcrlf proc
;利用功能号AH=02H 人口参数DL=显示的字符
push ax
push dx
mov dl,13
mov ah,2
int 21h
mov dl,10
int 21h
pop dx
pop ax
ret
dispcrlf endp
end
1万+

被折叠的 条评论
为什么被折叠?



