This preview shows page 1. Sign up to view the full content.
Unformatted text preview: have the fetch-execute cycle skip over these places to continue with the program. In fact, we can assign identifiers to the memory locations and use these names later in the program. We set up space for the sum using the *W "D pseudocode so that we can set the contents to 0. We set up space for the three numbers using the *L RK pseudocode. sum: *W "D d#1 ;s7t up w.rd with z7r. as th7 c.nt7nts num0: *L RK d# ;s7t up a tw. byt7 b8.ck f.r num0 num : *L RK d# ;s7t up a tw. byt7 b8.ck f.r num num : *L RK d# ;s7t up a tw. byt7 b8.ck f.r num We can refer to these identifiers, and the assembler substitutes the addresses. Now all of the steps are concrete. The first step in the algorithm is to set the sum to zero. This is already done by the *W "D pseudo-op. The next two steps are repeated three times: Read a number and Add number to Set sum to 0 Read num1 Add num1 to sum Read num2 Add num2 to sum Read num3 Add num3 to sum Write sum...
View Full Document
- Fall '10