使用汇编语言编写九九乘法表,给出详细的注释,谢谢
答案:2 悬赏:0 手机版
解决时间 2021-03-17 03:13
- 提问者网友:杀生予夺
- 2021-03-16 12:06
使用汇编语言编写九九乘法表,给出详细的注释,谢谢
最佳答案
- 五星知识达人网友:山有枢
- 2021-03-16 13:35
code segment
assume cs:code
org 100h
start:
push cs
pop ds
push cs
pop es
mov si,1
m0: mov di,1
m1: mov ax,si
call dispnum
call dispstar
mov ax,di
call dispnum
call dispequ
mov ax,si
mov bx,di
mul bl
call dispmul
mov dl,' '
mov ah,2
int 21h
mov dl,' '
mov ah,2
int 21h
inc di
cmp di,9
jle m1
call lfcr
call lfcr
inc si
cmp si,9
jle m0
mov ah,4ch
int 21h
;=================
lfcr proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
lfcr endp
;======================
dispstar proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,'*'
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispstar endp
;===================
dispequ proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,'='
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispequ endp
;====================
dispnum proc near
; 将要显示的数据放入AL中
push ax
push bx
push cx
push dx
push si
push di
pushf
add al,30h
mov dl,al
mov ah,2
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispnum endp
;===============
dispmul proc near
; 将要显示的数据放入AL中
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,0
mov cl,10
div cl
mov byte ptr[yy+1],ah ;保存个位
mov byte ptr[yy],al ;保存十位
mov al,byte ptr[yy]
add al,30h ;十位转ASC2
cmp al,30h
jne @2
mov al,' '
@2: mov byte ptr[yy],al
mov al,byte ptr[yy+1]
add al,30h ;个位转ASC2
mov byte ptr[yy+1],al
mov ah,9
lea dx,yy
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
yy db 0,0,'$'
dispmul endp
;===============
code ends
end start
assume cs:code
org 100h
start:
push cs
pop ds
push cs
pop es
mov si,1
m0: mov di,1
m1: mov ax,si
call dispnum
call dispstar
mov ax,di
call dispnum
call dispequ
mov ax,si
mov bx,di
mul bl
call dispmul
mov dl,' '
mov ah,2
int 21h
mov dl,' '
mov ah,2
int 21h
inc di
cmp di,9
jle m1
call lfcr
call lfcr
inc si
cmp si,9
jle m0
mov ah,4ch
int 21h
;=================
lfcr proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
lfcr endp
;======================
dispstar proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,'*'
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispstar endp
;===================
dispequ proc near
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,2
mov dl,'='
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispequ endp
;====================
dispnum proc near
; 将要显示的数据放入AL中
push ax
push bx
push cx
push dx
push si
push di
pushf
add al,30h
mov dl,al
mov ah,2
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
dispnum endp
;===============
dispmul proc near
; 将要显示的数据放入AL中
push ax
push bx
push cx
push dx
push si
push di
pushf
mov ah,0
mov cl,10
div cl
mov byte ptr[yy+1],ah ;保存个位
mov byte ptr[yy],al ;保存十位
mov al,byte ptr[yy]
add al,30h ;十位转ASC2
cmp al,30h
jne @2
mov al,' '
@2: mov byte ptr[yy],al
mov al,byte ptr[yy+1]
add al,30h ;个位转ASC2
mov byte ptr[yy+1],al
mov ah,9
lea dx,yy
int 21h
popf
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
yy db 0,0,'$'
dispmul endp
;===============
code ends
end start
全部回答
- 1楼网友:神的生死簿
- 2021-03-16 14:11
select rn, ltrim(max(sys_connect_by_path(product, ',')), ',') product
from (select rn,
product,
min(product) over(partition by rn) product_min,
(row_number() over(order by rn, product)) +
(dense_rank() over(order by rn)) numid
from (select b.rn,
a.rn || '*' || b.rn || '=' || a.rn * b.rn product
from (select rownum rn from all_objects where rownum <= 9) a,
(select rownum rn from all_objects where rownum <= 9) b
where a.rn <= b.rn
order by b.rn, product))
start with product = product_min
connect by numid - 1 = prior numid
group by rn
order by rn;
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯