Show all your work. If you do not show your work, you get no credit.
from page 109-110
Figure 2-26, with N,Z,V,C condition code bits.
Assembly | Address | Contents |
---|---|---|
N1 |
0010 |
02 |
. . .
Assembly | Address | Contents | N | Z | V | C |
---|---|---|---|---|---|---|
LDAA |
c200 |
B6 |
||||
EXT |
c201 |
c3 |
||||
|
c202 |
45 |
0 | 0 | 0 | - |
LDAB |
c203 |
d6 |
||||
DIR |
c204 |
10 |
0 | 0 | 0 | - |
ABA |
c205 |
1b |
0 | 0 | 0 | 0 |
STAA |
c206 |
b7 |
||||
EXT |
c207 |
c3 |
||||
|
c208 |
46 |
0 | 0 | 0 | - |
STOP |
c209 |
3f |
- | - | - | - |
. . .
Assembly | Address | Contents |
---|---|---|
N2 |
c345 |
29 |
SUM |
c346 |
ff |
C bit: For unsigned binary numbers has meaning because indicates that not enough bits were available to represent the unsigned value (need to extend bits); for 2C binary numbers has no meaning because may be the artifact of adding two negative signed numbers.
V bit: For unsigned binary number has no meaning because there is no sign bit so can not add two positives and get a negative or visa versa; for 2C binary numbers has meaning because there is a sign bit (MSB) and may add two positives and get a negative or visa versa.
from page 143-144
0001 | ** | Assembler | Exercise | ||||||||
0002 | ** | ||||||||||
0003 | 000c(a) | model | equ | 12 | |||||||
0004 | 0030 | org | $0030 | ||||||||
0005 | 0030 | temp(b) | rmb | 1 | |||||||
0006 | d300 | org | $d300(c) | ||||||||
0007 | d300 | 0c | type | fcb | model | ||||||
0008 | d301 | 01 | 03(d) | size | fdb | $0103 | |||||
0009 | d303 | ||||||||||
0010 | c000 | org | $c000 | ||||||||
0011 | c000 | ce | d3 | 01(e) | start | ldx | #size | ||||
0012 | c003 | f6 | d3 | 00(f) | ldab | type | |||||
0013 | c006 | 17(g) | tba | ||||||||
0014 | c007 | 97 | 30 | staa | temp(h) | ||||||
0015 | c009 | 27 | 05 | again | beq | next(i) | |||||
0016 | c00b | 5c | incb | ||||||||
0017 | c00c | 6a | 01(j) | dec | 1,x | ||||||
0018 | c00e | 20 | d3(k) | bra | again | ||||||
0019 | c010 | d7 | 30 | next | stab | temp | |||||
0020 | c012 | 3f | last | swi | |||||||
0021 | end | ||||||||||
Defined(Line Number) | Symbol Name | Value | Reference | ||||||||
*0015 | again(l) | c009(m) | 0018 | ||||||||
*0020 | last | c012(n) | |||||||||
*0003(o) | model | 000c | 0007 | ||||||||
*0019 | next | c010 | 0015 | ||||||||
*0008 | size | d301 | 0011(p) | ||||||||
*0011 | start | c000 | |||||||||
*0005 | temp | 0030 | 0014 | 0019 | |||||||
*0007 | type(q) | d300(r) | 0012 |
Address | Contents | Assembly | |||
---|---|---|---|---|---|
org | $0030 | ||||
0030 |
temp | rmb | 1 |
. . .
Address | Contents | Assembly | PC | A | B | RAM Address | RAM Value | ||||
---|---|---|---|---|---|---|---|---|---|---|---|
org | $f800 | f800 | ? | ? | |||||||
f800 | 86 |
start | LDAA | f801 | ? | ? | |||||
f801 |
24 |
#$24 | f802 | 24 | ? | ||||||
f802 |
c6 |
LDAB | f803 | 24 | ? | ||||||
f803 |
12 |
#$12 | f804 | 24 | 12 | ||||||
f804 |
d7 |
STAB | f805 | 24 | 12 | ||||||
f805 |
30 |
temp | f806 | 24 | 12 | $0030 | $12 | ||||
f806 |
16 |
TAB | f807 | 24 | 24 | ||||||
f807 |
96 |
LDAA | f808 | 24 | 24 | ||||||
f808 |
30 |
temp | f809 | 12 | 24 |
. . .
Address | Contents | Assembly | |||
---|---|---|---|---|---|
org | $fffe | ||||
fffe | f8 |
fdb | |||
ffff | 00 |
start |
Address | Contents | Assembly | |||
---|---|---|---|---|---|
org | $0012 | ||||
0012 |
workstor | rmb | 1 |
. . .
Address | Contents | Assembly | PC | A | B | CCR (N Z V C) | RAM Address | RAM Value | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
org | $f800 | f800 | ? | ? | ? | |||||||
f800 | 86 |
start | LDAA | f801 | ? | ? | ? | |||||
f801 | 0c |
#$0c | f802 | 0c | ? | 0 0 0 - | ||||||
f802 | f6 |
LDAB | f803 | 0c | ? | ? | ||||||
f803 | f9 |
f804 | 0c | ? | ? | |||||||
f804 | 00 |
tempval | f805 | 0c | 12 | 0 0 0 - | ||||||
f805 | 1b | ABA | f806 | 1e | 12 | 0 0 0 0 | ||||||
f806 | d7 |
STAB | f807 | 1e | 12 | ? | ||||||
f807 | 12 |
workstor | f808 | 1e | 12 | 0 0 0 - | $0012 | $12 |
. . .
Address | Contents | Assembly | |||
---|---|---|---|---|---|
org | $f900 | ||||
f900 | 12 | tempval | fcb | $12 |
. . .
Address | Contents | Assembly | |||
---|---|---|---|---|---|
org | $fffe | ||||
fffe | f8 |
fdb | |||
ffff | 00 |
start |
Last modified: Mon Oct 8 23:13:49 MST 2001