第10章课程设计1
本帖最后由 魔诀 于 2014-6-13 06:56 编辑有一部分显示不出来。。。。。
assume cs:codesg
data segment
dw 1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995
dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514,345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000
dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226,11542,14430,15257,17800
dd 21 dup (0)
data ends
table segment
db 20 dup (0)
table ends
codesg segment
start: mov ax,data
mov es,ax
mov ax,table
mov ds,ax
mov si,0
mov di,0
mov bx,0
mov cx,21
s: mov bx,cx
mov ax,es:42
mov dx,es:42
mov cx,es:126
call divdw
mov es:168,ax
mov es:168,dx
add si,4
add di,2
mov cx,bx
loop s
mov si,0
mov di,0
mov dh,4
mov bx,0
mov cx,21
an: mov dl,0
mov bx,cx
mov cl,2
mov ax,es:
call dtoc
call show_str
add dl,12
push dx
mov ax,es:42
mov dx,es:42
call dtoc1
pop dx
call show_str
add dl,12
mov ax,es:126
call dtoc
call show_str
add dl,12
push dx
mov ax,es:168
mov dx,es:168
call dtoc1
pop dx
call show_str
add si,2
add di,4
inc dh
mov cx,bx
loop an
mov ax,4c00h
int 21h
divdw: push bx
push ax
mov ax,dx
mov dx,0
div cx
mov bx,ax
pop ax
div cx
mov cx,dx
mov dx,bx
pop bx
ret
dtoc: push ax
push bx
push dx
push cx
push si
push di
mov di,0
mov bx,0ah
s1:mov dx,0
div bx
add dx,30h
push dx
inc di
mov cx,ax
jcxz s0
jmp s1
s0:mov cx,di
s2:pop dx
mov ds:,dl
inc si
loop s2
mov dl,0
mov ds:,dl
pop di
pop si
pop cx
pop dx
pop bx
pop ax
ret
dtoc1: push ax
push bx
push dx
push cx
push si
push di
mov di,0
mov bx,0ah
mov si,dx
s3:mov dx,0
div bx
add dx,30h
push dx
inc di
mov cx,ax
jcxz s4
jmp s3
s4:mov ax,si
s5:mov dx,0
div bx
add dx,30h
push dx
inc di
mov cx,ax
jcxz s6
jmp s5
s6:mov cx,di
mov si,0
s7:pop dx
mov ds:,dl
inc si
loop s7
mov dl,0
mov ds:,dl
pop di
pop si
pop cx
pop dx
pop bx
pop ax
ret
show_str:
push bx
push ax
push es
push si
mov ax,0b800h
mov es,ax
mov ax,160
mul dh
mov bx,ax
mov ax,2
mul dl
add bx,ax
mov al,cl
mov cl,0
show0:mov ch,ds:
jcxz show1
mov es:,ch
mov es:1,al
inc si
add bx,2
jmp show0
show1:pop si
pop es
pop ax
pop bx
ret
codesg ends
end start
谢谢你的课程谢谢分享资源! 走过看看~~~
页:
[1]