Question: DECLARE 'A' and DECLARE 'B' RUN THIS IN VISUAL STUDIOS AND SEND SCREENSHOTS OF THE MEMORY AND REGISTERS FOLLOW THIS FORMAT- ------------------------------------------------- .386 .model flat,

DECLARE 'A' and DECLARE 'B'

RUN THIS IN VISUAL STUDIOS AND SEND SCREENSHOTS OF THE MEMORY AND REGISTERS

FOLLOW THIS FORMAT-

-------------------------------------------------

.386 .model flat, stdcall .stack 4096

ExitProcess PROTO, dwExitCode:DWORD

.data ; //declare variables here

.code main PROC

INVOKE ExitProcess, 0

main ENDP

END main

-------------------------------------------------------

--------------------------------Question

Write a 32-bit x86 assembly program that performs the following operations:

Part 1: Swaps content of EBX as follows:

Requirement: Store 'A' in EBX LSB or BL, store 'B' in BH, and then swap BL and BH. You will have to use a temporary storage, you can use EAX (use AL) or any storage you may define.

For example: Content of EBX at init: 00000000, then after storing A and B: EBX = 00004241 ; 4241=ASCII codes in Hex

After swapping: EBX = 00004142 which is BA

------------------------------------------------------------

NOT WORKING CODE:

.386 .model flat, stdcall .stack 4096 .data

.code main PROC

MOV BL, 'A' MOV BH, 'B' MOV AL, BL MOV BL, BH MOV BH, AL

INVOKE ExitProcess, 0 main ENDP END main

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 Databases Questions!