Computer Organization and Programming - Homework 4 | ECE 267, Assignments of Computer Architecture and Organization

Material Type: Assignment; Class: Computer Organization I; Subject: Electrical and Computer Engr; University: University of Illinois - Chicago; Term: Unknown 2012;

Typology: Assignments

2011/2012

Uploaded on 05/18/2012

koofers-user-90c
koofers-user-90c 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Web code:
Last name:
First name:
ECE 267 - Computer Organization and Programming
Homework #7
(Attach a typed version of your assembly language code for each part to this cover sheet; you need not run the code to
see if it actually works but this is recommended in order to get the bugs out.)
Write an IA-32 assembly language macro that simplifies the process of debugging a
program by displaying a string, then (optionally) a 32-bit register's contents on the screen
in hex, followed by a carriage return and linefeed, followed by waiting for the user to
press any key to continue. You are expected to call the author's WriteString, WriteHex,
Crlf and ReadChar procedures from within your macro.
Here is how the macro should be invoked:
mDebug "string" [,reg32]
The first parameter is a string of characters within quotes that is to be displayed,
followed by a space character. If the second parameter is present, then the contents of
is a 32-bit register name whose contents are then to be displayed in hex code. Any 32-
bit register name may be used, including the stack pointer register esp.
Examples
mDebug "Calling Proc1"
mDebug "ebx register contents:",ebx
Be sure to save and then restore the contents of all registers that are used for temporary
storage.

Partial preview of the text

Download Computer Organization and Programming - Homework 4 | ECE 267 and more Assignments Computer Architecture and Organization in PDF only on Docsity!

Web code:

Last name:

First name:

ECE 267 - Computer Organization and Programming

Homework #

(Attach a typed version of your assembly language code for each part to this cover sheet; you need not run the code to see if it actually works but this is recommended in order to get the bugs out.)

Write an IA-32 assembly language macro that simplifies the process of debugging a program by displaying a string, then (optionally) a 32-bit register's contents on the screen in hex, followed by a carriage return and linefeed, followed by waiting for the user to press any key to continue. You are expected to call the author's WriteString, WriteHex, Crlf and ReadChar procedures from within your macro.

Here is how the macro should be invoked:

mDebug "string" [,reg32]

The first parameter is a string of characters within quotes that is to be displayed, followed by a space character. If the second parameter is present, then the contents of is a 32-bit register name whose contents are then to be displayed in hex code. Any 32- bit register name may be used, including the stack pointer register esp.

Examples

mDebug "Calling Proc1"

mDebug "ebx register contents:",ebx

Be sure to save and then restore the contents of all registers that are used for temporary

storage.