I am beginner with assembly language Can you help me out Tha

I am beginner with assembly language. Can you help me out? Thank you! (If you can explain it\'d be great!)

Write an assembly language function int isGreater(int a, int b) that will return 1 if a b will return 0 otherwise. Hi can you help me write an ASSEMBLY LANGUAGE for this function? The main is in C, and l am using SEGGER. Thank you.

Solution

IFNDEF

public _isgreater   ; make isgreater global

_isgreater 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 = a

mov DL,P[BP+2]   ; DL = b

mov AH,2 ; BIOS function set cursor pos.

cmp DL ;compares

pop BP   ; restore old BP

ret   ; return to caller

_isgreater endp   ; define end of func

ELSE

public _isgreater   ; make gotoxy global

_isgreater 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 = a

mov DL,p[EBP 4] ; DL = b

mov AH,2 ; BIOS function set cursor pos.

unuse    ; note reverse order

pop EBP   ; restore old EBP

ret    ; return to caller

_isgreater endp ; define end of func

endcode isgreater ;define end of code seg end

I am beginner with assembly language. Can you help me out? Thank you! (If you can explain it\'d be great!) Write an assembly language function int isGreater(int

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site