lecture28 - stored in index register b There are two index...

Info icon This 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? box5 Each binary instruction is divided into three parts: box5 The operation code (opcode) box5 The address information (operand(s)) box5 The addressing mode information (mode) box5 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 box5 There are different addressing modes box5 Direct addressing : box5 Address directly locates operand value box5 E.g. operand 105 106 107 memory CMPT 150 Assembly Language Page 3 Memory References Indexed addressing : box5 Operand address is formed from base address plus value
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern