Given the data Rval BYTE 0FFh Xval BYTE 8Fh Yval BYTE 0C0h Z

Given the data: Rval BYTE 0FFh Xval BYTE 8Fh Yval BYTE 0C0h Zval BYTE 0EFh Wval BYTE 7Eh Write an assembly program to evaluate the following expression. -Rval - Xval + Yval - (Zval - Wval) And save the result in eax.

Solution

Solution :

; Evaluation of expression

Rval BYTE 0FFh
Xval BYTE 8fh
Yval BYTE 0c0h
Zval BYTE 0efh
Wval BYTE 7Eh
mov eax, 0   
mov ecx, Rval
mul ecx,-1
add eax,ecx   
mov ecx, Xval
mul ecx,-1
add eax,ecx
mov ecx, Yval
add eax,ecx
mov ecx, Zval
mul ecx,-1
add eax,ecx
mov ecx, Wval
add eax,ecx   

 Given the data: Rval BYTE 0FFh Xval BYTE 8Fh Yval BYTE 0C0h Zval BYTE 0EFh Wval BYTE 7Eh Write an assembly program to evaluate the following expression. -Rval

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site