Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions