Ok I have an assignment that requires me to create 3 macros to do 3 different function. I have the first one completed but the 2nd two are giving me some trouble.
#2) Write a macro that takes in 2 32-bit integers and divides the first from the second and lists the remainder (if any).
Here is the macro I currently have:
mDIV MACRO text
.data
Dvalue DWORD ?
Dvalue2 DWORD ?
prompt3 BYTE "Enter your first Integer: ",0
prompt4 BYTE "Enter your second Integer: ",0
prompt5 BYTE "Answer: ",0
.code
mov edx, OFFSET prompt3
call WriteString
call ReadDec
mov eax, 12
call Crlf
mov edx, OFFSET prompt4
call WriteString
call ReadDec
mov ebx, 6
call Crlf
div bl
mov edx, OFFSET prompt5
call WriteString
call WriteDec
call Crlf
call WaitMsg
ENDM
Currently I just place values in EAX & EBX to ensure it works. But when I change it to:
mov Dvalue, eax
mov Dvalue2, ebx
The program crashes. Any idea why?
Now for the 3rd macro:
#3 Take a character input and output it's ASCII value, on this one I have no clue on how to do it. My book does mention using "aaa" to convert it but when I do that all I get is 0, which last I checked wasn't the ASCII value of every single character. Only code I have for this one currently is just the input portion so I see no need to place it up.