This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: stored in index register b There are two index registers in the CPU: X and Y b E.g. operand 105 106 107 memory CMPT 150 Assembly Language Page 4 Indexing Example ; Program to sum a list of numbers using indexing ORG $0800 LIST DC.B $10 DC.B $15 DC.B $A DC.B $21 DC.B $1B LSIZE DC.W 4 SUM DS.B 1 ; reserve space for ; storing answer CMPT 150 Assembly Language Page 5 Indexing Example - cont’d… ORG $0A00 ENTRY LDX #0 CLRA LOOP ADDA LIST,X INX CMPT 150 Assembly Language Page 6 Indexing Example - cont’d… CPX LSIZE BLE LOOP STAA SUM STOP ORG $FFFE DC.W ENTRY...
View Full Document
This note was uploaded on 04/27/2011 for the course CMPT 150 taught by Professor Dr.anthonydixon during the Spring '08 term at Simon Fraser.
- Spring '08