1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
| assume cs:code,ds:data,ss:stack
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'
dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514 dd 345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000
dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226 dw 11542,11430,15257,17800 data ends
string segment dw 8 dup (0) string ends
stack segment dw 16 dup (0) stack ends
code segment
start: mov ax,data mov ds,ax mov ax,stack mov ss,ax mov sp,32 mov ax,0b800h mov es,ax
mov bx,0a0h mov bp,0 mov di,0 mov cx,21
s1: push cx mov cx,4 mov si,0
s2: mov al,ds:[di] mov ah,7 mov es:[bx+si],ax inc di add si,2 loop s2 mov ax,ds:[di].50h mov dx,ds:[di].52h call dtoc push di mov di,20 call show_str pop di mov ax,ds:[bp].0a8h mov dx,0 call dtoc push di mov di,40 call show_str pop di
mov ax,ds:[di].50h mov dx,ds:[di].52h push bx mov bx,ds:[bp].0a8h div bx pop bx mov dx,0 call dtoc push di mov di,60 call show_str pop di
add bx,0a0h add bp,2 pop cx loop s1
mov ax,4c00h int 21h
dtoc: push dx push cx push bx push ax push di push si
mov di,0 s3: mov cx,10 call divdw add cx,30h push cx inc di mov cx,ax or cx,dx jcxz ok1 inc cx loop s3 ok1: mov cx,di mov si,0e0h s4: pop ds:[si] inc si loop s4 mov byte ptr ds:[si],0 pop si pop di pop ax pop bx pop cx pop dx ret
divdw: push bx push ax mov ax,dx mov dx,0 div cx mov bx,ax
pop ax div cx mov cx,dx
mov dx,bx pop bx ret
show_str: push dx push cx push bx push ax push si push di mov si,0e0h mov ah,7 s5: mov al,ds:[si]
mov cl,al mov ch,0 jcxz ok2 mov es:[bx+di],ax add di,2 inc si loop s5
ok2: pop di pop si pop ax pop bx pop cx pop dx ret
code ends
end start
|