Question
1. For the following code segments: a) identify the addressing mode of each instruction b) manually assemble each instruction using the instruction table c) show
1. For the following code segments:
a) identify the addressing mode of each instruction
b) manually assemble each instruction using the instruction table
c) show the memory diagram of the assembled machine code
d) show the memory diagram of data memory after the code is executed
ORG $C000
LDAA #$27
STAA $1000
ORG $C400
LDX #$5678
STX $30
ORG $C120
LDAB #$12
LDAA #$97
INCB
STD $B000
ORG $C500
LDX #$DEAD
LDD #$BEEF
XGDX
STX $0040 STD $F100
ORG $0800
LDX #$2000
LDAB #24
STAB 0,X
ORG $0900
LDY #$E100 LDD #$74F2
STD 12,Y
2. Create the memory diagrams to show DATA memory contents and addresses after execution of
each code segment. a) |
|
|
| ORG | $0800 |
TEMP | RMB | 1 |
VAR1 | FCB | $14 |
VAR2 | FCB | $35 |
| ORG NOP | $0900 |
| LDX | #TEMP |
| LDAA | VAR1 |
| LDAB ABA | 2,X |
| STAA | 0,X |
b) | STD NOP | 3,X |
| ORG | $C000 |
NUMBAS | FCB | 2,4,7,5,3 |
SUM | RMB | 2 |
| LDY | #NUMBAS |
| LDX | #0 |
| LDAA | #5 |
LOOP | LDAB ABX INY DECA | 0,Y |
| BNE | LOOP |
c) | STX NOP | SUM |
| ORG | $0B00 |
SCALE | FCB | $F2 |
CONST | RMB | 1 |
ANSWER | RMB | 2 |
| ORG | $0800 |
| LDX | #SCALE |
| LDAA | #$25 |
| STAA | CONST |
| LDAB MUL | 0,X |
| STD NOP | ANSWER |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started