Dale - Computer Science Illuminated 231

Dale - Computer Science Illuminated 231 - 204 Chapter 7...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
204 Chapter 7 Low-Level Programming Languages and then put the address of that byte into the output instruction. This sounds more complicated than it is. Look back at the map of memory after the program is loaded. There are 16 bytes used in the program. We must store the characters in 26788.2 in successive bytes beginning with the 17th byte (address 10 in hex). Then the first instruction has 10 (17 decimal) in the second byte of its operand spec- ifier. The second instruction has 11 (18 decimal) in the second byte of its operand specifier, and so forth. Now all we have to do is store the ASCII code for the characters. And that turns out to be easy. We just insert the hexadecimal for each character between the Stop instruction and the zz . Here is the screen shot of this revised program. The output is exactly the same as from the previous versions. An Enhanced Version of “Hello” Before we leave machine language, let’s add another feature to our program. Let’s use the ‘Character input to operand’ command to read in
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online