王爽 汇编实验10-3

assume cs:code

data 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'
    ;表示21年的21个字符串

    dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514
    dd 345980,590827,803530,1183000,1843000,27590000,3753000,4649000,5937000
    ;以上是21年公司总收入的21个dword数据

    dw 3,7,9,13,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226
    dw 11542,14430,15257,17800
    ;以上是公司雇员人数的21个word数据

    dw 5,3,42,104,85,210,123,111,105,125,140,136,153,211,199,209,224
    dw 239,260,304,333
    ;以上显示的最后一行的数据
data ends
    
code segment
start:
    mov ax,data
    mov ds,ax
    mov ax,0b800h
    mov es,ax
    mov bx,0
    mov cx,21   ;21个年份
    mov si,0

year_1:
    push cx     ;暂存外循环次数
    mov di,0
    mov dl,02h  ;字的属性
    mov cx,4    ;四个字符 循环四次

year:    
    mov al,[si]
    mov es:[bx+di],al
    mov es:[bx+di+1],dl
    add di,2
    inc si
    loop year

    add bx,160      ;下一行
    pop cx          ;取出外循环的值
    loop year_1

    mov ax,4c00h
    int 21h
code ends
end start

你可能感兴趣的:(王爽 汇编实验10-3)