At the heart of
uxn isthe cpu.
It is said to be
@ beet.
>< &y=
The beet performs
operations with
instructions wriflen
in TAL.BINARY ENCODING
The seralest unit ( know are bits.
A bit can either be 0 or.
BYTE SHORT
A byle is made of Rbils. , A short is made of 2 byles.
4 bits
—s Q =0000
— @ = occ0 NT =00
Q4 | A = 0000 eAat 42238
/
High te 7 \ 4 s00e00
Nise Nipple High low
bye byte
4dits are called
( a “Nibble”. )
> BINARY To HEX CONVERSION
Who 2000
o eooa §
oo0e Ff eooe GO
ooe@o 2 soVeco g
@ ooee 3 eoee b i
© Oe0oo & eaeco ¢ °e@o6
oeoe S eeoe g
00ee0& ee5et a
e
oven F e@ooeAt the heart of The beet performs
uxn isthe cpu. operations with
It is said to be instructions written
© beet. in TAL.
>< &y= 4+ - xX 4
OPCODES Opcades are instructions
ee can perform
Each instruction is encoded
ina Single 8-bit word.
° instructionMEMORY
Zera Page
8}
MAIN MEMORY 64 cb
Eoch byte in the main memory
has an address of A6 bits.
The zero page is for data
storage daring cuntime and
can be addressed by 8 bits.
a
1fO_ MEMORY 956 bytes =”
DEVICES PORTS
Varvara takes
care of all
devices such as
screen, MOUSE,
keybard, audio,
filesystem, etc.
Each byte stores the address of a device,
Each device has AG ports.THE STACK
The stack is used fo perform
code operations,
WORKING
STACK LIT
@
pup Poe
rl ‘td «se
fy WE
Some insfructions push bytes down onto
the stack, others pop them off.
REVERSE PoliSH NOTATION
a.k.a. * postfix”
256b
A mathematical notation ia which
" operators follow heir operands.
f aohy ae
q A+U4g 442+
(3+5)/2+48 | 35+2/48+RuNES, LABELS & MACROS sr
eee
RUNES
Runes are special characters
that indicate element types of TAL
@ Macro Sublabel fa Absolute Addr.
PW posotute Pad lderal Hex BB Raw Addr
Relative Rao BR Zero Page Adds. BF Raw Char
Label Th Rieti Ade BB Rew We
LABELS
Cah
ve
Labels provide a reodable link
to devices and their ports.
MACROS
\ Custom definitions that allow
\ grouping ond re-using instructions.THE INSTRUCTION cycLe
The uxn cpa reads one byte at
a time from the main memory.
Moin Hex code for Device :
oddvece "OY Ane teller *h standard I/O
—1 1 WA
TTY yea ce aes
T
Absolute ped
‘literat" Port 8: “Device Out"
instruction byte write structionAR\THMETICS
TTI,
[kor xa4 aod Has] [«a9 #74 suB Has]
MULTIPLICATION DIVISION
[#02 #36 MUL Hoc} [ed aa DIV a9]
It's easier 4o read the
stack horizontolly.
To calculate shorts =.
ase the shodmode flog. Oo
a-p-p
SHORT MODE ADDITION
#0244 #4320 ADD2 pq1561BitwiSe SHIFTING fz
Bitwise a moves a bit
to the teft or to the right.
(IO)
SO It can be used (nthe
(nthe or divisions!
28 90 @0@000
44 00080800
DIVISION
#0028 #01 SIT2 PqOO14
MULTIPLICATION
#0014 410 SET2 P0026
144 GO0@80800
oO
28 00@0 8000
Bits con be shifted by more thon one position.Sprite ENCODING
A BIT PER PIXEL
A Abpp tile isa set of & bytes
that encode the state of its
8x pixels.
a mead Oma) Ros off (2),
ie]
5
3
Pi
SE
sto
iO}
c
(eigieicleleiele;
fe fofolofotolotel
9 [eToTofofo fools}
elolotetotstote!
fe] ofoloyofofote|
uuogouuogo
oO
ooce jototote!
TS
SPRITE DEFINITION,
@square ff21 3184 e134 aff
bates ¥ ¥ZRATS PeR PIXEL
Each pixel con nave one of four possible colors.
0/0 |alalelajals |
10 | [3{s]a]4 |
oo Lo BS pS BTS ————,
@sprite BIE WI3 6343 IFFF BdIe Fcte Fcte HADIDRAWING SPRITES
A, SETUP DEVICES
_ SYSTEM SCREEN
4 Aa { ae £2 svecer $3
Plt ig
a 4
é
pixel | 28
DEwIcES
100 @system [ éelement sbytes ...]
{20 @Screan [telement sbyles ..]
2. SET CoLoRS
couoas _
}o100 {2\[elfel{e n
tee? Seronle | Teli] 2 >)
494cQ .System/g 298
42ceS .System/b3, SET COORDINATES
COORDINATES
#QQ0B .Scvreen/x DEOD
#BBOR .Screen/y DEOL
4.SET ADDRESS
ADDRESS.
[ jsprite Screenfaddr DEOL
5. DRAW THE SPRITE!
Bane eae Dy
Depending on wether you're | 4
drawing bpp or 2bpp sprites \)
ae i.
the high and the Low nibble
encode colors , layers, flipping
and display modes.(NPUT
CONTROLER DEVICE setuP
fiza @Controller [avector $2 ebulion $4 they 43]
BVITONS fi
PW Select / Shift
eH Start |Home
The controller vector jemps to the
ion-controller Label address ofa
key pressed or released event.
USTENING Yo KEY EVENTS
[ ion- controller .Controller/vector DEOL |
KEYS The key byte stores the ascii code of the
~ keyboard key +nat is being pressed.
55 58 4eCOMPARISON
Fav a==-b \ push 04. in the
NEQ alzb Stack when the
condition is true.
GTH a>b Otherwise | push
Lid a