Read each integer in an array of n 32 bit unsigned integer, mask it's MSB and LSB to zero without affecting other bits and then store the updated integer at corresponding position in another array
TITLE Assignment
INCLUDE Irvine32.inc
.data
Array1 DWORD 8003h, 3, 10, 0A500h, 15, 0E002h, 1Fh
Array2 DWORD LENGTHOF Array1 DUP(?)
.code
main PROC
mov ecx, LENGTHOF Array1
mov ESI, OFFSET Array1
mov EDI, OFFSET Array2
L1:
MOV EAX,0
MOV EAX, [ESI] ; Read integer in an Array1
AND EAX,7FFEh ; mask it's MSB and LSB to zero
MOV [EDI], EAX ; store the updated integer
ADD ESI, TYPE Array1
ADD EDI, TYPE Array2
Loop L1
call crlf
call WaitMsg
exit
main ENDP
end main
Comments
Leave a comment