title LAB2
page ,132
SSEG segment para stack 'stack'
db 1,2,3,4,5,6,7,8,9,64 dup(0)
SSEG ends
DSEG segment para public 'data'
B_TAB db 1ah,2bh,3ch,4dh,5eh,6fh,7ah,8bh
W_TAB dw 1a2bh,3c4dh,5e6fh,7a8bh
B_TAB1 db 8 dup(0)
W_TAB1 dw 8 dup(0)
DSEG ends
ESEG segment
W_TAB2 dw 11h,12h,13h,14h,15h,16h,17h,18h
ESEG ends
CSEG segment para public 'code'
PROG proc far
assume ds:DSEG,cs:CSEG,ss:SSEG,es:ESEG
push ds
mov ax,0
push ax
;инициализация сегментных регистров
mov ax,DSEG
mov ds,ax
mov ax,ESEG
mov es,ax
;непосредственная
mov ax,2765
mov al,-3
mov ax,-3
mov B_TAB,-3
mov W_TAB,-3
push 2
pop ds
;регистровая
sub al,al
sub ax,ax
;прямая
mov ax,W_TAB
mov ax,W_TAB+3
mov ax,W_TAB+5
mov al,byte ptr W_TAB+5
mov al,B_TAB
mov al,B_TAB+2
mov ax,word ptr B_TAB
mov es:W_TAB2,ax
;косвенная
mov bx,offset W_TAB
mov si,offset W_TAB+1
mov di,offset W_TAB+2
mov al,[bx]
mov al,[si]
mov al,[di]
mov ax,[di]
mov bp,bx
mov al,[bp]
mov al,ds:[bp]
mov al,es:[bx]
mov ax,[bx]
;базовая
mov ax,[bx]+2
mov ax,[bx]+4
mov ax,[bx+2]
mov ax,[4+bx]
mov ax,2+[bx]
mov ax,4+[bx]
mov al,[bx]+2
mov bp,bx
mov ax,[bp+2]
mov ax,ds:[bp]+2
mov ax,ss:[bx+2]
;индексная
mov si,2
mov ah,B_TAB[si]
mov al,[B_TAB+si]
mov bh,[si+b_TAB]
mov bl,[si]+B_TAB
mov bx,es:W_TAB2[si]
mov bl,byte ptr es:W_TAB2[si]
mov bl,B_TAB[si]
;базовая индексная
mov bx,offset B_TAB
mov al,3[bx][si]
mov ah,[bx+3][si]
mov al,[bx][si+2]
mov ah,[bx+si+2]
mov bp,bx
mov ah,3[bp][si]
mov ax,ds:3[bp][si]
mov ax,word ptr ds:2[bp][si]
ret
PROG endp
CSEG ends
end PROG
|