Fixed bug where comments were not properly ignored

This commit is contained in:
Sasha Koshka
2022-10-27 22:51:04 -04:00
parent d648660889
commit 2a53da6f95
5 changed files with 55 additions and 57 deletions

View File

@@ -1,43 +1,5 @@
org 100
one, hex 1
newline, hex 0A
exclamation, chr !
questionCounter, adr question
question, chr W
chr h
chr a
chr t
hex 20
chr i
chr s
hex 20
chr y
chr o
chr u
chr r
hex 20
chr n
chr a
chr m
chr e
chr ?
hex 0A
hex 00
greetingCounter, adr greeting
greeting, chr H
chr e
chr l
chr l
chr o
chr ,
hex 20
hex 00
responseCounter, hex 0
// ask the user their name
askLoopStart, loadi questionCounter
skipcond 800
@@ -89,3 +51,41 @@ responseCounter, hex 0
playbackLoopEnd, clear
halt
one, hex 1
newline, hex 0A
exclamation, chr !
questionCounter, adr question
question, chr W
chr h
chr a
chr t
hex 20
chr i
chr s
hex 20
chr y
chr o
chr u
chr r
hex 20
chr n
chr a
chr m
chr e
chr ?
hex 0A
hex 00
greetingCounter, adr greeting
greeting, chr H
chr e
chr l
chr l
chr o
chr ,
hex 20
hex 00
responseCounter, hex 0

BIN
examples/hellorld Normal file

Binary file not shown.

View File

@@ -1,3 +1,15 @@
// if the current character is zero, halt
loopStart, loadi counter
skipcond 800
halt
// otherwise, output it, increment, and loop
output
load counter
add one
store counter
jump loopStart
counter, adr string
one, dec 1
@@ -11,15 +23,3 @@ string, chr h
chr d
hex a
hex 0
// if the current character is zero, halt
loopStart, loadi counter
skipcond 800
halt
// otherwise, output it, increment, and loop
output
load counter
add one
store counter
jump loopStart