Difference between revisions of "CSC231 Homework 7 Fall 2012"

From dftwiki3
Jump to: navigation, search
(Problem #2)
(Problem #2)
Line 26: Line 26:
 
<br />
 
<br />
  
Concentrate on the hexadecimal code for each letter.  You will notice that 'A' through 'O' have the same upper nybble.  'A' is 0x'''4'''1 and 'O' is 0x'''4'''F.
+
Concentrate on the hexadecimal code for each letter.  You will notice that 'A' through 'O' have the same upper nybble.  'A' is 0x'''4'''1 and 'O' is 0x'''4'''F.  So, if I wanted to ''squeeze'' a string made of upper-case letters between 'A' and 'O', I would only need to store the lower nybble, and I'd save some memory.
 +
 
 +
The purpose of this problem is for you to take a string created using this method, decode it, and print it on the screen.
 +
 
 +
Your program will contain the following 3 strings and should decode them and print them.

Revision as of 12:51, 24 October 2012

--D. Thiebaut 13:47, 24 October 2012 (EDT)


This assignment is due the evening of Oct. 31st, at midnight (booo!). You can work on this assignment in pairs.

Problem #1

Write a program that displays the contents of a double-word in hexadecimal. Your program should store the value 0x1234ABCD in a variable called x and should display this information:

  x = 305441741 = 0x1234ABCD


Submission

Submit your program (called hw7a.asm) as follows:

 rsubmit hw7 hw7a.asm

Problem #2

Take a look at the section of the ASCII table below:


ASCIIUpperCase.png


Concentrate on the hexadecimal code for each letter. You will notice that 'A' through 'O' have the same upper nybble. 'A' is 0x41 and 'O' is 0x4F. So, if I wanted to squeeze a string made of upper-case letters between 'A' and 'O', I would only need to store the lower nybble, and I'd save some memory.

The purpose of this problem is for you to take a string created using this method, decode it, and print it on the screen.

Your program will contain the following 3 strings and should decode them and print them.