Write Assembly code (8086) that implements the function of (A.B) +C.
Solution
nclude macros.asm ; pull in defs of macros begcode gotoxy ; define start of code seg called
gotoxy ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; C++ interface routine, C linkage. ; Puts cursor at row, col. ;
Usage: ; void gotoxy(int row, int col); IFNDEF DOS386 public _gotoxy ; make gotoxy
global _gotoxy proc near ; define start of func push BP ; save old stack frame mov
BP,SP ; set BP to point to old BP mov DH,P[BP] ; DH = row mov DL,P[BP+2] ; DL
= col mov AH,2 ; BIOS function set cursor pos. xor BX,BX ; page 0 int 10h
; BIOS video interrupt pop BP ; restore old BP ret ; return to caller _gotoxy
endp ; define end of func ELSE public _gotoxy ; make gotoxy global _gotoxy proc near
; define start of func push EBP ; save old stack frame mov EBP,ESP ; set EBP to
point to old BP uses ; saves registers that are used mov DH,P[EBP] ; DH = row mov
DL,P[EBP 4] ; DL = col mov AH,2 ; BIOS function set cursor pos. xor EBX,EBX ;
page 0 int 10h ; BIOS video interrupt unuse ; note reverse order pop EBP ;
restore old EBP ret ; return to caller _gotoxy endp ; define end of func ENDIF
endcode gotoxy ;define end of code seg end

Write Assembly code (8086) that implements the function of (A.B) +C..pdf

  • 1.
    Write Assembly code(8086) that implements the function of (A.B) +C. Solution nclude macros.asm ; pull in defs of macros begcode gotoxy ; define start of code seg called gotoxy ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; C++ interface routine, C linkage. ; Puts cursor at row, col. ; Usage: ; void gotoxy(int row, int col); IFNDEF DOS386 public _gotoxy ; make gotoxy global _gotoxy proc near ; define start of func push BP ; save old stack frame mov BP,SP ; set BP to point to old BP mov DH,P[BP] ; DH = row mov DL,P[BP+2] ; DL = col mov AH,2 ; BIOS function set cursor pos. xor BX,BX ; page 0 int 10h ; BIOS video interrupt pop BP ; restore old BP ret ; return to caller _gotoxy endp ; define end of func ELSE public _gotoxy ; make gotoxy global _gotoxy proc near ; define start of func push EBP ; save old stack frame mov EBP,ESP ; set EBP to point to old BP uses ; saves registers that are used mov DH,P[EBP] ; DH = row mov DL,P[EBP 4] ; DL = col mov AH,2 ; BIOS function set cursor pos. xor EBX,EBX ; page 0 int 10h ; BIOS video interrupt unuse ; note reverse order pop EBP ; restore old EBP ret ; return to caller _gotoxy endp ; define end of func ENDIF endcode gotoxy ;define end of code seg end