سلام دوستان
میشه بگین این 2 تا کد اسمبلی هر کدومشون چه کارهایی انجام می دن؟
کد:page 65,105title address-mod demonstration of dfifferent adderessing mode ;this routine demonstrates several addressing modes available ; ; defining stack segment stseg segment para stack 'stack' db 64 dup(?) stseg ends ; ; defining data segment daseg segment para public 'data' datad db 0 dataw db 10h datax db 25h datay db 57h dataz db 0ffh dataq db 10 datar dw 255 datas db 00001111b dataj dw 60 datau dw 100h daseg ends ; ; defining code segment coseg segment para public 'code' start proc far assume cs:coseg, ds:daseg, ss:stseg mov ax,daseg ;find data segment address mov ds,ax ;load ds with sement address ; mov al,dataw ;direct addressing ; mov bx,offset datax ;indirect addressing mov al,[bx] ; mov al,[bx+2] ;base relative addressing ; mov si,2 ;direct index addressing mov al,dataz[si] ; mov bx,offset dataw ;based indexed addressing mov si,8 mov ax,[bx][si+2] ; mov ah,4ch ;return to operating system int 21h ; start endp ;end of segment coseg ends ;end of segment end start
و این کد:
کد:page 65,105title address-com demonstration of dfifferent adderessing mode ;this routine demonstrates several addressing modes available ; the progrm is written in com mode ; ; defining only code segment coseg segment para public 'code' assume cs:coseg, ds:coseg, ss:coseg org 100h begin: Jmp start datad db 0 dataw db 10h datax db 25h datay db 57h dataz db 0ffh dataq db 10 datar dw 255 datas db 00001111b dataj dw 60 datau dw 100h ; start proc near mov al,dataw ;direct addressing ; mov bx,offset datax ;indirect addressing mov al,[bx] ; mov al,[bx+2] ;base relative addressing ; mov si,2 ;direct index addressing mov al,dataz[si] ; mov bx,offset dataw ;based indexed addressing mov si,8 mov ax,[bx][si+2] ; mov ah,4ch ;return to operating system int 21h ; start endp ;end of segment coseg ends ;end of segment end begin





پاسخ با نقل قول


علاقه مندی ها (Bookmarks)