Question: I have this assembler program in MASM i need to do: . 4 8 6 . model flat, stdcall option casemap: none include masm

I have this assembler program in MASM i need to do:
.486
.model flat, stdcall
option casemap: none
include \masm32\include\windows.inc ; For a management by the modes of Window
include \masm32\include\user32.inc ; For using MessageBox
include \masm32\include\kernel32.inc ; For using ExitProcess
include \masm32\include\masm32.inc ; For using FloatToStr
includelib \masm32\lib\user32.lib ; For using MessageBox
includelib \masm32\lib\kernel32.lib ; For using ExitProcess
NUM macro Q, M, N, O
MOV AL, O ; Copy number C0 to register AL
CBW ; Sign-extend AL to AX
INC AL ; Increment AL by 1
MOV BL, N ; Copy number B to register BL
IMUL BL ; Multiply AL by BL (c*b)
MOV CL, M ; Copy number A to register CL
SAR CL,2 ; Right-shift CL by 2 bits (a/4)
SUB AL, CL ; Subtract CL from AL (c*b - a/4)
CBW ; Sign-extend AL to AX
ADD AX, AL ; Add AL to AX (b + c*b - a/4)
MOV Q, AX ; Move the result to the provided register Q
endm
DEN macro R, S, T
MOV AL, S ; Copy number A to register AL
MOV BL, T ; Copy number B to register BL
IMUL BL ; Multiply AL by BL (a*b)
DEC AL ; Decrement AL by 1(a*b -1)
MOV R, AL ; Move the result to the provided register R
endm
.data
msg_title db "Lab5",0
buffer db 256 dup(?)
format db "A =%d",10,"B =%d",10,"C =%d",10,"(b + c*b - a/4)/(a*b -1)=%d",0
A DB -4,8,4,12,-8
B DB -3,2,-2,2,3
C0 DB -8,15,12,35,-10
D dd 0
E dd 0
F dd 0
.code
start:
MOV EDI,0 ; Pointer to set, changed from 0 to 4
;(b + c*b - a/4)/(a*b -1)
CYCLE:
CMP EDI, 5
jz CONT1
NUM BX, B[EDI], C0[EDI], A[EDI]
DEN AX, A[EDI], B[EDI]
TEST AX,1 ;Tests the parity of a number, and if the result is 1, it is odd.
JNZ OD ;If the result is not 0, jump to the OD branch.
SAR AX,1 ;Right-shift the value in register AX by 1 bit
JMP CONT
OD:
MOV BX,5 ; Copy constant "5" to register BX
IMUL AX ; Multiplication register AX and "5", result in AX register.
CONT:
mov ESI, OFFSET A[EDI] ; Load the memory address of A[EDI] into ESI
movsx EAX, byte ptr [ESI] ; Load the value at memory address stored in ESI into EAX with sign extension
mov D, EAX
mov ESI, OFFSET B[EDI] ; Load the memory address of B[EDI] into ESI
movsx EAX, byte ptr [ESI] ; Load the value at memory address stored in ESI into EAX with sign extension
mov E, EAX
mov ESI, OFFSET C0[EDI] ; Load the memory address of C0[EDI] into ESI
movsx EAX, byte ptr [ESI] ; Load the value at memory address stored in ESI into EAX with sign extension
mov F, EAX
invoke wsprintf, addr buffer, addr format, D, E, F, eax
invoke MessageBox, 0, addr buffer, addr msg_title, MB_OK
INC EDI
JMP CYCLE
CONT1:
invoke ExitProcess, 0
end start
But I get this error:
ASCII build
NUM(10): Macro Called From
DEN(5): Macro Called From
Assembly Error
...
Can you rewrite the whole program again in the right way to compare it with mine to distinguish between both not just the corrected items please?
I have this assembler program in MASM i need to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!