Sunday, January 16, 2022

Write assembly language instructions to pop the 3 numbers.

 INCLUDE C:\IRVINE\IRVINE32.INC

.386

.STACK 4096

EXITPROCESS PROTO,DWEXITCODE:DWORD

.DATA                                                  

array DWORD 34,54,23

array2 dword 3 DUP(0)

.CODE

MAIN PROC                                               

MOV EDX,OFFSET array

mov esi,0

mov ecx,3

l1:

mov eax,array[esi]

push eax

add esi,4

loop l1

MOV EDX,OFFSET array2

mov esi,0

mov ecx,3

L2:

pop eax

mov array2[esi],eax

add esi,4

loop l2

MOV EDX,OFFSET array2

mov esi,0

mov ecx,3

L3:

mov eax,array2[esi]

call WriteInt

call crlf

add esi,4

loop l3

INVOKE EXITPROCESS,0

MAIN ENDP

END MAIN

No comments:

Post a Comment