自己刚做的实验七,嘻嘻~也像大家一样贴出来求指教
assume cs:code,ds:data,es:table,ss:stackassume cs:code,ds:data,es:table,ss:stack
data segment
db '1975','1976','1977'
;以上表示21年中前3年的3个字符串 (总共有12个字节)
dd 16,22,382
;以上表示21年公司总收入的前3个dword型数据(总共有12个字节)
dw 3,7,9
;以上表示21年公司雇员人数的前3个word型数据(总共有6个字节)
data ends
table segment
db 3 dup ('year summ ne ?? ') ;(4,1,4,1,2,1,2,1)*3
table ends
stack segment
dw 3 dup(0)
stack ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,table
mov es,ax
mov ax,stack
mov ss,ax
mov sp,6
mov bx,0
mov cx,3
mov si,0
mov di,0
s:
mov ax,ds:12
add si,2
mov dx,ds:12
sub si,2
div word ptr ds:24
;ax得到商
push di
push cx
mov cx,2
mov di,0
YearAndSumm:
mov dx,ds:0
mov es:,dx
mov dx,ds:12
mov es:,dx
add si,2
add di,2
loop YearAndSumm
pop cx
pop di
;将year和summ存入table
mov dx,ds:24
mov es:,dx
mov es:,ax
;将ne和??存入table
add di,2
add bx,16
loop s
;循环存储
mov ax,4c00h
int 21h
code ends
end start
页:
[1]