1 ;16位汇编 BX、BP、SI、DI 才能间接寻址, ax不行 2 ;程序开始时cx大小是程序的长度 3 ;存储器不能到存储器 mov/add 4 5 assume cs : codesg, ds : datasg, ss : stacksg 6 7 datasg SEGMENT 8 db '19751976197719781979','1977','1977','1977','1977','1977','1977','1977','1977','1977','1977','1977','1977','1977','1977','1977','1977' 9 dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514,345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000 10 dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226,11542,14430,15257,17800 11 datasg ENDS 12 13 table SEGMENT 14 db 21 dup ('year sumn ne ?? ') 15 table ENDS 16 17 stacksg SEGMENT 18 dw 0, 0, 0, 0, 0, 0, 0, 0 19 stacksg ENDS 20 21 codesg SEGMENT 22 start: mov ax, datasg 23 mov ds, ax 24 mov ax, table 25 mov es, ax 26 27 mov cx, 21 28 mov bx, 0 29 mov si, 0 30 s: mov ax, [bx] 31 mov es : [si], ax 32 mov ax, [bx + 2] 33 mov es : [si + 2], ax 34 mov byte ptr es : [si + 4], ' ' 35 add bx, 4 36 add si, 16 37 loop s 38 39 mov cx, 21 40 mov bx, 84 41 mov si, 5 42 s1: mov ax, [bx] 43 mov es : [si], ax 44 mov ax, [bx + 2] 45 mov es : [si + 2], ax 46 mov byte ptr es : [si + 4], ' ' 47 add bx, 4 48 add si, 16 49 loop s1 50 51 mov cx, 21 52 mov bx, 168 53 mov si, 10 54 s2: mov ax, [bx] 55 mov es : [si], ax 56 mov byte ptr es : [si + 2], ' ' 57 add bx, 2 58 add si, 16 59 loop s2 60 61 mov si, 84 62 mov di, 168 63 mov bx, 13 64 mov cx, 21 65 s3: mov ax, [si] 66 mov dx, [si + 2] 67 div word ptr [di] 68 mov es : [bx], ax 69 add bx, 16 70 add si, 4 71 add di, 2 72 loop s3 73 mov ax, 4c00h 74 int 21h 75 codesg ENDS 76 END start