Dale - Computer Science Illuminated 230

Dale Computer - directly into the third byte of the ‘Character output from operand’ instruc-tion that would write out the character Now let’s

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

View Full Document Right Arrow Icon
7.4 A Program Example 203 The fetch-execute cycle begins with the instruction in location 0000, which is where the first instruction has been loaded. To start the fetch-execute cycle, we go back to the same pull-down menu (Pep7) and click on Execute . We could have done the loading and executing in one step by clicking on Load/Execute . The loader that puts the program into memory is very exacting. The instructions must be in hexadecimal with exactly one blank between each byte. If we mistype the program, say, by forgetting the blank before the zz , the loader gives the following message. An Alternate Program for the Same Algorithm In the last section we encoded the algorithm using immediate-mode addressing. The ASCII code for each character to be output was stored
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: directly into the third byte of the ‘Character output from operand’ instruc-tion that would write out the character. Now, let’s code the program using direct addressing. That is, the operand specifier for each ‘Character output from operand’ instruction should contain the address of the character to be output rather than the character itself. Therefore, we must change the instruction specifier from 00011 1 11 )1 h7x to 00011 1 10 )0 h7x We must also change the operand specifier from the ASCII character to the address describing where the ASCII character is stored in memory. How do we know what the address is? We must store the character in a byte...
View Full Document

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online