Presentation is loading. Please wait.

Presentation is loading. Please wait.

MICRO-CONTROLLER MOTOROLA HCS12 Addressing Modes Mechatronics Department Faculty of Engineering Ain Shams Univeristy.

Similar presentations


Presentation on theme: "MICRO-CONTROLLER MOTOROLA HCS12 Addressing Modes Mechatronics Department Faculty of Engineering Ain Shams Univeristy."— Presentation transcript:

1 MICRO-CONTROLLER MOTOROLA HCS12 Addressing Modes Mechatronics Department Faculty of Engineering Ain Shams Univeristy

2 HCS12 Addressing Modes HCS12 instruction set can be categorized according to the type of operand used for every instruction.  Immediate Addressing.  Direct/Extended Addressing.  Indexed Addressing.  Inherent Addressing.  Relative Addressing.

3 HCS12 Programmer’s model  Accumulator (Operand Register).  Index Registers X&Y (Keeps addresses for specific instructions using addresses as operands).  Stack Pointer (Keeps track of program stack in the Ram).  Program Counter (Keeps track of the program script). AB X Y SP PC

4 $ 5000 $ 5001Op-Code $ 5002Operand $ 5003 $ 5004 $ 5005 Instruction Set Example  ldaa#$64;  ldaa#$6464; Operand

5 Immediate Addressing  ldaa#$64; AB X Y SP PC #$64

6 Direct Addressing  ldaa$64; AB X Y SP PC $ 0063 …… $ 0064 $FF $ 0065 …… $64 $FF

7 Extended Addressing  ldd$1234; D X Y SP PC $ 1233 …… $ 1234 $FF $ 1235 $FF $1234 $FF

8 Indexed Addressing  ldaa!1,x; AB X $0064 Y SP PC $ 0064 …… $ 0065 $FF $ 0066 …… $0064 $FF +1 $0065

9 Indexed Pre-decrement Addressing  ldaa!1,-x; AB X $0065 Y SP PC $ 0064 $FF $ 0065 …… $ 0066 …… $0064 $FF $0065 $0064 $0064

10 Indexed Post-increment Addressing  ldaa!1,x+; AB X $0064 Y SP PC $ 0064 $FF $ 0065 …… $ 0066 …… $0064 $FF +1 $0065 $0065 $0064

11 Indexed Indirect Addressing  ldaa[!1,x]; AB X $0064 Y SP PC $ 0064 …… $ 0065 $00 $ 0066 $67 $ 0067 $FF $0064 $FF +1 $0065 $0067

12 Eng. Mohamed Mahmoud Hamdy Eng. Mostafa Ahmed Arafa Prepared by:


Download ppt "MICRO-CONTROLLER MOTOROLA HCS12 Addressing Modes Mechatronics Department Faculty of Engineering Ain Shams Univeristy."

Similar presentations


Ads by Google