1 / 9

Addressing

Addressing. Sample Question. Three addressing modes. Immediate Not an address. Use this number as it is. Direct Treat this number as an address, use the value that is at that address. Indirect

Download Presentation

Addressing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Addressing

  2. Sample Question

  3. Three addressing modes • Immediate • Not an address. Use this number as it is. • Direct • Treat this number as an address, use the value that is at that address. • Indirect • Treat this number as an index. Go to that address, find the address in that location, then use the number pointed by that.

  4. Immediate addressing Accumulator LDA #99 99 MemoryOMatic

  5. Immediate addressing Accumulator LDA #99 99 MemoryOMatic

  6. Direct addressing LDA 99 Accumulator 145 MemoryOMatic

  7. Indirect addressing LDA (99) Accumulator 145 MemoryOMatic Indirect addressing may be used for code or data. It can make implementation of pointers or references or handlesmuch easier, and can also make it easier to call subroutines which are not otherwise addressable. Some early minicomputers (e.g. DEC PDP-8, Data General Nova) had only a few registers and only a limited addressing range (8 bits). Hence the use of memory indirect addressing was almost the only way of referring to any significant amount of memory.

  8. Indexed addressing X LDA 99 (X) Accumulator 10 333 MemoryOMatic

  9. Example use of Indexed Addressing LDA #0 ;load 0 to acc LDX #0 ;load 0 to x LOOP STA TABLE(X) ;store acc in table+x INX ;increment x CPX #99 ;compare x with 99 BNE LOOP ;branch if not equal What does this do?

More Related