试验7
assume cs:code,ss:stack,ds:datadata segment
db '1975','1976','1977','1978','1979','1980','1981','1982','1983'
db '1984','1985','1986','1987','1988','1989','1990','1991','1992'
db '1993','1994','1995'
dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514
dd 345980,590827,803530,118300,184300,275900,375300,464900,593700
dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226
dw 11542,14430,15257,17800
data ends
table segment
db 21 dup('year summ ne ??')
table ends
stack segment
dw 21 dup(0)
stack ends
code segment
start:mov ax,data
mov ds,ax
mov ax,table
mov es,ax
mov si,0
mov di,0
mov ax,stack
mov ss,ax
mov sp,42
mov cx,21
mov ax,0
mov dx,0
s:push cx
mov cx,2
s0:mov al,0
mov ah,1
mov es:0,al
mov es:1,ah
mov al,84
mov ah,85
mov es:5,al
mov es:6,ah
push di
push si
push dx
mov dl,2
mov ax,si
div dl
mov si,ax
pop dx
mov di,dx
mov al,168
mov es:10,al
pop si
pop di
add si,2
add di,2
add dx,1
loop s0
add di,11
add dx,13
pop cx
loop s
mov si,0
mov ax,table
mov ds,ax
mov dx,0
mov cx,8
s1: mov ax,5
div byte ptr 10
mov dl,al
mov 13,dx
add si,15
loop s1
mov ax,0
mov ah,5
mov dl,6
div word ptr 10
mov dx,0
mov dl,ah
mov ax,dx
mov 13,ax
add si,15
mov cx,12
s2: mov dx,7
mov ax,5
div word ptr 10
mov 13,ax
add si,15
loop s2
mov ax,4c00h
int 21h
code ends
end start
写这个花了3天时间,确实学习了不少东西,一些错误和调试都熟悉不少 ..
主要是什么都没去查,自己慢慢琢磨的 本帖最后由 装糊涂 于 2019-12-6 14:07 编辑
你的咋那么多,我开始也用了嵌套循环,后来发现不需要用循环嵌套
页:
[1]