$29
Purpose: Become familiar with data conversion, addressing modes, and assembly language macro's.
Points: 100
Background:
The tridecimal1 system (also known as triskadecimal or base-13) is a positional notation numeral system using thirteen as its base. It uses 13 different digits for representing numbers. The digits for base 13 could be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, and C.
The number thirteen (that is, the number written as "13" in the base ten numerical system) is instead written as "10" in tridecimal (meaning "1 thirteen and 0 units", instead of "1 ten and 0 units"), whereas the digit string "15" means "1 thirteen and 5 units" (i.e. the same number that in decimal is written as "18").
The symbol A13 is used for 1010, B13 is used for 1110, and C12 is used for 1210.
For example.
base-10 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
base-13 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
|
|
|
|
|
|
|
|
|
|
|
|
|
Assignment
Write an assembly language program to convert tridecimal/ASCII string to integers and integers to tridecimal/ASCII strings. Using the provided main, the program has two key steps are follows:
You may assume valid/correct data. As such, no error checking is required. You may add additional variables as needed.
1 For more information, refer to: https://en.wikipedia.org/wiki/Tredecimal
Submission:
Program Header Block
All source files must include your name, section number, assignment, NSHE number, and program description. The required format is as follows:
Failure to include your name in this format will result in a loss of up to 10%.
Scoring Rubric
Scoring will include functionality, code quality, and documentation. Below is a summary of the scoring rubric for this assignment.
Debugging
Since macro's can be difficult to debug, the code for step 1 should be working before attempting step 2.
The code for a macro will not be displayed in the source window. In order to see the macro code, display the machine code window (View → Machine Code Window). In the window, the machine code for the instructions are displayed. The step and next instructions will execute the entire macro. In order to execute the macro instructions, the stepi and nexti commands must be used (which are only used for macro’s).
To help check results, an on-line conversion is available at the following URL:
http://www.cleavebooks.co.uk/scol/calnumba.htm.
Debugger Commands:
Below is an example of some of the commands to display the variables within DDD.
x/dw &iNum1
x/5dw &iLst1
Note, in DDD, select View → Execution Window to display a window that shows the output.