请教各位下面道题是如何将数组ary首地址送si的? parm_seg segment ary dw 100 dup(?) count dw 100 sum dw ? parm_seg ends
stack_seg segment dw 128 dup(?) tos label word stack_seg ends
code1 segment main proc far assume cs:code1,ds:parm_seg,ss:stack_seg start: mov ax,stack_seg mov ss,ax mov sp,offset tos
push ds sub ax,ax push ax mov ax,parm_seg mov ds,ax
mov bx,offset ary push bx mov bx,offset count push bx mov bx,offset sum push bx call far ptr proadd …… ret main endp code1 ends
code2 segment assume cs:code2 ; 定义stack_strc结构数据 stack_strc struc save_bp dw ? save_cs_ip dw 2 dup(?) par3_addr dw ? par2_addr dw ? par1_addr dw ? stack_strc ends
proadd proc far push bp mov bp,sp push ax push cx push si push di mov si,[bp].par1_addr ; 数组ary首地址送si mov di,[bp].par2_addr ; count单元地址送di mov cx,[di] ; count单元内容送di mov di,[bp].par3_addr ; sum单元地址送di xor ax,ax next: add ax,[si] add si,2 loop next mov [di],ax ; 累加和送sum单元 pop di pop si pop cx pop ax pop bp ret 6 proadd endp code2 ends end start [BP]它不是结构体,它怎么可以以mov si,[bp].par1_addr ? 而且在结构 stack_strc struc中par1_addr 是没有赋值的,[BP]是怎么会偏移到 堆栈中ARY的位置呢?