Trevor Merritt e29ac45c84 scroll down works on CHIP-8 and High-Res modes
scroll left and right work in stdef and hidef
adds octo test roms
adds schip fonts to memory
2024-10-27 11:41:25 -04:00

73 lines
795 B
Plaintext

###########################################
#
# Branch Test
#
# Tests the if...begin...else...then
# control structure.
# Should print "51368"
#
###########################################
: main
# simple taken branch
v0 := 1
v1 := 3
if v1 == 3 begin
v0 := 2
v0 += 3
end
print0
# simple not taken branch
v0 := 1
v1 := 3
if v1 != 3 begin
v0 := 2
v0 += 3
end
print0
# else taken
v0 := 2
v1 := 3
if v1 != v0 begin
v0 := 1
v0 += 2
else
v0 := 2
v0 += 4
end
print0
# else not taken
v0 := 2
v1 := 3
if v1 < v0 begin
v0 := 1
v0 += 2
else
v0 := 2
v0 += 4
end
print0
# nesting
v0 := 1
if v0 != 0 begin
if v0 != 2 begin
v0 := 7
else
v0 := 3
end
v0 += 1
end
print0
loop again
: print0
i := hex v0
sprite va vb 5
va += 5
;