Sat, 21st Nov 2015, 16:04 Re: 306-Ascii Question

A student writes:

> Hello Dr. Patt,
> My question isn't particularly conceptual like most questions;
> however, I hope that this is fine. 
> Basically, in a .STRINGZ how do we represent ASCII characters that
> cant be written on a keyboard, like the [line feed]? I remember that
> we talked about quotations in class but I assume there would be some
> type of extra notation for these characters.
> <<name withheld to protect the student who wants to improve on .STRINGZ>>

Sorry, I did not include this in my specification of the .STRINGZ pseudo-op.
I defined .STRINGZ to get rid of the tedium if you wanted to display a
character string on the screen.  The assembler will take each character in
your string, and assign the ascii code for that character to the next location
in your .obj (0's and 1's) file.  If you can't type a character, the assembler
can not convert it.  :-(

Suppose you want to display string1, then line feed, then string2.  How do you
do it?

1. Load R0 with the starting address of string1
2. TRAP x22
3. Load R0 with the ascii code for the "ugly thing"
4. TRAP x21
5. Load R0 with the starting address of string2
6. TRAP x22


Good luck finishing the lab4, and enjoying Thanksgiving.

Yale Patt