tmcpu_isa_assembler/hello_world.asm

42 lines
581 B
NASM

nop
nop
ldi ra, 0x01
ldi rb, 0x02
add rc, ra rb ; should be 3
out 0x02, rc ; displays 03 on the numeric display
ldi ra, 0b10100000 ; load the num for red and blue into ra
mrm 0x001, ra
mrm 0x003, ra
mrm 0x01e, ra
mrm 0x02e, ra
mrm 0x02f, ra
mrm 0x030, ra
mrm 0x031, ra
mrm 0x023, ra
; Draw a smiley face
; Test the normalizer
ldi ra, 0b10100101
lsh rb, ra
; Expands to:
; add rb, ra ra
cmp ra rb
; Expands to:
; sub ra, ra rb
cpy rc, rb
; Expands to:
; ldi r0, 0
; add rc, rb r0
not rd, rc
; Expands to:
; ldi r0, 0
; nor rd, rc r0
; test validation
in ra, 0x02
out 0x03, rb