王爽汇编 第十章 课后题
本帖最后由 god圣锋 于 2021-8-23 22:34 编辑数据定义 全是 db 没有桉书上的 dw dd 分类定义 因为那样分类定义输出的 搞不来 只好 全是 db
assume cs:code,ds:data
data segment
db '1975','1976','1978','1979','1980'
db '1981','1982','1983','1984','1985'
db '1986','1987','1988','1989','1990'
db '1991','1992','1993','1994','1995','1996'
db '16',0, '22',0, '382',0, '1356',0, '2390',0, '8000',0
db '16000',0, '24486',0, '50065',0, '97479',0, '140417',0
db '197514',0, '345980',0, '590827',0, '830530',0, '1183000',0
db '1843000',0, '2759000',0, '3753000',0, '4649000',0, '5937000',0
db '3',0,'7',0,'9',0,'13',0,'28',0,'38',0,'130',0,'220',0,'476',0,'778',0
db '1001',0,'1442',0,'2258',0,'2793',0,'4037',0,'5635',0,'8226',0
db '11542',0,'14430',0,'15257',0,'17800',0
db '5',0,'3',0,'42',0,'104',0,'85',0,'210',0,'123',0
db '111',0,'105',0,'125',0,'140',0,'136',0,'153',0,'211',0,'199',0
db '209',0,'224',0,'239',0,'260',0,'304',0,'333',0
data ends
code segment
start:
call print_year
call print_come
call print_cont
call print_ccme
mov ax, 4c00h
int 21h
print_year: mov ax,data
mov ds,ax
mov si,0
mov ax, 0b800h
mov es,ax
mov di, 0
mov bx, 500
mov cx, 21
print_year_s: push cx
mov cx, 4
mov di, 0
print_year_cs: push cx
mov cl, ds:
mov ch, 2
mov es:,cx
add si,1
add di,2
pop cx
loop print_year_cs
add bx,160
pop cx
loop print_year_s
ret
print_come: mov ax, data
mov ds, ax
mov bx, 84
mov ax, 0B800h
mov es, ax
mov bp, 520
mov di, 0
mov cx, 21
print_come_s: push cx
mov di, 0
print_come_cs: mov cx, 0
mov cl, ds:
jcxz print_come_jp
mov ch, 2
mov es:, cx
add di, 2
add bx, 1
loop print_come_cs
print_come_jp: add bx,1
add bp, 160
pop cx
loop print_come_s
ret
print_cont: mov bp, 552
mov di, 0
mov cx, 21
print_cont_s: push cx
mov di, 0
print_cont_cs: mov cx, 0
mov cl, ds:
jcxz print_cont_jp
mov ch, 2
mov es:, cx
add di, 2
add bx, 1
loop print_cont_cs
print_cont_jp: add bx,1
add bp, 160
pop cx
loop print_cont_s
ret
print_ccme: mov bp, 580
mov di, 0
mov cx, 21
print_ccme_s: push cx
mov di, 0
print_ccme_cs: mov cx, 0
mov cl, ds:
jcxz print_ccme_jp
mov ch, 2
mov es:, cx
add di, 2
add bx, 1
loop print_ccme_cs
print_ccme_jp: add bx,1
add bp, 160
pop cx
loop print_ccme_s
ret
code ends
end start
页:
[1]