ex2.asm

来自「显示9-9乘法表和ASCII字符表(从20H--FFH) 基本功能 1 建立主」· 汇编 代码 · 共 112 行

ASM
112
字号
public ex2
stack segment stack
stack ends

data segment

data ends

code segment
assume cs:code,ds:data,ss:stack
ex2:
mov ch,1d
_main_next_1:
call _print_crlf
mov cl,1d
_main_next_2:
mov ah,0d
mov al,cl
call _print_int
mov dl,42
mov ah,2
int 21h
mov ah,0d
mov al,ch
call _print_int
mov dl,61
mov ah,2
int 21h
mov ah,0d
mov al,cl
mul ch
call _print_int
call _print_tab
mov dl,ch
inc dl
inc cl
cmp cl,dl
jne _main_next_2
inc ch
cmp ch,10d
jne _main_next_1
call _print_crlf

mov ah,4ch
int 21h

_print_int: 
push ax
push bx
push cx
push dx
pushf
mov cx,10000d
mov bl,0d
_print_int_next_1: 
cwd
div cx
push ax
push dx
cmp al,0d
jne _print_int_flag_1
cmp bl,0d
je _print_int_flag_2
_print_int_flag_1: 
mov ah,2
mov dl,al
add dl,48
int 21h
mov bl,1d
_print_int_flag_2: 
mov ax,cx
mov cx,10d
cwd
div cx
mov cx,ax
pop ax
pop dx
cmp cx,1d
jne _print_int_next_1
mov dl,al
add dl,48
mov ah,2
int 21h
popf
pop dx
pop cx
pop bx
pop ax
ret

_print_tab:
push ax
push dx
mov dl,9
mov ah,2
int 21h
pop dx
pop ax
ret

_print_crlf:
push ax
push dx
mov dl,10
mov ah,2
int 21h
pop dx
pop ax
ret

code ends
end  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?