Computer Science   I get an error in my code: Exception thrown at 0x00000001 in Project4.exe: 0xC0000005: Access violation executing location 0x00000001. I'm confident that the Irvine32 libraries are properly implemented and I'm using MASM x86 Assembly language in C++ Please fix the code! INCLUDE Irvine32.inc .data msg_system_params db "System Parameters on Stack", 0 msg_separator db "___________________________________________", 0 msg_format db "Address: %08Xh => Content: %08Xh", 0 newline db 0Ah, 0 .code main PROC ; Set up stack frame push ebp mov ebp, esp ; Push variables onto the stack push 1 push 2 push 3 push 4 push 5 ; Call runLevelOne procedure call runLevelOne ; Clean up the stack mov esp, ebp ; Restore stack frame and return pop ebp mov eax, 0 ret main ENDP runLevelOne PROC ; Set up stack frame push ebp mov ebp, esp ; Display text "System Parameters on Stack" lea eax, msg_system_params call displayText ; Display separator line lea eax, msg_separator call displayText ; Display stack addresses and contents mov ecx, 5 ; Number of variables lea esi, [ebp + 8] ; Start address of the variables displayLoop: ; Get current address and content mov eax, esi mov ebx, [esi] ; Display address and content push ebx push eax lea eax, msg_format call displayText ; Increment address for the next variable add esi, 4 loop displayLoop ; Display separator line lea eax, msg_separator call displayText ; Restore stack frame and return pop ebp ret runLevelOne ENDP displayText PROC ; Save registers push ebx ; Print string mov edx, eax call WriteString ; Check if new line required cmp byte ptr [esp + 4], 1 jne displayTextExit ; Print new line call Crlf displayTextExit: ; Restore registers and return pop ebx ret displayText ENDP END main The output should be like this:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question

Computer Science

 

I get an error in my code:

Exception thrown at 0x00000001 in Project4.exe: 0xC0000005: Access violation executing location 0x00000001.

I'm confident that the Irvine32 libraries are properly implemented and I'm using MASM x86 Assembly language in C++

Please fix the code!

INCLUDE Irvine32.inc .data msg_system_params db "System Parameters on Stack", 0 msg_separator db "___________________________________________", 0 msg_format db "Address: %08Xh => Content: %08Xh", 0 newline db 0Ah, 0 .code main PROC ; Set up stack frame push ebp mov ebp, esp ; Push variables onto the stack push 1 push 2 push 3 push 4 push 5 ; Call runLevelOne procedure call runLevelOne ; Clean up the stack mov esp, ebp ; Restore stack frame and return pop ebp mov eax, 0 ret main ENDP runLevelOne PROC ; Set up stack frame push ebp mov ebp, esp ; Display text "System Parameters on Stack" lea eax, msg_system_params call displayText ; Display separator line lea eax, msg_separator call displayText ; Display stack addresses and contents mov ecx, 5 ; Number of variables lea esi, [ebp + 8] ; Start address of the variables displayLoop: ; Get current address and content mov eax, esi mov ebx, [esi] ; Display address and content push ebx push eax lea eax, msg_format call displayText ; Increment address for the next variable add esi, 4 loop displayLoop ; Display separator line lea eax, msg_separator call displayText ; Restore stack frame and return pop ebp ret runLevelOne ENDP displayText PROC ; Save registers push ebx ; Print string mov edx, eax call WriteString ; Check if new line required cmp byte ptr [esp + 4], 1 jne displayTextExit ; Print new line call Crlf displayTextExit: ; Restore registers and return pop ebx ret displayText ENDP END main

The output should be like this:

Sample Run/Output
Microsoft Visual Studio Debug Console
System Parameters on Stack
Address: 00BBFB4CH => Content: 00000001H
Address: 00BBFB50H=> Content: 00000002H
Address: 00BBFB54H => Content: 00000003H
Address: 00BBFB58H => Content: 00000004H
Address: 00BBFB5CH => Content: 00000005H
I
0
X
Transcribed Image Text:Sample Run/Output Microsoft Visual Studio Debug Console System Parameters on Stack Address: 00BBFB4CH => Content: 00000001H Address: 00BBFB50H=> Content: 00000002H Address: 00BBFB54H => Content: 00000003H Address: 00BBFB58H => Content: 00000004H Address: 00BBFB5CH => Content: 00000005H I 0 X
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education