Lecture28 - 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

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPT 150 Assembly Language Page 1 What do instructions look like? b Each binary instruction is divided into three parts: b The operation code (opcode) b The address information (operand(s)) b The addressing mode information (mode) b The opcode specifies the action to be performed, the operand(s) specify which part of memory or registers to access or manipulate mode opcode operand(s) CMPT 150 Assembly Language Page 2 The Addressing Mode: Memory References b There are different addressing modes b Direct addressing : b Address directly locates operand value b E.g. operand 105 106 107 memory CMPT 150 Assembly Language Page 3 Memory References Indexed addressing : b Operand address is formed from base address plus value
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the 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.

Page1 / 2

Lecture28 - 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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online