Dale - Computer Science Illuminated 232

Dale - Computer Science Illuminated 232 - three locations...

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

View Full Document Right Arrow Icon
7.4 A Program Example 205 tell the instruction to put the character? Well, since the next statement is going to write out that character, let’s just store the character directly into the third byte of the next instruction, which is the ‘Character output’ instruction, and mark the ‘Character output’ instruction to use immediate addressing. But we must know where the ‘Character input’ instruction is going to be placed before we can determine where the ‘Character output’ instruc- tion is going. In the original version of the program, we know that the Stop command was stored into location 0F. Our enhancements go before the Stop instruction, so the ‘Character input’ instruction goes into loca- tions 0F, 10, and 11. The ‘Character output’ instruction goes into the next
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: three locations: 12, 13, and 14. Therefore, the ‘Character input’ instruc-tion must have 14 in its third byte; that is, the input character must be stored into location 14. When the ‘Character output’ instruction is executed, the character stored in location 14 is written out. Here is a copy of the screen with the input program, followed by a copy of the output screen. Module Write "H" ... Get initial Write initial Stop Binary Instruction 00011 1 11 1111111110111010 Location Hex Instruction 11 10, 1 00100 1 10 1111 111111101011 1F 01, 00 00011 1 11 1111111111111111 0 0 , 0C 0O 11111 1 11 )1 11C> D9 110C )1 1111 11...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online