1 / 14

Physics 413 Chapter 2

Physics 413 Chapter 2. 6800 Architecture. A. B. X. SP. PC. CCR. Straight-line Programming. In Paris they simply stared when I spoke to them in French ; I never did succeed in making those idiots understand their own language Mark Twain , The Innocents Abroad , 1869.

keaira
Télécharger la présentation

Physics 413 Chapter 2

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. Physics 413Chapter 2

  2. 6800 Architecture A B X SP PC CCR

  3. Straight-line Programming In Paris they simply stared when I spoke to them in French ; I never did succeed in making those idiots understand their own language Mark Twain , The Innocents Abroad, 1869

  4. My First Program • CLRA Clears accumulator A ( A = 0 ) • INC A This instruction does this: A + 1 A • WAI Stop (Wait)

  5. Op-codes Assembly LanguageMemory LocationOp-codes CLRA 0000 4F INCA 0001 4C WAI 0002 3E

  6. My Second Program LDAA # $ 12 ADDA # $ 15 WAI

  7. Object Code . . . Program # 2 Assembly LanguageMemory LocationOp-codes LDAA # $ 12 0000 86 0001 12 ADDA # $ 15 0002 8B 0003 15 WAI 0004 3E

  8. Addressing Modes • Inherent (implied) : Simplest with no operand. One-byte op-code. Examples: INCA and CLRA • Immediate : Operand specified is immediate (no memory access). Examples: LDAA # $ 12 and ADDA # $ 15

  9. Immediate and Direct Modes • Immediate LDAA # $ 12 Load 12 • op-code 86 12 • Direct LDAA $ 12 Load from memory 0012 • op-code 96 12

  10. My Third Program Assembly LanguageMemory LocationOp-codes LDAA # $ 04 STAA $ 15 LDAA # $ 08 ? ? ADDA $ 15 WAI

  11. My Third Program Assembly LanguageMemory LocationOp-codes LDAA # $ 04 0000 86 04 STAA $ 15 0002 97 15 LDAA # $ 08 0004 86 08 ADDA $ 15 0006 9B 15 WAI 0008 3E

  12. Extended Addressing Mode • The extended addressing mode becomes indispensable when memory locations beyond the zero page must be addressed. Here, as always, an example is worth a thousand words: • LDAA $$ 3C5E Load A from memory 3C5E • Op-codes B6 3C 5E

  13. Three Trick Questions • What is the outcome of B6 00 2A ? • What is the outcome of LDAA # $ 3C5E ? • What is the outcome of STAB $$ 3C44 ?

  14. Trick Questions . . . Answered! • What is the outcome of B6 00 2A ? Legal but not very smart. • What is the outcome of LDAA # $ 3C5E ? Not Legal • What is the outcome of STAB $$ 3C44 ? O.K. and op-code is F7 3C 44

More Related