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
y
t
e
s
0
x
F
5
2
4
5
0
x
2
7
A
8
1
0
1
5
2
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
6
2
4
6
0
x
2
7
B
0
1
0
1
6
0
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
7
2
4
7
0
x
2
7
B
8
1
0
1
6
8
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
8
2
4
8
0
x
2
7
C
0
1
0
1
7
6
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
9
2
4
9
0
x
2
7
C
8
1
0
1
8
4
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
A
2
5
0
0
x
2
7
D
0
1
0
1
9
2
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
B
2
5
1
0
x
2
7
D
8
1
0
2
0
0
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
C
2
5
2
0
x
2
7
E
0
1
0
2
0
8
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
D
2
5
3
0
x
2
7
E
8
1
0
2
1
6
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
E
2
5
4
0
x
2
7
F
0
1
0
2
2
4
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
0
x
F
F
2
5
5
0
x
2
7
F
8
1
0
2
3
2
4
c
o
l
o
i
p
a
l
e
t
t
e
,
8
b
y
t
e
s
BRAFT uameuuino Refeience Nanual
4S
!"#$%&'
Spiites aie giaphical objects with theii own bitmaps anu palettes that can be
positioneu anywheie ovei the unueilying chaiactei giaphics playfielu. They the
most complex pait of the uameuuino's viueo subsystem, using six uistinct aieas of
memoiy foi contiol, collision uetection, image uata, anu coloi palettes.
Spiites aie visually positioneu above the othei elements of the viueo uisplay, so that
opaque pixels of a spiite will obscuie chaiactei giaphics playfielu anu backgiounu
pixel infoimation unueineath. Spiite pixels may be tianspaient, allowing the
unueilying giaphical layeis to show thiough. Each spiite is numbeieu fiom u to 2SS
(uxuu to uxFF hexauecimal), anu aie ienueieu in oiuei, so that spiite u is visually
beneath spiite 1, anu so on to spiite 2SS, which is the highest-piioiity visual
element on the uisplay.
The uameuuino haiuwaie suppoits 2S6 spiites, with some limitations:
!"#$%&' "&# )$*&+ Theie is a limit of 96 spiites on a single hoiizontal line. If too
many spiites occupy the same line, the uameuuino haiuwaie iuns out of time to
compose the line, anu some spiites may not be uiawn.
!"#$%& ,$%-." /&-0#1+ RAN_SPRINu contains enough memoiy to stoie 64
spiite images at the full 8-bit (2S6-coloi) pixel uepth. Bowevei, two spiites can
shaie one bitmap in 4-bit (16-coloi) moue: one spiite uses the uppei nybble of
the byte, while the othei spiite uses the lowei nybble. Similaily, in 2-bit (4-
coloi) moue, a total of 4 spiites can shaie one bitmap.
!"#$%& ()*%#)+
Each spiite is contiolleu by a S2-bit spiite contiol woiu, uiagiammeu in Table 28:
Spiite Contiol Woiu. The haiuwaie suppoits a maximum of 2S6 spiites, so spiite
contiol uata occupies 1u24 bytes of memoiy. The uameuuino has two pages of
spiite contiol uata: one at uxSuuu to uxSSFF (1228 to 1SS11 uecimal) anu one at
uxS4uu to uxS7FF (1SS12 to 14SSS uecimal) to suppoit uouble buffeiing. The
active page is set by the SPR_PAuE iegistei at ux28uB (1u2S1 uecimal). If
SPR_PAuE is u, the lowei bank of spiite contiol uata is useu; the uppei bank is useu
when SPR_PAuE is 1. The inactive page can be mouifieu without affecting the scieen
uisplay.
2.34& 56+ !"#$%& 70*%#04 80#9
!"#$%& 70*%#04 ,1%& :;;'&% .*9 70*%#04 80#9 70*%&*%'
+0 +1 +2 +3
Spiite Contiol X7X6X5X4X3X2X1X0 P3P2P1P0 R2R1R0 X8 Y7Y6Y5Y4Y3Y2Y1Y0 C S5S4S3S2S1S0 Y8
Xu-X8: Spiite X position, u-S11 (uxuuu-ux1FF hexauecimal).
Pu-RS: Palette moue select, u-1S (uxu-uxF hexauecimal), see Table 29: Spiite Palette Noues.
Ru-R2: Spiite iotation, u-8; see Table Su: Spiite Rotation.
Yu-Y8: Spiite Y position, u-S11 (uxuuu-ux1FF hexauecimal).
C: Collision class foi }K moue, u=} 1=K.
Su-SS: Souice image bitmap, u-6S (uxuu-uxSF hexauecimal).
BRAFT uameuuino Refeience Nanual
44
2.34& 5<+ !"#$%& =.4&%%& /09&'
=.4&%%& /09& =>?=@ !&4&A%&9 /09& =$B&4
(bin) (dec) (hex) colors palette bits
0000 0 0x0 256 8 0 A 0-7
0001 1 0x1 256 8 1 B 0-7
0010 2 0x2 256 8 2 C 0-7
0011 3 0x3 256 8 3 D 0-7
0100 4 0x4 16 4 0 A 0-3
0101 5 0x5 16 4 1 B 0-3
0110 6 0x6 16 4 0 A 4-7
0111 7 0x7 16 4 1 B 4-7
1000 8 0x8 4 2 0 A 0-1
1001 9 0x9 4 2 1 B 0-1
1010 10 0xA 4 2 0 A 2-3
1011 11 0xB 4 2 1 B 2-3
1100 12 0xC 4 2 0 A 4-5
1101 13 0xD 4 2 1 B 4-5
1110 14 0xE 4 2 0 A 6-7
1111 15 0xF 4 2 1 B 6-7
Palette moue: The selecteu palette moue numbei in binaiy, uecimal, anu hexauecimal.
Colois: Numbei of colois anu bit uepth in selecteu palette moue.
Palette: The numbei anu lettei of the palette selecteu foi the spiite.
Pixel bits: The bit positions of the spiite image useu in the selecteu moue.
2.34& @>+ !"#$%& C0%.%$0*
C0%.%$0* C>?C5 !&4&A%&9 /09& D;;&A%
(bin) (dec) (hex) Yflip Xflip XYswap
000 0 0x0 0 0 0 None
001 1 0x1 0 0 1 Niiioieu left-to-iight then iotateu 27u
010 2 0x2 0 1 0 Niiioieu left to iight
011 3 0x3 0 1 1 27u clockwise iotation
100 4 0x4 1 0 0 Niiioieu left-to-iight then iotateu 18u
101 5 0x5 1 0 1 9u clockwise iotation
110 6 0x6 1 1 0 18u clockwise iotation
111 7 0x7 1 1 1 Niiioieu left-to-iight then iotateu 9u
Rotation: The selecteu iotation numbei in binaiy, uecimal, anu hexauecimal.
Y flip: Flip spiite image in Y uiiection (top-to-bottom), u=no, 1=yes.
X flip: Flip spiite image in X uiiection (left-to-iight), u=no, 1=yes.
XY swap: Swap spiite X anu Y axes, u=no, 1=yes.
Effect: Effect of selecteu iotation on the spiite image.
!"#$%& ()++$,$)* -&%&.%$)*
The uameuuino spiite engine uetects collisions while the on-scieen uisplay is being
scanneu out. If a given spiite coveieu up (obscuieu pixels fiom) anothei spiite, then
a collision is uetecteu. The iesults aie available in C0LLISI0N, a 2S6-byte aiea of
memoiy fiom ux29uu-ux29FF (1u496-1u7S1 uecimal). This aiea of memoiy is
valiu only uuiing veitical blanking (vBLANK=1) anu will ieau uxFF (uecimal 2SS) at
all othei times.
Each byte of C0LLISI0N iepiesents the collision status of the coiiesponuing spiite.
The byte is uxFF (2SS uecimal) if the spiite uiu not colliue with any othei spiite, oi
BRAFT uameuuino Refeience Nanual
4S
contains the spiite numbei, uxuu-uxFE (u to 2S4) of the spiite that was obscuieu.
Since spiite 2SS (uxFF hexauecimal) is the highest-piioiity spiite, it can nevei be
obscuieu by anothei spiite. 0nly one collision is iepoiteu pei spiite; if a spiite
colliues with multiple othei spiites, one of the collisions will be iepoiteu, anu the
otheis aie uiscaiueu.
If }K collision moue is enableu, by setting the }K_N0BE iegistei to 1, collisions will
only be uetecteu between spiites belonging to uiffeient collision classes. Foi
example, in }K moue, if two spiites belong to class } (C=u), they cannot colliue even
if one spiite obscuies pixels fiom the othei. 0nly spiites with class bits can colliue.
If }K moue is uisableu, all collisions will be iepoiteu iegaiuless of class
membeiship.
!"#$%& /012& -1%1
Spiite images aie stoieu in 16kbytes of RAN beginning at ux4uuu (16S84 uecimal).
This is enough stoiage foi 64 image bitmaps: each spiite image is a 1616 bitmap
wheie each pixel occupies a single byte. The iesulting bitmap is 2S6 bytes, anu is
uiagiammeu in Table S1: Spiite Image Bitmap.
2.34& @E+ !"#$%& F-.G& ,$%-."
C0H ,1%& :;;'&% .*9 ,$%-." 70*%&*%'
(h) (u) +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
+0x00 +0 P01 P02 P00 P03 P04 P05 P06 P07 P08 P09 P0A P0B P0C P0D P0E P0F
+0x10 +0 P11 P12 P11 P13 P14 P15 P16 P17 P18 P19 P1A P1B P1C P1D P1E P1F
+0x20 +0 P21 P22 P22 P23 P24 P25 P26 P27 P28 P29 P2A P2B P2C P2D P2E P2F
+0x30 +0 P31 P32 P33 P33 P34 P35 P36 P37 P38 P39 P3A P3B P3C P3D P3E P3F
+0x40 +0 P41 P42 P40 P43 P44 P45 P46 P47 P48 P49 P4A P4B P4C P4D P4E P4F
+0x50 +0 P51 P52 P50 P53 P54 P55 P56 P57 P58 P59 P5A P5B P5C P5D P5E P5F
+0x60 +0 P61 P62 P60 P63 P64 P65 P66 P67 P68 P69 P6A P6B P6C P6D P6E P6F
+0x70 +0 P71 P72 P70 P73 P74 P75 P76 P77 P78 P79 P7A P7B P7C P7D P7E P7F
+0x80 +0 P81 P82 P80 P83 P84 P85 P86 P87 P88 P89 P8A P8B P8C P8D P8E P8F
+0x90 +0 P91 P92 P90 P93 P94 P95 P96 P97 P98 P99 P9A P9B P9C P9D P9E P9F
+0xA0 +0 PA1 PA2 PA0 PA3 PA4 PA5 PA6 PA7 PA8 PA9 PAA PAB PAC PAD PAE PAF
+0xB0 +0 PB1 PB2 PB0 PB3 PB4 PB5 PB6 PB7 PB8 PB9 PBA PBB PBC PBD PBE PBF
+0xC0 +0 PC1 PC2 PC0 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PCA PCB PCC PCD PCE PCF
+0xD0 +0 PD1 PD2 PD0 PD3 PD4 PD5 PD6 PD7 PD8 PD9 PDA PDB PDC PDD PDE PDF
+0xE0 +0 PE1 PE2 PE0 PE3 PE4 PE5 PE6 PE7 PE8 PE9 PEA PEB PEC PED PEE PEF
+0xF0 +0 PF1 PF2 PF0 PF3 PF4 PF5 PF6 PF7 PF8 PF9 PFA PFB PFC PFD PFE PFF
PXY: Pixel uata foi position X,Y, wheie X anu Y aie uxu-uxF (u to 1S uecimal).
0p to 2S6 uiffeient spiite images aie suppoiteu, by allowing spiites to shaie a
bitmap. In 16-coloi (4 bit pei pixel) moue, each spiite bitmap can contain two
complete spiite images, one in the high nybble (bits 4-7) anu one in the low nybble
(bits u-S). In 4-coloi (2 bit pei pixel) moue, each spiite bitmap can contain foui
complete spiite images. Each image occupies 2 of the 8 bits. See Table 28: Spiite
Contiol Woiu anu Table 29: Spiite Palette Noues foi moie infoimation.
!"#$%& 31+&%%&,
Theie aie a total of eight spiite palettes available on the uameuuino: 4 2S6-coloi
palettes, plus 2 16-coloi anu 2 4-coloi palettes. All eight palettes aie fully
BRAFT uameuuino Refeience Nanual
46
inuepenuent, anu theie is no iestiiction, othei than available spiite image uata
memoiy, on mixing spiite moues oi palettes.
5IJ?7040# =.4&%%&'+ The foui 2S6-coloi palettes aie each S12 bytes long, anu aie
locateu at RAN_SPRPAL staiting at uxS8uu (14SS6 uecimal). The stiuctuie of
RAN_SPRPAL is uiagiammeu in Table S2: RAN_SPRPAL Nemoiy Nap, while each
palette consists of 2S6 coloi entiies as uesciibeu in Table S7: Palette Entiy Foimat.
2.34& @5+ CK/L!=C=K) /&-0#1 /."
Symbol Palette Auuiess Length Contents
alteinate (hex) (uec) (hex) (uec)
RAM_SPRPAL PALETTE256A 0 A 0x3800 14336 0x200 512 2S6-coloi palette A
PALETTE256B 1 B 0x3A00 14848 0x200 512 2S6-coloi palette B
PALETTE256C 2 C 0x3C00 15360 0x200 512 2S6-Coloi palette C
PALETTE256C 3 D 0x3F00 15872 0x200 512 2S6-Coloi palette B
EJ?7040# =.4&%%&'+ Theie aie two 16-coloi palettes, each S2 bytes long, locateu at
PALETTE16 staiting at ux284u (1uSu4 uecimal). The stiuctuie of PALETTE16 is
uiagiammeu in Table SS: PALETTE16 Nemoiy Nap, while each palette consists of
16 coloi entiies as uesciibeu in Table S7: Palette Entiy Foimat, anu uetaileu in
Table S4: 16-Coloi Spiite Palette.
2.34& @@+ =K)D22DEJ /&-0#1 /."
Symbol Palette Auuiess Length Contents
(hex) (uec) (hex) (uec)
PALETTE16A 0 A 0x2840 10304 0x20 32 16-Coloi spiite palette A
PALETTE16B 1 B 0x2860 10336 0x20 32 16-Coloi spiite palette B
2.34& @M+ EJ?7040# !"#$%& =.4&%%&
Coloi
Entiy
Entiy 0ffset Byte 0ffset
(hex) (uec) +u +1
u
+0x00 +0
G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
1
+0x02 +2
G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
2
+0x04 +4
G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
S
+0x06 +6
G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
4
+0x08 +8
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
S
+0x0A +10
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
6
+0x0C +12
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
7
+0x0E +14
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
8
+0x10 +16
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
9
+0x12 +18
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
1u
+0x14 +20
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
11
+0x16 +22
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
12
+0x18 +24
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
1S
+0x1A +26
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
14
+0x1C +28
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
1S
+0x1E +30
G2G1G0B4B3B2B1B0
A R4R3R2R1R0G4G3
BRAFT uameuuino Refeience Nanual
47
A: Alpha channel coloi infoimation, u=opaque, 1=tianspaient.
Ru-R4: Reu channel coloi infoimation, u-S2; ignoieu when A=1.
Bu-B4: uieen channel coloi infoimation, u-S2; ignoieu when A=1.
Bu-B4: Blue channel coloi infoimation, u-S2; ignoieu when A=1.
M?7040# =.4&%%&'+ Theie aie two 4-coloi palettes, each 8 bytes long, locateu at
PALETTE4 staiting at ux288u (1uS68 uecimal). The stiuctuie of PALETTE4 is
uiagiammeu in Table SS: PALETTE4 Nemoiy Nap, while each palette consists of 16
coloi entiies as uesciibeu in Table S7: Palette Entiy Foimat, anu uetaileu in Table
S6: 4-Coloi Spiite Palette.
2.34& @I+ =K)D22DM /&-0#1 /."
Symbol Palette Auuiess Length Contents
(hex) (uec) (hex) (uec)
PALETTE4A 0 A 0x2880 10368 0x8 8 4-Coloi spiite palette A
PALETTE4B 1 B 0x2888 10376 0x8 8 4-Coloi spiite palette B
2.34& @J+ M?7040# !"#$%& =.4&%%&
Coloi
Entiy
Entiy
0ffset
Byte 0ffset
+u +1
u +u G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
1 +2 G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
2 +4 G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
S +6 G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
A: Alpha channel coloi infoimation, u=opaque, 1=tianspaient.
Ru-R4: Reu channel coloi infoimation, u-S2; ignoieu when A=1.
Bu-B4: uieen channel coloi infoimation, u-S2; ignoieu when A=1.
Bu-B4: Blue channel coloi infoimation, u-S2; ignoieu when A=1.
)*+*#
The uameuuino uses a numbei of uiffeient foimats to iepiesent coloi values: 8-bit
logical coloi space values useu by the uB Libiaiy, S-bit coloi values useu by the
haiuwaie, anu S-bit coloi values combineu with uitheiing to geneiate viueo output
to the uisplay. Table S8: Coloi Space shows the ielationship between these thiee
coloi spaces.
4)2$.1+ ()+)#
The uB Libiaiy implements a 24-bit RuB888 logical coloi space. It pioviues 8 bits
pei channel via an RuB() macio that accepts one byte of coloi uata foi each channel.
The macio uiscaius the least significant S bits of each coloi channel, anu ietuins a
1S-bit haiuwaie iepiesentation of the coloi, with the alpha channel set to u
(opaque).
51#671#& ()+)#
Inteinally, the uameuuino uses an ARuB1SSS coloi foimat in its palettes anu coloi
iegisteis. Coloi values aie stoieu in a single 16-bit woiu, with one bit of alpha
(tianspaiency) infoimation, anu S bits each of ieu, gieen, anu blue channel
BRAFT uameuuino Refeience Nanual
48
infoimation. The lowei (least significant) byte of the woiu contains the blue
channel uata anu the least significant bits of the gieen channel, while the uppei byte
contains the most significant bits of the gieen channel, all of the ieu channel, anu the
alpha channel. A stanuaiu coloi value is uiagiammeu below:
2.34& @N+ =.4&%%& D*%#1 O0#-.%
Auuiess +u +1
ARuB1SSS Coloi Bata Template G2G1G0B4B3B2B1B0 A R4R3R2R1R0G4G3
ARuB1SSS Bisplay Colois G2G1G0B4B3B2B1B0 0 R4R3R2R1R0G4G3
ARuB1SSS Tianspaient X X X X X X X X 1 X X X X X X X
A: Alpha channel coloi infoimation, u=opaque, 1=tianspaient.
Ru-R4: Reu channel coloi infoimation, u-S2; ignoieu when A=1.
Bu-B4: uieen channel coloi infoimation, u-S2; ignoieu when A=1.
Bu-B4: Blue channel coloi infoimation, u-S2; ignoieu when A=1.
As shown above, the uameuuino implements an alpha (tianspaiency) coloi channel
in haiuwaie. Tianspaient values aie a special case of the stanuaiu coloi value:
when the most significant bit is set, the low 1S bits containing the ieu, gieen, anu
blue channels in the coloi value aie ignoieu. The iesult is values of ux8uuu-uxFFFF
(uecimal S2768 thiough 6SSSS), aie tianspaient.
By convention, ux8uuu is the stanuaiu tianspaient coloi value. Bowevei, stoiing
ux8u (uecimal 128) in the high byte of a coloi woiu is sufficient to make a coloi
entiy tianspaient, iegaiuless of the contents of the low byte.
The Bu_C0L0R iegistei ignoies alpha channel infoimation, because the backgiounu
coloi is the bottom-most coloi plane. Theie is no lowei-piioiity viueo infoimation
to show thiough a tianspaient backgiounu coloi, so all coloi values aie tieateu as
opaque. Similaily, pixel uata ieau back thiough the SCREENSB0T memoiy aiea aie
always opaque, since they iepiesent the final coloi values output to the uisplay.
89%"9% ()+)#
The uameuuino uisplay output has only S bits of iesolution pei channel. 0nly the
colois wheie the thiee least significant bits aie all zeio aie output uiiectly. The
othei colois, wheie the least significant bits aie nonzeio, aie appioximateu using a
22 uitheiing algoiithm in the viueo output haiuwaie.
2.34& @6+ 7040# !".A&
8-bit Logical Coloi S-bit Baiuwaie Coloi S-bit 0utput Coloi
(hex) (uec) (bin) (hex) (uec) (bin) (hex) (uec) (bin)
0x00 0 00000000 0x00 0 00000 0x00 0 000
0x08 8 00001000 0x01 1 00001 0x00 0 000
0x10 16 00010000 0x02 2 00010 0x00 0 000
0x18 24 00011000 0x03 3 00011 0x00 0 000
0x20 32 00100000 0x04 4 00100 0x01 1 001
0x28 40 00101000 0x05 5 00101 0x01 1 001
0x30 48 00110000 0x06 6 00110 0x01 1 001
0x38 56 00111000 0x07 7 00111 0x01 1 001
0x40 64 01000000 0x08 8 01000 0x02 2 010
BRAFT uameuuino Refeience Nanual
49
8-bit Logical Coloi S-bit Baiuwaie Coloi S-bit 0utput Coloi
(hex) (uec) (bin) (hex) (uec) (bin) (hex) (uec) (bin)
0x48 72 01001000 0x09 9 01001 0x02 2 010
0x50 80 01010000 0x0A 10 01010 0x02 2 010
0x58 88 01011000 0x0B 11 01011 0x02 2 010
0x60 96 01100000 0x0C 12 01100 0x03 3 011
0x68 104 01101000 0x0D 13 01101 0x03 3 011
0x70 112 01110000 0x0E 14 01110 0x03 3 011
0x78 120 01111000 0x0F 15 01111 0x03 3 011
0x80 128 10000000 0x10 16 10000 0x04 4 100
0x88 136 10001000 0x11 17 10001 0x04 4 100
0x90 144 10010000 0x12 18 10010 0x04 4 100
0x98 152 10011000 0x13 19 10011 0x04 4 100
0xA0 160 10100000 0x14 20 10100 0x05 5 101
0xA8 168 10101000 0x15 21 10101 0x05 5 101
0xB0 176 10110000 0x16 22 10110 0x05 5 101
0xB8 184 10111000 0x17 23 10111 0x05 5 101
0xC0 192 11000000 0x18 24 11000 0x06 6 110
0xC8 200 11001000 0x19 25 11001 0x06 6 110
0xD0 208 11010000 0x1A 26 11010 0x06 6 110
0xD8 216 11011000 0x1B 27 11011 0x06 6 110
0xE0 224 11100000 0x1C 28 11100 0x07 7 111
0xE8 232 11101000 0x1D 29 11101 0x07 7 111
0xF0 240 11110000 0x1E 30 11110 0x07 7 111
0xF8 248 11111000 0x1F 31 11111 0x07 7 111
Lines shaueu in giey aie uitheieu on output.
!"#$%
The uameuuino implements two inuepenuent auuio systems: an auuitive synthesis
baseu on the summation of sepaiate wavefoims, anu a sample playback mechanism.
!*,-. !/-%0&'$' 1&2$'%&#'
The uameuuino auuitive sounu synthesis system is baseu on 64 sounu contiol
woius anu is supplementeu by a iing mouulation system.
:)$.& ()*%#)+
Sounu contiol uata is locateu at v0ICES, ux2Auu (1u7S2 uecimal). Each sounu
contiol woiu consists of S2 bits that specify one component of the final sounu to be
output.
2.34& @<+ P:F7D! /&-0#1 /."
P K99#&'' ,1%& :;;'&% .*9 70*%#04 80#9 70*%&*%'
(hex) (dec) +0 +1 +2 +3
!
0x2A00 10752 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
#
0x2A04 10756 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
$ 0x2A08 10760 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
% 0x2A0C 10764 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
& 0x2A10 10768 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
' 0x2A14 10772 F7F6F5F4F3F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 R7R6R5R4R3R2R1R0
''
0x2ADC 10972 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
'( 0x2AE0 10976 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
') 0x2AE4 10980 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
'* 0x2AE8 10984 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
'+ 0x2AEC 10988 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
(!
0x2AF0 10992 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
(#
0x2AF4 10996 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
($
0x2AF8 11000 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
(%
0x2AFC 11004 F7F6F5F4F3F2F1F0 W FEFDFCFBFAF9F8 L7L6L5L4L3L2L1L0 R7R6R5R4R3R2R1R0
v: voice numbei, u-64 (uxuu-ux4u hexauecimal).
Fu-FE: Fiequency, in units of Bz (so 4=1Bz oi 176u=44uBz).
W: Wavefoim, u=sine, 1=noise.
Lu-L7: Left volume, u-2SS (uxuu-uxFF hexauecimal).
Ru-R7: Right volume, u-2SS (uxuu-uxFF hexauecimal).
;$*2 <)69+1%)#
In auuition to simple auuitive synthesis, the uameuuino's auuio output system
implements a iing mouulatoi. Wiiting values to the RINu_N0B iegistei at ux2814
(1u26u uecimal) contiol the iing mouulatoi. Wiiting 64 (ux4u) to the RINu_N0B
iegistei uisables the featuie. Wiiting any lowei value enables the iing mouulatoi.
The value stoieu in RINu_N0B ueteimines which voice contiol iegistei is useu as
the iing mouulatoi contiol. All lowei-numbeieu voices aie mouulateu, while
highei-numbeieu voices aie unaffecteu. Foi example, wiiting S2 (ux2u
hexauecimal) to RINu_N0B enables the iing mouulatoi. voice contiol woiu S2
contiols the mouulatoi, anu voices u-S1 aie mouulateu, while voices SS-64 aie not.
!1-304 K99#&'' ) C&G$'%&# 70*%&*%' .*9 OQ*A%$0* R&;.Q4%
(hex) (uec)
RING_MOD RW 0x2814 10260 1 Nouulatoi voice, affects all lowei voices 0x40
!34"+& 1&2$'%&#'
The uameuuino has the ability to play back steieo auuio wave uata using the
SANPLE_L anu SANPLE_R iegisteis. Each iegistei accepts a signeu 16-bit integei
ieflecting the sample. The uameuuino upuates auuio samples eveiy 64 cycles of it's
SuNBz clock, coiiesponuing to an upuate fiequency of 781.2SkBz, so values loaueu
into these iegisteis aie ieflecteu on the auuio output channels within 1.28s.
BRAFT uameuuino Refeience Nanual
S2
2.34& M>+ !K/=)DL) .*9 !K/=)DLC C&G$'%&#'
Symbol Auuiess Length Byte 0ffset anu Registei Contents Befault
(hex) (uec) (hex) (uec) +0 +1
SAMPLE_L RW 0x2810 10256 0x2 2 L7L6L5L4L3L2L1L0 L15L14L13L12L11L10L9L8 0x0000
SCROLL_R RW 0x2812 10258 0x2 2 R7R6R5R4R3R2R1R0 R15R14R13R12R11R10R9R8 0x0000
Lu-L1S: Left auuio channel sample value, 16-bit signeu integei (L1S is the sign bit).
Ru-R1S: Right auuio channel sample value, 16-bit signeu integei (R1S is the sign bit).
BRAFT uameuuino Refeience Nanual
SS
!! !"#$"%&''"$
The uameuuino incluues a }1 Foith-baseu CP0 as a copiocessoi. The }1 is a
minimalist but fully functional piocessoi that has full access to the uameuuino's
auuiess space, anu a few auuitional iegisteis that aie not accessible to the Aiuuino.
The }1 CP0 also executes much fastei than the Aiuuino, anu can move consiueiably
moie uata than can fit thiough the SPI inteiface.
)*"#*5&''*# 6-%˟&
The uameuuino copiocessoi inteiface consists of a contiol iegistei, a miciocoue
block, anu a communications block that aie shaieu between the Aiuuino anu the
copiocessoi.
()"#).&,,)# ()*%#)+
The }1_RESET iegistei allows the Aiuuino (oi othei host miciocontiollei) to stop
anu stait the }1 copiocessoi. Wiiting uxu1 to this iegistei halts anu iesets the
copiocessoi, while uxuu ieleases the copiocessoi. Following a ieset, the }1 begins
executing coue staiting at }1_C0BE, ux2Buu (11uu8 uecimal). The iemaining seven
bits of the iegistei aie unuseu anu shoulu be set to u foi compatibility.
2.34& ME+ SELCD!D2 C&G$'%&#
Symbol Auuiess Length Contents Befault
(hex) (uec) (hex) (uec)
J1_RESET RW 0x2809 10249 0x1 1 X X X X X X X R0 0x0000
Ru: Copiocessoi contiol: 1=iun, u=halt anu ieset.
()"#).&,,)# <$.#).)6&
}1_C0BE, a 2S6-byte block of uameuuino RAN fiom ux2Buu-ux2BFF (uecimal
11uu8 thiough 1126S) is set asiue foi }1 instiuctions. This is the only aiea of
memoiy that the }1 can use to fetch instiuctions. }1 instiuctions aie 16-bit woius,
so }1_C0BE can contain only 128 instiuctions. Bowevei the copiocessoi can ieau
anu wiite uata fiom any location in the uameuuino auuiess space, so clevei
piogiams can copy oveilays fiom othei aieas of the }1 auuiess space into }1_C0BE.
0nuseu spiite bitmap memoiy in the 16 kbyte RAN_SPRINu block is a goou place to
locate }1 oveilays.
2.34& M5+ SEL7:RD /&-0#1 /."
Symbol Auuiess Length Contents Befault
(hex) (uec) (hex) (uec)
J1_CODE RW 0x2B00 11008 0x0100 256 128 2-byte }1 instiuctions 128 ! 0x0000
()"#).&,,)# ()009*$.1%$)*, =+).>
An otheiwise-unuseu 48-byte block of RAN is set asiue foi use as a intei-piocessoi
communications aiea so that Aiuuino anu }1 coue can exchange uata. The block is
labeleu C0NN anu iuns fiom ux289u to ux28BF (1uS84 to 1u4S1 uecimal). Theie
BRAFT uameuuino Refeience Nanual
S4
is no stanuaiu stiuctuie to C0NN - it is fiee to be uefineu by usei piogiams, anu
may incluue uata that is shaieu between the Aiuuino sketch anu the }1 coue, oi
piivate uata stiuctuies manipulateu by the }1. Bowevei, 48 bytes is not a lot of
space foi uata stiuctuies. 0nuseu spiite bitmap memoiy in the 16-kbyte
RAN_SPRINu block is a goou place to locate laige uata stiuctuies that uon't fit into
C0NN.
2.34& M@+ 7:// /&-0#1 /."
Symbol Auuiess Length Contents Befault
(hex) (uec) (hex) (uec)
COMM RW 0x2890 10384 0x30 48 48 bytes shaieu memoiy 0x00
()"#).&,,)#?8*+@ ;&2$,%&#,
A few uameuuino iegisteis aie only available to }1 piogiams - they cannot be ieau
oi wiitten by the host miciocontiollei via the SPI inteiface. Because they aie so
tightly tieu to the }1 copiocessoi, these iegisteis can also be ieau anu wiitten via a
16-bit uata path, so that loau anu stoie instiuctions wiite entiie woius (iathei than
wiiting just one byte, as is the case with loaus oi stoies to oiuinaiy uameuuino
iegisteis).
7Q##&*% C.'%&# )$*&+ This is a ieau-only countei that inciements as the scieen
uisplay is geneiateu. The iegistei is inciementeu immeuiately aftei the last pixel of
the line is compositeu, so changes in YLINE can be useu to uetect when it is safe to
mouify on-scieen objects anu contiol iegisteis without causing visual glitches. }1
coue has at least 4S cycles long, anu up to 1677 cycles, befoie composition of the
next iastei line begins. The time taken uepenus on the numbei of spiites that must
be compositeu onto the line: the minimum time of 4S cycles coiiesponus to the
maximum of 96 spiites pei line. Rastei line u is the top-most visible line of the
uisplay, anu line 299 is the bottom-most visible line. Waiting foi YLINE>299 will
uetect the stait of veitical blanking. Bowevei, YLINE is unuefineu uuiing veitical
blanking, anu may take on unpieuictable values, so YLINE uata can be useu to
estimate the amount of time left in the veitical blanking inteival.
2.34& MM+ T)FUD C&G$'%&#
Symbol Auuiess Length Registei Contents
(hex) (uec) (hex) (uec)
YLINE R 0x8000 32768 0x2 2 X X X X X X X Y8Y7Y6Y5Y4Y3Y2Y1Y0
Yu-Y8: Cuiient iastei line, uxuuuu to ux14C (u to SS2).
O=VK F7K= =0#%+ A set of 6 iegisteis that allow }1 piogiams to uiiectly access the
inteinal configuiation access poit (ICAP) of the Xilinx fielu-piogiammable gate
aiiay (FPuA) useu to implement the uameuuino. The ICAP poit is not noimally useu
foi game piogiamming, anu use of these iegisteis coulu altei the uameuuino's
opeiation. Consult the Xilinx 0sei uuiue foi uetails on how to use this poit. The
manual can be founu on the Xilinx site at:
http:www.xilinx.comsuppoituocumentationusei_guiuesugSS2.puf
BRAFT uameuuino Refeience Nanual
SS
2.34& MI+ O=VK F7K= C&G$'%&#'
Symbol Auuiess Length Registei Contents
(hex) (uec) (hex) (uec)
ICAP_O R 0x8002 32770 0x2 2 X X X X X X X X O7O6O5O4O3O2O1O0
ICAP W 0x8006 32774 0x2 2 X X X X X W0 E0 C0 I7I6I5I4I3I2I1I0
0u-07: ICAP output byte, uxuu-uxFF (u to 2SS uecimal).
Iu-I7: ICAP input byte, uxuu-uxFF (u to 2SS uecimal).
Wu: ICAP wiite enable, u=wiite anu 1=ieau.
Eu: ICAP select (chip enable): u=enable anu 1=uisable.
Cu: ICAP inteiface clock.
=#0G#.--.34& O#&WQ&*A1 V&*&#.%0#+ A piogiammable fiequency geneiatoi is
available to the }1 copiocessoi using the FREQBZ anu FREQTICK iegisteis. The
FREQBZ iegistei sets the uesiieu fiequency, fiom 1Bz (uxuuu1) to 6S,SSSBz
(uxFFFF); 8uuuBz (ux1F4u) is the uefault. The FREQTICK iegistei inciements by
one at the specifieu fiequency, allowing the }1 to count at a piecise iate. Theie is no
way to set oi ieset FREQTICK, it meiely counts up at the specifieu iate. When
FREQTICK ieaches uxFF, it iolls ovei to uxuu the next time it inciements. Setting
FREQBZ to uxuuuu piogiams uBz anu stops inciementing FREQTICK.
2.34& MJ+ OCDXYZ .*9 OCDX2F7[ C&G$'%&#'
Symbol Auuiess Length Registei Contents Befault
(hex) (uec) (hex) (uec)
FREQHZ W 0x800A 32778 0x2 2 Fiequency setting, 1Bz to 6SSSSBz ux1F4u
FREQTICK R 0x800C 32780 0x1 1 Countei inciements at CL0CKBZ uxuu
=$* 5 70*%#04+ Two copiocessoi-only iegisteis, in combination with the shaiu
I0N0BE iegistei, contiol pin 2 of the uameuuino's Aiuuino haiuwaie inteiface. The
shaieu I0N0BE iegistei is useu to assign pin 2 to one of two functions, oi to uisable
it entiiely. When I0N0BE is set to ux4A (uecimal 74 oi ASCII "}"), the pin is
contiolleu by the copiocessoi-only P2_v anu P2_BIR iegisteis.
2.34& MN+ =5 F\: C&G$'%&#'
Symbol Auuiess Length Registei Contents
(hex) (uec) (hex) (uec)
P2_V RW 0x800E 32782 0x2 2 X X X X X X X X X X X X X X X V0
P2_DIR R 0x8010 32784 0x2 2 X X X X X X X X X X X X X X X D0
vu: Aiuuino inteiface pin 2 value, u=low anu 1=high.
Bu: Pin 2 uiiection, u=output, 1=input.
When useu as an output, }1 coue iunning on the uameuuino can signal the host
miciocontiollei on pin 2 of the inteiface. This is a uigital pin on Aiuuino boaius,
anu it can be useu as an inteiiupt. }1 coue on the uameuuino can use this inteiiupt
to tiiggei Aiuuino coue that must iun synchionously with the uamuuino state. Foi
example, the }1 can tiiggei an inteiiupt when veitical blanking is uetecteu, anu the
Aiuiuno's inteiiupt seivice ioutine can upuate on-scieen objects without causing
visual glitches in the viueo output.
BRAFT uameuuino Refeience Nanual
S6
When useu as an input, pin 2 can eithei be connecteu uiiectly to a uigital signal that
the }1 coue monitois, oi it can be useu as an alteinate signaling path between the
host miciocontiollei anu the uameuuino. The }1 piocessoi uoesn't suppoit
inteiiupts, so coue that monitois pin 2 will neeu to poll the state of the pin to uetect
signals.
C.*90- UQ-3&#+ The }1 can access a high-quality ianuom numbei geneiatoi via
the RANB0N iegistei. The value in this ieau-only iegistei is baseu on the
uameuuino's built-in white noise geneiatoi. The haiuwaie continuously upuates
this value so that eveiy time it is ieau, the iegistei piouuces a new ianuom value.
2.34& M6+ CKUR:/ C&G$'%&#
Symbol Auuiess Length Registei Contents
(hex) (uec) (hex) (uec)
RANDOM R 0x8012 32786 0x2 2 16-bit ianuom numbei
740A]+ A clock cycle countei is available in the CL0CK iegistei. This iegistei counts
the numbei of SuNBz }1 clock cycles since the uameuuino was ieset. When the
count ieaches uxFFFF (6SSSS uecimal) it wiaps aiounu to uxuuuu.
2.34& M<+ 7):7[ C&G$'%&#
Symbol Auuiess Length Registei Contents
(hex) (uec) (hex) (uec)
CLOCK R 0x8014 32788 0x2 2 Clock cycle count, uxuuuu to uxFFFF
!=F O4.'^ /&-0#1+ When the shaieu I0N0BE iegistei is set to ux46 (uecimal 7u oi
ASCII "F"), the }1 CP0 can use the FLASB iegisteis to access the uameuuino's
onboaiu flash memoiy. By uiiectly manipulating a foui-line bus, the }1 can initiate
SPI tiansactions to ieau oi wiite memoiy locations unuei piogiam contiol.
This memoiy stoies configuiation uata that is loaueu into the Xilinx FPuA at boot-up
time; changing uata stoieu in this memoiy coulu peimanently altei the functioning
of the uameuuino.
2.34& I>+ O)K!Y !=F C&G$'%&#'
Symbol Auuiess Length Registei Contents
(hex) (uec) (hex) (uec)
FLASH_MISO R 0x8016 32790 0x2 2 X X X X X X X X X X X X X X X O0
FLASH_MOSI W 0x8018 32792 0x2 2 X X X X X X X X X X X X X X X I0
FLASH_SCK W 0x801A 32794 0x2 2 X X X X X X X X X X X X X X X C0
FLASH_SSEL W 0x801C 32796 0x2 2 X X X X X X X X X X X X X X X S0
0u: SPI NIS0 (mastei-inslave-out) line input, u=low anu 1=high.
Iu: SPI N0SI (mastei-outslave-in) signal to output, u=low anu 1=high.
Cu: SPI SCK (seiial clock) signal to output, u=low anu 1=high.
Su: SPI SSEL (slave select, also SS oi SEL) signal to output, u=low anu 1=high.
89 :#50$%&5%,#& 3-. ;#*2#344$-2
The }1 is a stack-baseu miciopiocessoi optimizeu to execute Foith coue; in fact its
instiuction set incluues 21 instiuctions that uiiectly implement ANS Foith woius.
BRAFT uameuuino Refeience Nanual
S7
The logical aichitectuie of the piocessoi is shown in D##0#_ C&;&#&*A& '0Q#A& *0%
;0Q*9`. It is uesigneu to execute Foith-like stack-baseu languages, anu the most
piominent featuies of the }1 aie its two stacks: a uata stack that is useu by AL0
opeiations, anu a ietuin stack that is piimaiily useu to holu subioutine ietuin
auuiesses. Each stack can holu up to S2 entiies, each entiy containing a 16-bit
woiu. A few stack entiies have specific names, that aie useu to uesciibe }1
opeiations: the top of the uata stack is T (top of stack), while the next item on the
uata stack is N (next on stack); the top of the ietuin stack is R (ietuin auuiess).
The basic stack opeiations aie push anu pop.
=Q'^+ Pushing a value onto a stack saves it foi latei use. When woius aie
pusheu onto a stack, the new uata becomes the top of the stack, anu each
element of the stack moves uown. Foi example, when pushing a value onto the
uata stack, the value pusheu becomes the new T, while the pievious value of T
becomes the new N, anu so on.
=0"+ Popping an element fiom the stack is the exact ieveise of a push. Popping
a value iemoves it fiom the stack, anu the iest of the elements move up. values
useu in a computation aie typically poppeu piioi to computing the iesult.
The }1 stacks aie finite, anu can only stoie S2 elements, but the }1 uoes not check foi
oveiflow oi unueiflow. If a stack alieauy contains S2 elements, pushing a new
element on the stack will not cause an exception; insteau, the bottom-most element
is uiscaiueu to make ioom. Popping a value fiom an empty stack will not cause an
exception; the value of unuseu stack elements is unuefineu anu may be ianuom.
Similaily, peifoiming two-opeianu instiuctions on a uata stack containing only one
value will not iesult in an eiioi, but the iesults of the computation aie unuefineu,
anu will likely vaiy uepenuing on the pievious contents of the stack.
The }1 incluues an AL0 that can peifoim 16 logical opeiations, incluuing auuition,
multiplication, compaiison anu bitwise logic opeiations. Inputs to the AL0 aie the
values stoieu in T anu N (foi binaiy opeiatois), anu may be poppeu fiom the stack
aftei use. Results aie pusheu back on the uata stack. Instiuctions aie also available
to loau anu stoie the uata stack fiom memoiy, anu tiansfei values between the uata
stack anu the ietuin stack. All opeiations aie peifoimeu on 16-bit woius, foi a
computational iange of u to 6SSSS (uxuuuu to uxFFFF). Signeu compaiison
opeiatois aie available, allowing signeu 16-bit integeis in the iange -S2767 to
S2767 to be iepiesenteu. Boolean FALSE is iepiesenteu as uxuuuu, anu while any
non-zeio value is TR0E, uxuuu1 is useu by convention.
Although the }1 aichitectuie logically suppoits a 16-bit piogiam countei (PC), the
uameuuino implementation is limiteu to fetching instiuctions fiom the 2S6 bytes of
RAN at }1_C0BE. }1 instiuctions aie always 2-byte woius, so in effect the least-
significant bit anu the most significant byte of the }1 PC aie haiu coueu to u anu
ux2B (uecimal 4S) iespectively. The }1 implements a conuitional bianch on T=u, an
unconuitional bianch, as well as an unconuitional subioutine call. Subioutine call
instiuctions push the piogiam countei onto the ietuin stack. 0ne unique featuie of
BRAFT uameuuino Refeience Nanual
S8
the }1 is that subioutine ietuins typically uo not iequiie an instiuction, because any
AL0 instiuction can be coueu to also peifoim a subioutine ietuin. Togethei with
some of the }1's othei featuies, this enables suipiisingly compact coue to be cieateu.
Because the uameuuino's auuiess space is byte-oiienteu, loau anu stoie opeiations
only tiansfei one byte of uata, uespite the fact that the }1 is a 16-bit CP0. values
loaueu fiom the uameuuino memoiy occupy the low 8 bits of a }1 woiu while the
uppei bits aie set to zeio. Wiites fiom the }1 to uameuuino auuiess space ignoie
the high byte, anu stoie only the low byte. The only exception to this is when
accessing the copiocessoi-only iegisteis,
which aie 16 bits wiue; loau anu stoie
opeiations to these iegisteis tiansfei an
entiie woiu.
A)#%B?=1,&6 C,,&0D+@ 41*2912&
The stanuaiu way of piogiamming the }1 is to
use its Foith-baseu assembly language. An
assemblei is pioviueu as pait of the
start-microcode example
/ subroutine definitions go here
: main
/ main program code goes here
begin again
;
end-microcode
!]&%A^ I+ SE K''&-341 =#0G#.- 2&-"4.%&
X X X X X X X X X X X X X X X X T
X X X X X X X X X X X X X X X X N
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X R
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X X
Data Stack Return Stack
X X X X X X X X
X X X X X X X X
Gameduino Memory
0x0002
0x0003
X X X X X X X X 0x27FE
X X X X X X X X 0x27FF
... ...
X X X X X X X X 0x2AFE
X X X X X X X X 0x7FFE
... ...
X X X X X X X X 0x2BFF
... ...
X X X X X X X X X X X X X X X X 0x8000
... ...
X X X X X X X X X X X X X X X X 0x801C
X X X X X X X X 0x7FFF
X X X X X X X X 0x2C00
X X X X X X X X 0x2C01
X X X X X X X X 0x2BFE
X X X X X X X X 0x2AFF
X X X X X X X X 0x2B00
X X X X X X X X 0x2B01
... ...
X X X X X X X X 0x2800
X X X X X X X X 0x2801
... ...
X X X X X X X X 0x283E
X X X X X X X X 0x283F
X X X X X X X X 0x2840
X X X X X X X X 0x2841
X X X X X X X X X X X X X X X X 0x8002
X X X X X X X X X X X X X X X X 0x801A
J
1
C
o
p
r
o
c
e
s
s
o
r
C
o
d
e
S
p
a
c
e
G
a
m
e
d
u
i
n
o
R
e
g
i
s
t
e
r
s
C
o
p
r
o
c
e
s
s
o
r
-
O
n
l
y
R
e
g
i
s
t
e
r
s
A
c
c
e
s
s
i
b
l
e
t
o
A
r
d
u
i
n
o
v
i
a
S
P
I
B
u
s
0x0001
0x0000
X X X X X X X X
X X X X X X X X
PC 1 0 1 0 1 1 0 0 A A A A A A A 0
ALU
O$GQ#& M+ SE )0G$A.4 K#A^$%&A%Q#&
BRAFT uameuuino Refeience Nanual
S9
uameuuino copiocessoi softwaie uevelopment kit. A valiu }1 assembly piogiam
must contain a subioutine nameu "main", which will be the piimaiy entiy point of
the piogiam. This ioutine must not ietuin to the callei - it shoulu eithei loop
inuefinitely itself, oi enu with an empty infinite loop ("begin again"). 0ptionally, the
piogiam may contain auuitional subioutines befoie main. The shell of a }1
assembly language piogiam is piesenteu as Sketch S: }1 Assembly Piogiam
Template. A summaiy of the }1 assembly language is pioviueu as Table S1: }1
Assembly Language Summaiy.
2.34& IE+ SE K''&-341 ).*GQ.G& !Q--.#1
F*'%#QA%$0* =0"' =Q'^&' OQ*A%$0*
Assemblei Biiectives
start-microprogram symbol --- ---
end-microprogram --- ---
nnnnn constant symbol --- --- Befines symbol
Liteial Instiuctions
d# nnnnn --- nnnnn Pushes constant nnnn
h# hhhh --- hhhh Pushes constant hhhh
[char]c --- c Pushes constant c
symbol --- value Pushes value of symbol
ANS Foith Instiuctions
+ N, T N+T Auu
1- T T-1 Beciement
= N, T N=T Bitwise equality
< N, T N<T 0nsigneu less-than
u< N, T N<T Signeu less-than
xor N, T N!T Bitwise exclusive oi
and N, T N"T Bitwise anu
or N, T N#T Bitwise oi
invert T ~T Bitwise negation
swap N, T T, N Swaps T anu N
dup --- T Buplicates T
drop T --- Biscaius T
over --- N Pushes a copy of N
nip N --- Biscaius N (pieseiving T)
>r T R Noves T to R
r> R T Noves R to T
r@ --- R Pushes a copy of R
rshift N, T N>>T Logical iight shift
* N, T N T Nultiply
Auuitional Instiuctions
swab
T T' Swap bytes within T
noop
--- --- No opeiation
Nulti-Woiu ANS Foith Instiuctions
c@
T |Tj Loau byte at memoiy auuiess T
c!
N, T --- Stoie N to memoiy auuiess T
BRAFT uameuuino Refeience Nanual
6u
F*'%#QA%$0* =0"' =Q'^&' OQ*A%$0*
Neigeu Instiuctions
2dup+
--- N+T ovei ovei +
over+
T N+T ovei +
2dup=
--- N=T ovei ovei =
over=
T N=T ovei =
2dup<
--- N<T ovei ovei <
over>
T N>T ovei >
2dupu<
--- N<T ovei ovei u<
overu>
T N>T ovei u>
2dupxor
--- N!T ovei ovei xoi
overxor
T N!T ovei xoi
2dupand
--- N"T ovei ovei anu
overand
T N"T ovei anu
2dupor
--- N#T ovei ovei oi
overor
T N#T ovei oi
dup>r
--- R uup i>
2duprshift
--- N>>T ovei ovei ishift
2dup*
--- N T ovei ovei *
over*
T N T ovei *
dupswab
--- T' uup swab
dupc@
--- |Tj uup c
Flow Contiol
: symbol
--- --- Befine subioutine
;
R --- Retuin, pop R to PC
;fallthru
--- --- Enu subioutine without ietuin
symbol
R Call subioutine, push PC to R
if
T --- Conuitional bianch
else
--- --- Conuitional bianch sepaiatoi
then
--- --- Conuitional bianch teiminatoi
begin
--- -- Begin loop
again
--- --- Retuin to "begin", infinite loop
until
T --- Bottom-exit, loop when false
while
T --- Niuule-exit, loop when tiue
repeat
--- --- Retuin to "begin"
Each subioutine begins with a uefinition, incluues multiple instiuctions, anu enus
with a ietuin. A subioutine uefinition is a colon, followeu by the name of the
subioutine being uefineu. Foith woius within each subioutine aie assembleu into }1
instiuctions, anu aie executeu in the oiuei that they aie encounteieu. Bue to the
}1's stack-oiienteu aichitectuie, aiithmetic is executeu in postfix fashion: piogiams
must fiist push the appiopiiate values onto the uata stack piioi to couing aiithmetic
oi logic instiuctions that will opeiate on them Finally, the subioutine enus with a
semicolon.
BRAFT uameuuino Refeience Nanual
61
E,$*2 %B& FG C,,&0D+&#
The }1 assemblei is not integiateu into the Aiuuino IBE. Insteau, a sepaiate }1
assemblei, wiitten in the gfoith piogiamming language, is useu to assemble }1 coue
into binaiy foimat. 0ne of the outputs of the }1 assemblei is a heauei file that can be
incluueu into Aiuuino sketches. The heauei incluues the assembleu }1 coue as an
aiiay of bytes stoieu in piogiam memoiy.
<<<to-uo: inseit uiiections foi assembling piogiams>>>
FG C,,&0D+@ 41*2912& ;&H&#&*.&
}1 instiuctions incluue liteials, which push values onto the uata stack, ANS Foith
instiuctions anu auuitional instiuctions that peifoim aiithmetic, logical anu uata
opeiations, anu flow-contiol statements. These instiuctions aie uesciibeu in the
tables below.
K''&-34&# R$#&A%$a&'+ The assemblei suppoits thiee uiiectives: stait- anu enu-
uiiectives foi maiking the beginning anu enu of }1 assembly coue, plus an assemblei
constant facility. The uiiectives aie summaiizeu in Table S2: }1 Assemblei
Biiectives, below.
2.34& I5+ SE K''&-34&# R$#&A%$a&'
Instiuction Explanation
start-microprogram symbol
!%.#% =#0G#.-
OQ*A%$0*+ Naiks the stait of a }1 miciopiogiam foi
the assemblei.
!1*%.B+ The stait-miciopiogiam uiiective must be
followeu by a valiu alphanumeiic symbol. All
miciopiogiams shoulu contain a "main"
subioutine containing one oi moie instiuctions,
anu close with the "enu-miciopiogiam" uiiective.
Niciopiogiams may optionally contain auuitional
subioutine uefinitions.
DB.-"4&+ start-microprogram example1
end-microprogram
D*9 =#0G#.-
OQ*A%$0*+ Naiks the enu of a }1 miciopiogiam to the
assemblei.
!1*%.B+ None.
DB.-"4&+ end-microprogram
BRAFT uameuuino Refeience Nanual
62
Instiuction Explanation
nnnnn constant symbol
R&;$*& 70*'%.*%
OQ*A%$0*+ Befines an assemblei constant nameu
!"#$%& with the value (((((.
!1*%.B+ The "constant" uiiective must be pieceueu by
a valiu uecimal integei, (((((, in the iange u to
6SSSS, oi a piepiocesoi uefinition that evaluates
to a uecimal integei. It must be followeu by a
valiu symbol, the name of the constant.
DB.-"4&+ 10386 constant fillchar
Befines an assemblei constant nameu "fillchai"
with the value 1uS86 (ux2892).
)$%&#.4 F*'%#QA%$0*'+ As shown in Table SS: }1 Liteial Instiuctions, a vaiiety of
liteial values can be pusheu onto the }1's stack. Liteials can incluue 16-bit values,
anu aie assembleu into one oi two instiuctions. A single instiuction is useu foi
values of u thiough S2767 (uxuuu thiough ux7FFF), while two instiuctions aie
neeueu foi values of S2768 thiough 6SSSS (ux8uuu thiough uxFFFF).
2.34& I@+ SE )$%&#.4 F*'%#QA%$0*'
Instiuction Explanation
d# nnnnn
R&A$-.4 UQ-3&#+ ***** ! 2
OQ*A%$0*+ Pushes a uecimal liteial onto the uata stack.
!1*%.B+ The "u#" uiiective must be followeu by a valiu uecimal integei,
(((((, in the iange u to 6SSSS.
U0%&+ Assembles to a single instiuction foi values in the iange u to S2767;
two instiuctions anu two }1 CP0 cycles aie iequiieu foi values in the
iange S2768 to 6SSSS.
DB.-"4&+ d# 128
uxuu8u ! T
h# hhhh
Y&B.9&A$-.4 UQ-3&#+ >B^^^^ ! 2
OQ*A%$0*+ Pushes a hexauecimal liteial onto the uata stack.
!1*%.B+ The "h#" uiiective must be followeu by a valiu hexauecimal
integei, )))), in the iange uxuuuu to uxFFFF.
U0%&+ Assembles to a single instiuction foi values in the iange uxuuuu to
ux7FFF; two instiuctions anu two }1 CP0 cycles aie iequiieu foi
values in the iange ux8uuu to uxFFFF.
DB.-"4&+ h# 2B80
ux2B8u ! T
[char]c
7^.#.A%&#+ A ! 2
OQ*A%$0*+ Pushes a one-byte chaiactei liteial, c, onto the uata stack.
!1*%.B+ The "|chaij" uiiective must be followeu by a single one-byte
chaiactei, *.
DB.-"4&+ [char] Z
uxuuSA ! T
BRAFT uameuuino Refeience Nanual
6S
Instiuction Explanation
symbol
F*'&#% 70*'%.*%
OQ*A%$0*+ Inseits the nameu assemblei constant as a liteial; functionally
equivalent to the "u#" uiiective above.
!1*%.B+ "!"#$%&+ is the name of any uefineu assemblei constant. An
assemblei eiioi is ietuineu if the name is invaliu oi unuefineu.
DB.-"4&+ fillchar
ux2892 ! T
KU! O0#%^ F*'%#QA%$0*'+ The following Foith piimitives aie assembleu as single
instiuctions. Foi the examples, note that liteial instiuctions aie useu to loau the
uata stack, so T=uxuu29 anu if neeueu N=uxuuuS (uecimal 41 anu S iespectively).
Assume that uameuuino memoiy locations in RAN_PIC (incluuing both uxuu29 anu
uxuuuS) contain an ASCII blanks (ux2u, uecimal S2).
2.34& IM+ SE KU! O0#%^ F*'%#QA%$0*'
Instiuction Explanation
+
=4Q'+ U b 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack anu pushes the
sum N+T onto the uata stack, ieuucing the net stack uepth by one.
!1*%.B+ The "+" opeiatoi iequiies two opeianus on the uata stack.
Aiithmetic oveiflow uoes not cause an exception; insteau, the caiiy
bit (most significant bit) of the iesult is uiscaiueu.
DB.-"4&+ d# 3 h# 0029 +
N=uxuuuS + T=uxuu29 = uxuu2C ! T
1-
R&A#&-&*%+ cc2 ! 2
OQ*A%$0*+ Subtiacts one fiom T; uoes not change the stack uepth.
!1*%.B+ The "1-" opeiatoi iequiies one opeianu on the uata stack.
Aiithmetic unueiflow uoes not cause an exception; ueciementing
uxuuuu iesults in uxFFFF.
DB.-"4&+ h# 0029 1-
T=uxuu29 - 1 = uxuu28 ! T
=
DWQ.4'+ U dd 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack anu pushes a
Boolean flag onto the stack, ieuucing the net stack uepth by one. The
flag is tiue (uxuuu1) if T anu N aie bit-foi-bit iuentical, oi false
(uxuuuu) otheiwise.
!1*%.B+ The "=" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 =
N=uxuuuS == T=uxuu29 = uxuuuu ! T
<
)&'' 2^.*+ U e 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack anu pushes a
Boolean flag onto the stack, ieuucing the net stack uepth by one. The
flag is tiue (uxuuu1) if N < T when N anu T aie tieateu as signeu two's
complement 16-bit integeis, oi false (uxuuuu) otheiwise.
!1*%.B+ The "<" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 <
N=uxuuuS < T=uxuu29 = uxuuu1 ! T
BRAFT uameuuino Refeience Nanual
64
Instiuction Explanation
u<
f*'$G*&9 )&'' 2^.*+ U e 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack anu pushes a
Boolean flag onto the stack, ieuucing the net stack uepth by one. The
flag is tiue (uxuuu1) if N < T when N anu T aie tieateu as unsigneu
16-bit integeis, oi false (uxuuuu) otheiwise.
!1*%.B+ The "u<" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 u<
N=uxuuuS < T=uxuu29 = uxuuu1 ! T
xor
DBA4Q'$a& :#+ U ! 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack anu pushes the
iesult of a bit-by-bit exclusive-oi between N anu T onto the stack,
ieuucing the net stack uepth by one.
!1*%.B+ The "xoi" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 xor
N=uxuuuS ! T=uxuu29 = uxuu2A ! T
and
K*9+ U " 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack anu pushes the
iesult of a bit-by-bit anu between N anu T onto the stack, ieuucing the
net stack uepth by one.
!1*%.B+ The "anu" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 and
N=uxuuuS " T=uxuu29 = uxuuu1 ! T
or
:#+ U # 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack anu pushes the
iesult of a bit-by-bit inclusive-oi between N anu T onto the stack,
ieuucing the net stack uepth by one.
!1*%.B+ The "oi" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 or
N=uxuuuS # T=uxuu29 = uxuu2B ! T
invert
F*a&#%+ g2 ! 2
OQ*A%$0*+ Peifoims a bitwise inveision of T; all one bits become zeio anu
vice-veisa. Boes not change the stack uepth.
!1*%.B+ The "inveit" opeiatoi iequiies one opeianu on the uata stack.
DB.-"4&+ h# 0029 invert
~ T=uxuu29 = uxFFB6 ! T
swap
!H."+ U " 2
OQ*A%$0*+ Exchanges the values of N anu T on the uata stack. Boes not
change the stack uepth.
!1*%.B+ The "swap" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 swap
N=uxuuuS T=uxuu29 ! N=uxuu29 T=uxuuuS
dup
RQ"4$A.%&+ 2 ! hbb9'%.A]i
OQ*A%$0*+ Pushes the value of T onto the stack, effectively uuplicating T;
incieases the stack uepth by one.
!1*%.B+ The "uup" opeiatoi iequiies one opeianu on the uata stack.
DB.-"4&+ h# 0029 dup
T=uxuu29 ! T
BRAFT uameuuino Refeience Nanual
6S
Instiuction Explanation
drop
R#0"
OQ*A%$0*+ Biscaius the top element of the uata stack, uecieasing the stack
uepth by one anu piomoting N to the new top of stack.
!1*%.B+ The "uiop" opeiatoi iequiies one opeianu on the uata stack.
DB.-"4&+ drop
over
:a&#+ U ! 2
OQ*A%$0*+ Pushes a copy of N onto the uata stack, incieasing stack uepth
by one.
!1*%.B+ The "ovei" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 over
N=uxuuuS ! T
nip
U$"
OQ*A%$0*+ Removes N fiom the uata stack, pieseiving T anu uecieasing
stack uepth by one.
!1*%.B+ The "nip" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 nip
>r
=Q%?#!%.A]+ 2 ! C
OQ*A%$0*+ Pops T fiom the uata stack anu pushes it onto the ietuin stack,
uecieasing uata stack uepth by one anu incieasing ietuin stack uepth
by one.
!1*%.B+ The ">i" opeiatoi iequiies one opeianu on the uata stack. Since
the ietuin stack is also useu to stoie subioutine ietuin auuiesses, any
items pusheu onto the ietuin stack must be iemoveu befoie
attempting to ietuin via ";".
DB.-"4&+ h# 0029 >r
T=uxuu29 ! R
r>
#!%.A]?V&%+ C ! 2
OQ*A%$0*+ Pops R fiom the ietuin stack anu pushes it onto the uata stack,
uecieasing ietuin stack uepth by one anu incieasing uata stack uepth
by one.
!1*%.B+ The "i>" opeiatoi iequiies one opeianu on the ietuin stack. 0sei
piogiams must take caie not to uistuib existing ietuin auuiesses
when manipulating the ietuin stack.
DB.-"4&+ r>
R=uxuu29 ! T
r@
#!%.A]?O&%A^+ C ! h2
OQ*A%$0*+ Copies R fiom the ietuin stack anu pushes it onto the uata
stack, incieasing uata stack uepth by one. Retuin stack uepth is not
affecteu.
!1*%.B+ The "i" opeiatoi iequiies one opeianu on the ietuin stack.
DB.-"4&+ r@
R=uxuu29 ! T
BRAFT uameuuino Refeience Nanual
66
Instiuction Explanation
rshift
C$G^% !^$;%+ U jj 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack, logically shifts N
to the iight by T bit places, inseiting zeios into the most significant
places vacateu by the shift. The iesult is pusheu onto the uata stack;
"ishift" ieuuces the net stack uepth by one.
!1*%.B+ The "ishift" opeiatoi iequiies two opeianus on the uata stack.
The iesult of the opeiation is unuefineu if T >= 16.
DB.-"4&+ h# 1A3C h# 0003 rshift
N=ux1ASC >> T=uxuuuS = uxuS47 ! T
*
/Q4%$"41+ U k 2 ! 2
OQ*A%$0*+ Pops two values (N anu T) fiom the uata stack anu pushes the
piouuct TN onto the uata stack, ieuucing the net stack uepth by one.
!1*%.B+ The "*" opeiatoi iequiies two opeianus on the uata stack.
Aiithmetic oveiflow uoes not cause an exception; insteau, the caiiy
bit (most significant bit) of the iesult is uiscaiueu.
DB.-"4&+ d# 3 h# 0029 *
N=uxuuuS T=uxuu29 = uxuu7B ! T
K99$%$0*.4 F*'%#QA%$0*'+ In auuition to the ANS Foith instiuctions, the }1
copiocessoi implements two instiuctions that aie not piesent in the stanuaiu Foith
language, as uesciibeu in Table SS: }1 Auuitional Instiuctions below. These
opeiations aie also implementeu as single instiuctions on the uameuuino's }1 CP0:
2.34& II+ SE K99$%$0*.4 F*'%#QA%$0*'
Instiuction Explanation
swab
!H." ,1%&'+ 2l ! 2
OQ*A%$0*+ Swaps the high anu low bytes of T. Boes not change the
stack uepth.
!1*%.B+ The "swab" opeiatoi iequiies one opeianu on the uata
stack.
DB.-"4&+ h# 0029 swab
T=uxuu29 swab = ux29uu ! T
noop
U0 :"&#.%$0*
OQ*A%$0*+ Peifoims no opeiation, uoes not change any stack.
!1*%.B+ None.
DB.-"4&+ noop
/Q4%$?H0#9 F*'%#QA%$0*'+ In auuition to some liteial instiuctions, a few auuitional
ANS Foith base woius iequiie multiple }1 instiuctions foi implementation, as
uesciibeu in Table S6: }1 Nulti-Woiu Instiuctions. In paiticulai, memoiy access
timing iequiies that memoiy access take two }1 machine cycles to complete, so
Foith woius that iequiie memoiy access aie assembleu into two machine
instiuctions to pioviue sufficient time.
2.34& IJ+ SE /Q4%$?80#9 F*'%#QA%$0*'
Instiuction Explanation
BRAFT uameuuino Refeience Nanual
67
Instiuction Explanation
c@
7^.#.A%&# O&%A^+ h2i ! 2
OQ*A%$0*+ Fetches an 8-bit byte oi a 16-bit woiu fiom memoiy, uepenuing
on context:
If T is between uxuuuu anu ux7FFF (u to S2767 uecimal), ieaus
the byte at memoiy auuiess T anu paus the uppei 8 bits with
zeios.
If T is an even numbei between ux8uuu anu ux8u1C (S2768 to
S2796 uecimal), ieaus the 16-bit woiu at memoiy auuiess.
In eithei case, the top of the uata stack is ieplaceu with the value ieau;
net uata stack uepth is not affecteu.
!1*%.B+ The "c" opeiatoi iequiies one opeianu on the uata stack. The
opeiation of "c" is unuefineu when T contains an ouu numbei
between ux8uu1 anu ux8u1B, oi when T contains a value gieatei than
ux8u1C.
U0%&+ Assembleu as "noop c" to ensuie coiiect memoiy access timing.
DB.-"4&+ h# 0x0029 c@
|T=uxuu29j=uxuu2u ! T
c!
7^.#.A%&# !%0#&+ U ! h2i
OQ*A%$0*+ Wiites an 8-bit oi a 16-bit value to memoiy, uepenuing on
context:
If T is between uxuuuu anu ux7FFF (u to S2767 uecimal), wiites
the low (least-significant) byte of N to the memoiy auuiess T.
If T is an even numbei between ux8uuu anu ux8u1C (S2768 to
S2796 uecimal), wiites all 16 bits of N to the woiu at memoiy
auuiess T anu T+1.
In eithei case, "c!" pops two values (N anu T) fiom the uata stack,
ieuucing uata stack uepth by two.
!1*%.B+ The "c!" opeiatoi iequiies two opeianus on the uata stack. The
opeiation of "c!" is unuefineu when T contains an ouu numbei between
ux8uu1 anu ux8u1B. Bata is uiscaiueu without waining if the
opeiation attempts to wiite uata to non-existent oi ieau-only memoiy
auuiesses.
U0%&+ Assembles as two instiuctions (one that wiites to memoiy but only
iemoves N fiom the stack, followeu by uiop) to ensuie coiiect memoiy
access timing.
DB.-"4&+ d# 3 h# 0x0029 c!
N=uxuuuS ! |T=uxuu29j
/&#G&9 F*'%#QA%$0*'+ The }1 CP0 can execute a numbei of single instiuctions that
peifoim the equivalent of two ANS Foith piimitives in sequence. In each case, the
meigeu instiuction is nameu foi its components: foi example, executing "oveianu"
is the same as executing the coue fiagment "ovei anu". Neigeu instiuctions
iepiesent a significant oppoitunity to save coue size anu execution time by taking
auvantage of featuies unique to the }1 CP0 aichitectuie. Table S7: }1 Neigeu
Instiuctions uesciibes these instiuctions.
2.34& IN+ SE /&#G&9 F*'%#QA%$0*'
Instiuction Explanation
BRAFT uameuuino Refeience Nanual
68
Instiuction Explanation
2dup+
59Q" =4Q'+ U b 2 ! 2
OQ*A%$0*+ Pushes the sum N+T onto the uata stack, incieasing the net
stack uepth by one.
!1*%.B+ The "2uup+" opeiatoi iequiies two opeianus on the uata stack.
Aiithmetic oveiflow uoes not cause an exception; insteau, the caiiy
bit (most significant bit) of the iesult is uiscaiueu.
DB.-"4&+ d# 3 h# 0029 2dup+
N=uxuuuS + T=uxuu29 = uxuu2C ! T
over+
59Q" =4Q'+ U b 2 ! 2
OQ*A%$0*+ Pops one value (T) fiom the uata stack, anu pushes the sum
N+T onto the uata stack, leaving the net stack uepth unchangeu.
!1*%.B+ The "ovei+" opeiatoi iequiies two opeianus on the uata stack.
Aiithmetic oveiflow uoes not cause an exception; insteau, the caiiy
bit (most significant bit) of the iesult is uiscaiueu.
DB.-"4&+ d# 3 h# 0029 over+
N=uxuuuS + T=uxuu29 = uxuu2C ! T
2dup=
5RQ" DWQ.4'+ U dd 2 ! 2
OQ*A%$0*+ Pushes a Boolean flag onto the uata stack, incieasing the net
stack uepth by one. The flag is tiue (uxuuu1) if T anu N aie bit-foi-bit
iuentical, oi false (uxuuuu) otheiwise.
!1*%.B+ The "2uup=" opeiatoi iequiies two opeianus on the uata stack.
Stack unueiflow uoes not iaise an exception; iesults of a computation
involving an unueiflow aie unuefineu.
DB.-"4&+ d# 3 h# 0x0029 2dup=
N=uxuuuS == T=uxuu29 = uxuuuu ! T
over=
:a&# DWQ.4'+ U dd 2 ! 2
OQ*A%$0*+ Pops one value (T) fiom the uata stack, anu pushes a Boolean
flag onto the uata stack, leaving the net stack uepth unchangeu. The
flag is tiue (uxuuu1) if T anu N aie bit-foi-bit iuentical, oi false
(uxuuuu) otheiwise.
!1*%.B+ The "ovei=" opeiatoi iequiies two opeianus on the uata stack.
Stack unueiflow uoes not iaise an exception; iesults of a computation
involving an unueiflow aie unuefineu.
DB.-"4&+ d# 3 h# 0x0029 over=
N=uxuuuS == T=uxuu29 = uxuuuu ! T
2dup<
59Q" )&'' 2^.*+ U e 2 ! 2
OQ*A%$0*+ Pushes a Boolean flag onto the uata stack, incieasing the net
stack uepth by one. The flag is tiue (uxuuu1) if N < T when N anu T
aie tieateu as signeu two's complement 16-bit integeis, oi false
(uxuuuu) otheiwise.
!1*%.B+ The "2uup<" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 2dup<
N=uxuuuS < T=uxuu29 = uxuuu1 ! T
BRAFT uameuuino Refeience Nanual
69
Instiuction Explanation
over>
59Q" V#&.%&# 2^.*+ U j 2 ! 2
OQ*A%$0*+ Pops one value (T) fiom the uata stack anu pushes a Boolean
flag onto the stack, leaving the net stack uepth unchangeu. The flag is
tiue (uxuuu1) if N > T when N anu T aie tieateu as signeu two's
complement 16-bit integeis, oi false (uxuuuu) otheiwise.
!1*%.B+ The "ovei>" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 over>
N=uxuuuS > T=uxuu29 = uxuuuu ! T
2dupu<
59Q" f*'$G*&9 )&'' 2^.*+ U e 2 ! 2
OQ*A%$0*+ Pushes a Boolean flag onto the uata stack, incieasing the net
stack uepth by one. The flag is tiue (uxuuu1) if N < T when N anu T
aie tieateu as unsigneu 16-bit integeis, oi false (uxuuuu) otheiwise.
!1*%.B+ The "2uupu<" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 2dupu<
N=uxuuuS < T=uxuu29 = uxuuu1 ! T
overu>
:a&# f*'$G*&9 V#&.%&# 2^.*+ U j 2 ! 2
OQ*A%$0*+ Pops one value (T) fiom the uata stack, anu pushes a Boolean
flag onto the stack, leaving the net stack uepth by unchangeu. The flag
is tiue (uxuuu1) if N > T when N anu T aie tieateu as unsigneu 16-bit
integeis, oi false (uxuuuu) otheiwise.
!1*%.B+ The "oveiu>" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 overu>
N=uxuuuS > T=uxuu29 = uxuuuu ! T
2dupxor
5RQ" DBA4Q'$a& :#+ U ! 2 ! 2
OQ*A%$0*+ Pushes the iesult of a bit-by-bit exclusive-oi between N anu T
onto the uata stack, incieasing the net stack uepth by one.
!1*%.B+ The "2uupxoi" opeiatoi iequiies two opeianus on the uata stack.
Stack unueiflow uoes not iaise an exception; iesults of a computation
involving an unueiflow aie unuefineu.
DB.-"4&+ d# 3 h# 0x0029 2dupxor
N=uxuuuS ! T=uxuu29 = uxuu2A ! T
overxor
:a&# DBA4Q'$a& :#+ U ! 2 ! 2
OQ*A%$0*+ Pops one value (T) fiom the uata stack, anu pushes the iesult of
a bit-by-bit exclusive-oi between N anu T onto the uata stack, leaving
the net stack uepth unchangeu.
!1*%.B+ The "oveixoi" opeiatoi iequiies two opeianus on the uata stack.
Stack unueiflow uoes not iaise an exception; iesults of a computation
involving an unueiflow aie unuefineu.
DB.-"4&+ d# 3 h# 0x0029 overxor
N=uxuuuS ! T=uxuu29 = uxuu2A ! T
2dupand
59Q" K*9+ U " 2 ! 2
OQ*A%$0*+ Pushes the iesult of a bit-by-bit anu between N anu T onto the
stack, incieasing the net stack uepth by one.
!1*%.B+ The "2uupanu" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 2dupand
N=uxuuuS " T=uxuu29 = uxuuu1 ! T
BRAFT uameuuino Refeience Nanual
7u
Instiuction Explanation
overand
:a&# K*9+ U " 2 ! 2
OQ*A%$0*+ Pops one value (T) fiom the uata stack anu pushes the iesult of
a bit-by-bit anu between N anu T onto the uata stack, leaving the net
stack uepth unchangeu.
!1*%.B+ The "oveianu" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 overand
N=uxuuuS " T=uxuu29 = uxuuu1 ! T
2dupor
59Q" :#+ U # 2 ! 2
OQ*A%$0*+ Pushes the iesult of a bit-by-bit inclusive-oi between N anu T
onto the uata stack, incieasing the net stack uepth by one.
!1*%.B+ The "2uupoi" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 2dupor
N=uxuuuS # T=uxuu29 = uxuu2B ! T
overor
:a&# :#+ U # 2 ! 2
OQ*A%$0*+ Pops one values (T) fiom the uata stack anu pushes the iesult of
a bit-by-bit inclusive-oi between N anu T onto the stack, leaving the
net stack uepth unchangeu.
!1*%.B+ The "oveioi" opeiatoi iequiies two opeianus on the uata stack.
DB.-"4&+ d# 3 h# 0029 overor
N=uxuuuS # T=uxuu29 = uxuu2B ! T
dup>r
RQ" =Q%?#!%.A]+ 2 ! C
OQ*A%$0*+ Copies T fiom the uata stack to the ietuin stack, incieasing
ietuin stack uepth by one but leaving the uata stack uepth unchangeu.
!1*%.B+ The "uup>i" opeiatoi iequiies one opeianu on the uata stack.
Since the ietuin stack is also useu to stoie subioutine ietuin
auuiesses, any items pusheu onto the ietuin stack must be iemoveu
befoie attempting to ietuin via ";".
DB.-"4&+ h# 0x0029 >r
T=uxuu29 ! R
2duprshift
59Q" C$G^% !^$;%+ U jj 2 ! 2
OQ*A%$0*+ Logically shifts N to the iight by T bit places, inseiting zeios
into the most significant places vacateu by the shift. The iesult is
pusheu onto the uata stack; "2uupishift" incieases the net stack uepth
by one.
!1*%.B+ The "2uupishift" opeiatoi iequiies two opeianus on the uata
stack. The iesult of the opeiation is unuefineu if T >= 16.
DB.-"4&+ h# 1A3C h# 0003 2duprshift
N=ux1ASC >> T=uxuuuS = uxuS47 ! T
2dup*
59Q" /Q4%$"41+ U k 2 ! 2
OQ*A%$0*+ Pushes the piouuct TN onto the uata stack, incieasing the net
stack uepth by one.
!1*%.B+ The "2uup*" opeiatoi iequiies two opeianus on the uata stack.
Aiithmetic oveiflow uoes not cause an exception; insteau, the caiiy
bit (most significant bit) of the iesult is uiscaiueu.
DB.-"4&+ d# 3 h# 0029 2dup*
N=uxuuuS T=uxuu29 = uxuu7B ! T
BRAFT uameuuino Refeience Nanual
71
Instiuction Explanation
over*
:a&# /Q4%$"41+ U k 2 ! 2
OQ*A%$0*+ Pops one value (T) fiom the uata stack anu pushes the piouuct
TN onto the uata stack, leaving the net stack uepth unchangeu.
!1*%.B+ The "ovei*" opeiatoi iequiies two opeianus on the uata stack.
Aiithmetic oveiflow uoes not cause an exception; insteau, the caiiy
bit (most significant bit) of the iesult is uiscaiueu.
DB.-"4&+ d# 3 h# 0029 over*
N=uxuuuS T=uxuu29 = uxuu7B ! T
dupswab
RQ" !H." ,1%&'+ 2l ! 2
OQ*A%$0*+ Swaps the high anu low bytes of T anu pushes the iesult onto
the uata stack, incieasing the stack uepth by one.
!1*%.B+ The "swab" opeiatoi iequiies one opeianu on the uata stack.
DB.-"4&+ h# 0029 dupswab
T=uxuu29 swab = ux29uu ! T
dupc@
RQ" 7^.#.A%&# O&%A^+ h2i ! 2
OQ*A%$0*+ Fetches an 8-bit byte oi a 16-bit woiu fiom memoiy, uepenuing
on context, anu pushes it onto the uata stack:
If T is between uxuuuu anu ux7FFF (u to S2767 uecimal),
ieaus the byte at memoiy auuiess T anu paus the uppei 8 bits
with zeios.
If T is an even numbei between ux8uuu anu ux8u1C (S2768 to
S2796 uecimal), ieaus the 16-bit woiu at memoiy auuiess T.
In eithei case, the iesulting value is pusheu onto the uata stack,
incieasing the net stack uepth by one.
!1*%.B+ The "uupc" opeiatoi iequiies one opeianu on the uata stack.
The opeiation of "uupc" is unuefineu when T contains an ouu
numbei between ux8uu1 anu ux8u1B, oi when T contains a value
gieatei than ux8u1C.
U0%&+ Assembleu as "uup c" to ensuie coiiect memoiy access timing.
DB.-"4&+ h# 0x0029 dupc@
|T=uxuu29j=uxuu2u ! T
O40H 70*%#04+ The assemblei also iecognizes a numbei of that useu to ueteimine
how pieceuing anu subsequent instiuctions shoulu be assembleu, oi that implement
flow contiol such as bianching anu subioutines. Nost of the uiiectives will
assemble into one }1 instiuction, typically a bianch oi call. Some uiiectives,
incluuing ":", "then", anu "begin" maik bianch oi call auuiesses insteau. Subioutine
ietuins via ";" uo not iequiie a sepaiate instiuction in most cases.
2.34& I6+ SE K''&-34&# O40H 70*%#04
Instiuction Explanation
BRAFT uameuuino Refeience Nanual
72
Instiuction Explanation
: symbol
R&;$*& !Q3#0Q%$*&
OQ*A%$0*+ Befines a subioutine entiy point nameu "symbol". Coue
following the subioutine name up to the next semicolon will be
assembleu into a subioutine anu calleu when the symbol is invokeu.
!1*%.B+ The ":" uiiective must be followeu by a valiu symbol (the name of
the subioutine) anu zeio oi moie instiuctions. Subioutine uefinitions
may not be nesteu: eveiy subioutine must be closeu with ";" oi
";fallthiu" uiiective befoie anothei subioutine can be uefineu.
DB.-"4&+ : > swap < ;
Befines a subioutine entiy point nameu ">" that will execute "swap <"
whenevei it is calleu.
;
C&%Q#* ;#0- !Q3#0Q%$*&+ C ! =7
OQ*A%$0*+ Completes the uefinition of a subioutine anu assembles a
ietuin instiuction: the top-most value of the ietuin stack is iemoveu
anu loaueu into the piogiam countei. Reuuces the ietuin stack uepth
by one; the uata stack uepth is unaffecteu.
!1*%.B+ The ";" uiiective must be pieceueu by a valiu subioutine
uefinition consisting of the ":" uiiective, a symbol, anu zeio oi moie
instiuctions.
U0%&+ The }1 aichitectuie often allows a "fiee" ietuin: AL0 instiuctions
can be coueu to also ietuin fiom a subioutine, making subioutines
paiticulaily efficient at ieuucing the oveiall coue size of a piogiam.
DB.-"4&+ ;
R ! PC
;fallthru
D*9 !Q3#0Q%$*& H$%^0Q% C&%Q#*
OQ*A%$0*+ Completes the uefinition of a subioutine, but uoes not assemble
a ietuin instiuction. This allows subioutines with multiple entiy
points. Execution continues with the next instiuction following the
";fallthiu" uiiective.
!1*%.B+ The ";fallthiu" uiiective must be pieceueu by a valiu subioutine
uefinition beginning with the ":" uiiective, a symbol, anu zeio oi moie
executable instiuctions. It must be followeu by anothei subioutine
uefinition.
DB.-"4&+ : 0> d# 0 ;fallthru : > swap < ;
Befines a subioutine with two entiy points, "u>" anu ">". When "u>"
is calleu, the instiuction stieam "u# u swap <" is executeu; when ">"
is calleu, only "swap <" is executeu.
symbol
7.44 !Q3#0Q%$*&+ =7 ! Cm !"#$%& ! ()
OQ*A%$0*+ Pushes the location of the following instiuction onto the ietuin
stack anu calls the nameu subioutine. Retuin stack uepth incieases
by one.
!1*%.B+ The name of any uefineu subioutine, sepaiateu by white space.
An assemblei eiioi is ietuineu if the name is invaliu oi if a
subioutine with the given name can't be founu.
DB.-"4&+ 0>
Calls the subioutine uefineu as an example above; the instiuction
stieam "u# u swap <" is executeu.
BRAFT uameuuino Refeience Nanual
7S
Instiuction Explanation
if
70*9$%$0*.4 ,#.*A^
OQ*A%$0*+ Pops T fiom the uata stack anu tieats it as a Boolean flag.
When the flag is false (uxuuuu), the coue between "else" anu "then" is
executeu. 0theiwise, the coue between "if" anu "else" is executeu. In
eithei case, execution iesumes with the instiuction following "then".
"If" ieuuces the uata stack uepth by one.
!1*%.B+ A conuitional bianch begins with "if", may optionally contain
"else", anu must close with "then"; each is sepaiateu by zeio oi moie
woius. The execution path is unuefineu if the stack is empty.
Conuitional bianches may be nesteu to an unspecifieu uepth.
DB.-"4&+ 2dup < if nip else drop then
Compaies T anu N, anu iemoves the smallei value fiom the stack
pieseiving the laigei as the new top of stack: max(N,T) ! T.
else
70*9$%$0*.4 ,#.*A^ !&".#.%0#
OQ*A%$0*+ Sepaiates the two alteinatives coue paths in a conuitional
bianch. If theie is no coue between "else" anu "then", the "else" may
also be omitteu. See "if" above.
!1*%.B+ A conuitional bianch begins with "if", may optionally contain
"else", anu must close with "then"; each is sepaiateu by zeio oi moie
woius. Conuitional bianches may be nesteu to an unspecifieu uepth.
DB.-"4&+ 2dup < if nip else drop then
Compaies T anu N, anu iemoves the smallei value fiom the stack
pieseiving the laigei as the new top of stack: max(N,T) ! T.
then
70*9$%$0*.4 ,#.*A^ 2&#-$*.%0#
OQ*A%$0*+ Enus a conuitional bianch; noimal execution iesumes with the
instiuction following "then". See if above.
!1*%.B+ A conuitional bianch begins with "if", may optionally contain
"else", anu must close with "then"; each is sepaiateu by zeio oi moie
executable instiuctions. Conuitional bianches may be nesteu to an
unspecifieu uepth.
DB.-"4&+ 2dup < if nip else drop then
Compaies T anu N, anu iemoves the smallei value fiom the stack
pieseiving the laigei as the new top of stack: max(N,T) ! T.
begin
,&G$* )00"
OQ*A%$0*+ Staits a looping constiuct; aftei ieaching the bottom of the
loop, execution will iesume with the instiuction following "begin".
Boes not change uata oi ietuin stack uepth.
!1*%.B+ A loop may take one of thiee foims:
An infinite loop consisting of "begin" followeu by zeio oi moie
woius anu completeu by "again",
A bottom-exit loop consisting of "begin" followeu by zeio oi
moie woius enuing with "until", oi
A miuule-exit loop consisting of "begin", "while", anu "iepeat",
with zeio oi moie woius between each.
Loops may be nesteu to an unspecifieu uepth.
DB.-"4&+ begin d# 1 + again
Loops foievei, auuing 1 to the top of the stack.
BRAFT uameuuino Refeience Nanual
74
Instiuction Explanation
again
F*;$*$%& )00"
OQ*A%$0*+ Retuins execution to the instiuction following the pieceuing
"begin". Any coue following "again" is nevei executeu. Boes not affect
uata oi ietuin stack uepth.
!1*%.B+ An infinite loop consists of "begin" followeu by zeio oi moie
woius anu teiminateu by "again". Loops may be nesteu to an
unspecifieu uepth: a "begin" . "again" loop may itself contain any
numbei anu types of loop constiuct.
DB.-"4&+ begin d# 1 + again
Loops foievei, auuing 1 to the top of the stack.
until
,0%%0-?DB$% )00"
OQ*A%$0*+ Completes a bottom-exit loop: pops T fiom the uata stack anu
tieats it as a Boolean flag. If false (uxuuuu), ietuins execution to the
instiuction following the pieceuing "begin". 0theiwise, continues
execution with the instiuction following "until". Reuuces uata stack
uepth by one.
!1*%.B+ A bottom-exit loop consists of "begin" followeu by zeio oi moie
woius, enuing with "until". Loops may be nesteu to an unspecifieu
uepth: a "begin" . "until" loop may itself contain any numbei anu
types of loop constiucts.
DB.-"4&+ d# 45 d# 1 begin d# 1 + 2dup= until
Count up fiom 1 to 4S by auuing one to the top of stack until the
iesulting value equals 4S.
while
/$994&?DB$% )00" DB$%
OQ*A%$0*+ Pops T fiom the uata stack anu tieats it as a Boolean flag. If
false (uxuuuu), exits the loop by ietuining execution to the
instiuction following the subsequent "iepeat". 0theiwise, execution
continues with the instiuction aftei "while". Reuuces uata stack uepth
by one.
!1*%.B+ A miuule-exit loop consists of "begin", "while", anu "iepeat", with
zeio oi moie executable instiuctions between each. Loops may be
nesteu to an unspecifieu uepth: a "begin" . "while" . "iepeat" loop
may contain any numbei anu types of loop constiucts.
DB.-"4&+ d# 0 d# 4 begin 1- 2dup= while foo repeat
Counts uown fiom 4 to u, executing the "foo" subioutine foui times.
repeat
/$994&?DB$% )00" ,0Q*9.#1
OQ*A%$0*+ Retuins execution to the instiuction following the matching
"begin".
!1*%.B+ A miuule-exit loop consists of "begin", "while", anu "iepeat", with
zeio oi moie executable instiuctions between each. Loops may be
nesteu to an unspecifieu uepth: a "begin" . "while" . "iepeat" loop
may contain any numbei anu types of loop constiucts.
DB.-"4&: d# 0 d# 4 begin 1- 2dup= while foo repeat
Counts uown fiom 4 to u, executing the "foo" subioutine foui times.
f'&;Q4 !Q3#0Q%$*&'+ The following subioutines aie useful in a wiue vaiiety of
piogiams, eithei because they uefine auuitional ANS Foith woius, oi peifoim
fiequently-useu coue sequences.
BRAFT uameuuino Refeience Nanual
7S
<<<to-uo: inseit a table of useful subioutines>>>
)*.& <"%$4$=3%$*-
Although the }1 copiocessoi only has 2S6 bytes (128 instiuctions) of piogiam
memoiy, it also has a numbei of featuies that a clevei piogiammei can use to wiite
efficient coue that occupies as little space as possible. These techniques incluue:
1. O.A%0# A0--0* A09& $*%0 'Q3#0Q%$*&'+ A }1 subioutine call is a single
instiuction, anu the ietuin is almost always fiee in teims of coue space anu
execution time, since a ietuin fiom subioutine can be coueu into any AL0
instiuction. This means that even shoit sequences of instiuctions can be maue
into subioutines to save space. Factoi out:
Sequences of 2 instiuctions that aie useu S oi moie times in youi coue, anu
Sequences of S oi moie instiuctions that aie useu at least twice in youi coue.
Foi example, if the subioutine in Sketch 6: Example Subioutine ieplaces S
instances wheie the thiee-instiuction
sequence "u# 2 * 2uup=" woulu be useu
in youi coue, the net savings is 7
instiuctions (14 bytes).
2. f'& -Q4%$"4& &*%#1 'Q3#0Q%$*&'+ The }1 assemblei allows subioutines to have
multiple entiy points. This allows the clevei piogiammei to factoi moie coue
into subioutines. Aftei factoiing iepeateu instiuction sequences into
subioutines, look foi instances wheie the same instiuction oi sequence of
instiuctions pieceues a subioutine call multiple times in youi coue. Factoi these
out into an auuitional subioutine entiy point pieceuing the oiiginal subioutine
using ;fallthiu.
Foi example, aftei factoiing youi coue
into subioutines as uesciibeu above,
you finu S instances wheie youi coue
ieaus "+ 2*2uup=", anu two othei
instances that aie unique. You can then uefine a multiple-entiy subioutine using
;fallthiou as in Sketch 7: Example Nultiple-Entiy Subioutine to save an
auuitional S instiuctions (6 bytes) - a total of 1u instiuctions (2u bytes) savings.
S. f'& -&#G&9 $*'%#QA%$0*'+ The }1 Foith instiuction set incluues two meigeu
instiuctions, 2uup= anu 2uupxoi, that meige the function of the Foith 2uup
opeiation with quality oi logical exclusive-oi (iespectively). In the }1, these
meigeu instiuctions implement common sequences of opeiations into a single
instiuction. These two instiuctions aie paiticulaily useful foi piogiamming
loops, because they leave both of theii aiguments on the stack aftei execution,
leaving the stack piopeily set up foi anothei iteiation of the loop.
: 2*2dup= d# 2 * 2dup= ;
: +2*2dup= + ;fallthru
: 2*2dup= d# 2 * 2dup= ;
!]&%A^ J+ DB.-"4& !Q3#0Q%$*&
!]&%A^ N+ DB.-"4& /Q4%$"4&?D*%#1 !Q3#0Q%$*&
BRAFT uameuuino Refeience Nanual
76
If you aie piogiamming uiiectly in }1 miciocoue iathei than assemblei, many
auuitional meigeu instiuctions aie possible by manipulating the }1 stack
pointeis: any AL0 instiuction that iemoves values fiom eithei stack can be
coueu to ietain the opeianus on the stack insteau. This effectively meiges the
instiuction with uup oi 2uup (foi one-opeianu anu two-opeianu instiuctions,
iespectively), saving instiuction space. Possible meigeu instiuctions incluue
2uup+, uup1-, 2uup<, uupu<, 2uupanu, 2uupoi, uupinveit, 2uupishift, anu
2uup*.
4. 709& %0 ;.A$4$%.%& ;#&& #&%Q#*'+ Subioutines shoulu enu with AL0 instiuctions.
AL0 instiuctions aie those in Table S4: }1 ANS Foith Instiuctions oi Table SS: }1
Auuitional Instiuctions. This allows the ietuin to be coueu uiiectly into the last
instiuction in the subioutine. If this isn't possible, enuing a subioutine with a
call to a uiffeient subioutine will allow the assemblei to ieplace the call with a
jump, also iesulting in a fiee ietuin. Avoiu enuing a subioutine with an
instiuction fiom Table SS: }1 Liteial Instiuctions, since these can't be conveiteu
into fiee ietuins.
S. f'& 0*&?$*'%#QA%$0* 4$%&#.4'+ When possible, avoiu liteial values gieatei than
ux7FFF (S2,767 uecimal). Liteials between uxuuuu anu ux7FFFF can be
assembleu into a single loau instiuction. Liteials ux8uuu (uecimal S2,768) must
be assembleu into two instiuctions, a liteial followeu by inveit.
6. 70Q*% 90H* $*'%&.9 0; Q": The }1 instiuction set incluues a single instiuction
ueciement (1-), but uoes not incluue an inciement instiuction. Inciementing a
countei typically takes two instiuctions (u# 1 +).
It often saves an instiuction to ueciement
thiough a loop woiking fiom a highei memoiy
auuiess to a lowei one oi to ueciement a loop
countei towaius zeio, iathei than inciementing
fiom lowei auuiesses to highei ones oi
inciementing a countei towaius a limit. Foi
example, Sketch 8: Inciementing Loop anu
Sketch 9: Beciementing Loop both peifoim the
same function (a logical "anu" of spiite image
memoiy with uxCF to cleai one of the sets of 4-
coloi spiite images). Bowevei, the ueciement
veision is foui bytes (two instiuctions) shoitei:
the use of the single-instiuction ueciement (1-)
insteau of the two instiuction liteial anu auu (u#
1 +) saves one, anu the elimination of the two-
instiuction liteial (ux8uuu) in favoi of a one-
instiuction value (ux7FFF) saves anothei.
h# cf >r
h# 8000 h# 4000
begin
dup c@ r@ and
over c!
d# 1 + 2dup=
until
h# cf >r
h# 3FFF h# 7FFF
begin
dup c@ r@ and
over c!
1- 2dup=
until
!]&%A^ 6+ F*A#&-&*%$*G )00"
!]&%A^ <+ R&A#&-&*%$*G )00"
BRAFT uameuuino Refeience Nanual
77
FG <$.#).)6&
The }1 machine language is poweiful, anu contains a laige numbei of instiuctions
that aie not uiiectly implementeu in the assemblei language. The haiuwaie
aichitectuie of the }1 uiffeis somewhat fiom the logical aichitectuie uesciibeu
above.
<<<to-uo: inseit uiagiam of }1 haiuwaie aichitectuie>>>
}1 miciocoue is bit-fielu coueu, as uesciibeu in the following tables. Theie aie S
oveiall types of instiuctions: liteials, conuitional anu unconuitional jumps, a
subioutine call, anu AL0 instiuctions:
)$%&#.4: Loaus a liteial value v into T, inciements the uata stack pointei, anu
copies the pievious value of T to this location as the new value of N: v ! T, T !
|++ustackj.
f*A0*9$%$0*.4 SQ-": Loaus a new value N into the piogiam countei. The olu
value is uiscaiueu, anu neithei stack is mouifieu. Because }1 instiuctions aie 16-
bit woius, N must be an even numbei.
70*9$%$0*.4 SQ-": Removes T fiom the stack by ueciementing ustack. If T=u,
jumps to N by loauing it into the piogiam countei. The olu value PC value is
uiscaiueu, anu the ietuin stack is not mouifieu. Because }1 instiuctions aie 16-
bit woius, N must be an even numbei
!Q3#0Q%$*& 7.44: Loaus a new value N into the piogiam countei. The olu value
is pusheu onto the ietuin stack, incieasing the ietuin stack uepth by one. The
uata stack is not mouifieu. Because }1 instiuctions aie 16-bit woius, N must be
an even numbei.
K)f :"&#.%$0*: AL0 opeiations aie multi-puipose instiuctions that can incluue
a ietuin fiom a subioutine, stoie the iesult of a computation onto the uata stack,
copy T into N oi R, wiite to memoiy, anu aujust the uata anu ietuin stack
pointeis - oi potentially all of these opeiations in a single instiuction.
Couing of }1 micioinstiuctions is uesciibeu in Table S9: }1 Niciocoue Instiuctions.
The bit fielus foi AL0 opeiations aie fuithei explaineu in the auuitional tables
below.
2.34& I<+ SE /$A#0A09& F*'%#QA%$0*'
Instiuction Foimat
Liteial 1 V14V13V12V11V10V09V08V07V06V05V04V03V02V01V00
0nconuitional }ump 0 0 0 0 1 1 0 0 N7 N6 N5 N4 N3 N2 N1 N0
}ump on T=u 0 0 1 0 1 1 0 0 N7 N6 N5 N4 N3 N2 N1 N0
Subioutine Call 0 1 0 0 1 1 0 0 N7 N6 N5 N4 N3 N2 N1 N0
AL0 0peiation 0 1 1 P O3 O2 O1 O0 S A W X D1 D0 R1 R0
vuu-v14: Immeuiate value to loau, uxuuuu to ux7FFF (u to S2767 uecimal).
X: 0nuseu bit, set to u foi compatibility
Nu-N7: Taiget auuiess foi jump oi call, uxuu to uxFE (u to 2S4 uecimal); must be even.
P: Pop piogiam countei fiom ietuin stack, |istack--j!PC; u=no anu 1=yes.
BRAFT uameuuino Refeience Nanual
78
:>c:@+ K)f 0"&#.%$0* %0 &B&AQ%&n '&& 2.34& J>+ K)f :"&#.%$0* 709&'`
S: Copy T!N , u=no anu 1=yes.
A: Copy T!R, u=no anu 1=yes.
W: Wiite N!|Tj, u=no anu 1=yes.
Bu-B1: Bata stack pointei (ustack) aujustment, see Table 61: Bata Stack Aujustment.
Ru-R1: Retuin stack pointei (istack) aujustment, see Table 62: Retuin Stack Aujustment.
2.34& J>+ K)f :"&#.%$0* 709&'
AL0 0utput 0u-0S
T 0x0
N 0x1
N + T 0x2
N " T
0x3
N # T
0x4
N ! T
0x5
~T 0x6
N==T 0x7
N < T 0x8
N >> T 0x9
T - 1 0xA
R 0xB
|Tj 0xC
N T 0xD
swab T 0xE
N < T 0xF
2.34& JE+ R.%. !%.A] K9oQ'%-&*%
ustack Bu-B1
No aujustment
0 0
ustack + 1
0 1
0nuefineu
1 0
ustack - 1
1 1
2.34& J5+ C&%Q#* !%.A] K9oQ'%-&*%
istack Bu-B1
No aujustment
0 0
istack + 1
0 1
istack - 2
1 0
istack - 1
1 1
<<<to-uo: bettei uesciiption of }1 miciopiogiamming!>>>
!"#$$%&'() +$,)-#$
The uameuuino haiuwaie composes each iastei line in a memoiy buffei befoie
outputting it to the scieen. The scieenshot featuie makes this buffei available at the
SCREENSB0T memoiy locations, ux2Cuu-ux2F1F (11264-12u6S uecimal) so that
the host miciocontiollei can ieau it via the SPI inteiface.
!5#&&-'0*% >$-& !&+&5% 1&2$'%&#
To captuie a iow of viueo uata, loau SCREENSB0T_Y with a value between ux8uuu
anu ux812B (uecimal S2768 anu SSu67), coiiesponuing to the flag bit F=1 anu the
Su-S8 equal to the line numbei uxuuu-ux12B (u to 299 uecimal) to be captuieu.
Wiiting a u uisables the scieenshot featuie. The low bits of the SCREENSB0T_Y
iegistei always ieflect the cuiient iastei line being geneiateu. When the flag bit of
the iegistei ieaus 1, the selecteu line of uata is available in memoiy locations
ux2Cuu-ux2F1F (11264-12u6S uecimal).
2.34& J@+ !7CDDU!Y:2LT C&G$'%&#
Symbol Auuiess Length Byte 0ffset anu Registei Contents Befault
(hex) (uec) (hex) (uec) +0 +1
BRAFT uameuuino Refeience Nanual
79
SCREENSHOT_Y RW 0x2406 10246 0x2 2 S7S6S5S4S3S2S1S0 F X X X X X X S8 0x0000
X: 0nuseu bit position, ignoieu; shoulu be u foi compatibility ieasons.
Su-S8: Rastei line to captuie, uxuuu-ux12B (u-299 uecimal).
F: Scieenshot flag, u=uisableu oi not ieauy, oi 1=enableu oi uata ieauy.
!5#&&-'0*% >$-& ?,77&#
The scieenshot line buffei, SCREENSB0T, contains coloi infoimation foi 4uu pixels
anu occupies 8uu bytes beginning at auuiess ux2Cuu (11264 uecimal). Eveiy pixel
is composeu of a 2-byte uameuuino coloi value. Because pixels output to the viueo
haiuwaie cannot be tianspaient, the alpha channel uata is always zeio.
2.34& JM+ !7CDDU!Y:2 /&-0#1 /."
Pixel Auuiess Length Byte 0ffset anu Registei Contents
(hex) (uec) (hex) (uec) +0 +1
000 R 0x2C00 11264 0x2 2 G2G1G0B4B3B2B1B0 X R4R3R2R1R0G4G3
001 R 0x2C01 11265 0x2 2 G2G1G0B4B3B2B1B0 X R4R3R2R1R0G4G3
398 R 0x2F1E 12062 0x2 2 G2G1G0B4B3B2B1B0 X R4R3R2R1R0G4G3
399 R 0x2F1F 12063 0x2 2 G2G1G0B4B3B2B1B0 X R4R3R2R1R0G4G3
X: Alpha channel coloi infoimation, always u.
R4-Ru: Reu channel coloi infoimation, u-S2.
B4-Bu: uieen channel coloi infoimation, u-S2.
B4-Bu: Blue channel coloi infoimation, u-S2.
BRAFT uameuuino Refeience Nanual
8u
!"#$$%&'
:5#*-/4'
/F!:: Nastei InSlave 0ut, the SPI line useu to senu uata fiom the uameuuino to
the host miciocontiollei. The uameuuino uses Aiuuino pin 11 foi NIS0. See
SPI.
/:!F: Nastei 0utSlave In, the SPI line useu to senu uata fiom the host
miciocontiollei to the uameuuino. Aiuuino pin 12 is N0SI on the
uameuuino boaiu. See SPI.
!7[: Seiial Clock, the SPI line useu to senu clock pulses that synchionize uata
tiansfeis. The uameuuino uses Aiuuino pin 1S foi SCK. See SPI.
!D): Select, the SPI pin useu to select the taiget uevice foi SPI communication. By
uefault, the uameuuino uses Aiuuino uigital pin 9 foi SEL. See SPI.
!=F: Seiial Peiipheial Inteiface, a synchionous seiial uata link piotocol. The SPI
inteiface uses 4 uigital lines: SEL, NIS0, N0SI, anu SCK. See NIS0, N0SI, SCK,
anu SEL.
!!: Slave select, an alteinate teim foi SEL. See SEL.
@$4&
-'n -$44$'&A0*9: 0ne thousanuth (11u
-S
) of a seconu.
p'n -$A#0'&A0*9: 0ne millionth (11u
-6
) of a seconu.
*'n *.*0'&A0*9: 0ne billionth (11u
-6
) of a seconu.
1ms = 1uuus = 1,uuu,uuuns