Embed presentation
Download to read offline
![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](https://image.slidesharecdn.com/writeassemblycode8086thatimplementsthefunctionofa-230704163812-76e1cbb3/75/Write-Assembly-code-8086-that-implements-the-function-of-A-B-C-pdf-1-2048.jpg)
The document contains assembly code for the 8086 architecture that implements a function to calculate the expression (a.b) + c. It includes a macro for a cursor positioning routine 'gotoxy' that communicates with BIOS interrupts to set the cursor position. The code is structured to support both DOS and Windows environments with appropriate calling conventions.
![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](https://image.slidesharecdn.com/writeassemblycode8086thatimplementsthefunctionofa-230704163812-76e1cbb3/75/Write-Assembly-code-8086-that-implements-the-function-of-A-B-C-pdf-1-2048.jpg)