0% found this document useful (0 votes)
8 views

Notes - Solutions To Exercises

The document provides solutions to an exercise on addressing modes. It shows 16 instructions with their before and after states, addressing mode. It also shows solutions to an opcode instructions exercise with 3 examples of instructions.

Uploaded by

joshua hayles
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Notes - Solutions To Exercises

The document provides solutions to an exercise on addressing modes. It shows 16 instructions with their before and after states, addressing mode. It also shows solutions to an opcode instructions exercise with 3 examples of instructions.

Uploaded by

joshua hayles
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Solutions to Exercise on Addressing Modes

Addressing
Instruction Before After
Mode

1 LDAA #$3B A=0 B=0 A= 3B B=0 Immediate

A=0 B=0 A= 2C B= 0
2 LDAA $E9 Direct
$00E9 = 2C $00E9= 2C

A=0 B=0 A= 0 B= 5C
3 LDAB #92 Immediate
$0092 = 63 $0092 = 63

A=0 B=0 A=0 B=81


4 LDAB $52 Direct
$0052 = 81 $0052 = $0052

X=0 $5F04=6A X= 6A54 $5F04= 6A


5 LDX $5F04 Extended
$5F05=54 $5F05= 54

X=0 $0572=21 X= 21A2 $0572= 21


6 LDX $572 Immediate
$0573=A2 $0573= A2

7 ABA A=26 B=02 A= 28 B=02 Inherent

8 ADDA #62 A=27 B=7F A=65 B= 7F Immediate

A=18 B=32 A= 1E B=32


9 ADDA $52BD Extended
$52BD = 06 $52BD = 06

A=18 B=32 A=18 B=47


10 ADDB $3A16 Extended
$3A16 = 15 $3A16 = 15

11 SBA A=8E B=36 A=58 B=36 Inherent

A=60 B=51 A=60 B= 2D


12 SUBB $6A91 Extended
$6A91= 24 $6A91= 24

13 SUBA #$1A A=21 B=3C A=7 B=3C Immediate

A=93 B=15 A= 93 B=15


14 STAB $253F Extended
$253F= 7A $253F=15

A=93 B=15 A=93 B=15


15 STAA $62B4 Extended
$62B4= 7A $62B4=93

A=93 B=15 A= 94 B= 15
16 INCA Inherent
$3728= 7A $3728= 7A
Addressing
Instruction Before After
Mode

A=93 B=15 A= 93 B= 14
17 DECB Inherent
$3728= 7A $3728= 7A

X=257E $0645=21 X=257D $0645=21


18 DEX Inherent
Y=6BF2 $0646=A2 Y=6BF2 $0646=A2

X=4A95 $C275=21 X= 4A95 $C275= 21


19 INY Inherent
Y=1270 $C276=A2 Y= 1271 $C276= A2

X=041E $C275=28 X=041E $C275=29


20 INC $C275 Extended
Y=8C25 $C276=A2 Y=8C25 $C276=A2

Solutions to Opcode Instructions Exercise

1)
LDAA $3000 B6 30 00
ADDA #45 8B 2D
STAA $14 97 14

2)
LDAA $2E 96 2E
LDAB #76 C6 4C
SBA 10
STAA $3005 B7 30 05

3)
LDAB #62 C6 3E
ADDB $8E27 FB 8E 27
STAB $94 D7 94

You might also like