汇编ASCII屏幕输出问题
问题一:为什么内存中的数值不变呢assume cs:code,ds:data,ss:stack
data segment
db '1975','1976','1977','1978','1979','1980','1981','1982'
db '1983','1984','1985','1986','1987','1988','1989','1990'
db '1991','1992','1993','1994','1995'
dw 3,7,9,13,28,38,130,220
dw 476,778,1001,1442,2258,2793,4037,5635
dw 8226,11542,14430,15257,17800
dw 5,3,42,104,85,210,123,111,105,125
dw 140,136,153,211,199,209,224,239
dw 260,304,333
dd 16,22,382,1356,2390,8000,16000,24486
dd 50065,97479,140417,197514,345980,590827
dd 803530,1183000,1843000,2759000,3753000,4649000,5937000
data ends
stack segment
dw 8 dup(0)
code segment
start: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,16
mov bx,0
mov cx,21
mov ax,0b800h
mov es,ax
year:
push cx ;year
mov cx,4
year1:
mov al,[si]
mov es:[bx+di],al
mov ah,7
mov es:[bx+di+1],ah
add di,2
inc si
loop year1
mov di,0
add bx,160
pop cx
loop year
mov cx,21 ;next data
mov bx,40*2
data0:
push cx
mov ax,[si]
data1:
mov cx,10
mov dx,0
div cx
mov cx,ax
add dx,30H
mov es:[bx+di],dl
mov ax,7
mov es:[bx+di+1],al
add di,2
jcxz data2
inc cx ;防止余为1跳转
loop data1
data2:
mov di,0
add si,2
add bx,160
pop cx
loop data0
mov ax,4c00h
int 21h
code ends
end start[/code]
问题2:为什么1995不见了有时候1995.1996都不见了-
loop popc pop cx; mov di,0 ;; 看到问题了吧,再修改下应该就可以了 add si,4 add di,160 loop c0 mov ax,4c00h