Question: Visual Studio Assembly Language Please fix my code so that it is able to run: .386 .model flat, stdcall .stack 4096 ExitProcess proto, dwExitCode:dword .data

Visual Studio Assembly Language Please fix my code so that it is able to run:

.386 .model flat, stdcall .stack 4096 ExitProcess proto, dwExitCode:dword

.data bVal BYTE 100 wVal WORD 2 dVal DWORD 5 array db 1, 2, 3, 4, 5 value dw -1234 value1 dd 1234 value2 dw 5678 result DWORD 0 var1 DWORD 10000h var2 DWORD 20000h

.code start: ; MOV Directive mov esi, OFFSET wVal mov byte ptr bVal, 25 mov al, byte ptr bVal mov bVal2, al xor eax, eax

; OFFSET Directive mov eax, OFFSET array mov ebx, [eax]

; LENGTHOF Directive mov eax, LENGTHOF array lea ebx, array[eax]

; SIZEOF Directive mov eax, SIZEOF value lea ebx, value[eax]

; ADD/SUB Directive mov eax, var1 add eax, var2 add ax, 0FFFFh add eax, 1 sub ax, 1 mov eax, 11 mov result, eax invoke ExitProcess, 0

; DEC Directive mov eax, 10 dec eax

; INC Directive mov eax, 10 inc eax

; JMP Directive mov eax, 10 jmp end

start_loop: ; LOOP Directive mov ecx, 5 loop_start: mov eax, 10 add eax, 5 loop loop_start

; MOVSX Directive movzx eax, word ptr[value] movsx ebx, word ptr[value]

; NEG Directive mov eax, 10 neg eax

; PTR Directive mov eax, dword ptr[value1] mov bx, word ptr[value2]

; XCHG Directive xchg ax, bx xchg ah, al xchg eax, ebx

; Exit the program invoke ExitProcess, 0

end: jmp end end start

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!