(brainfuck.tal) Replaced byte program with characters

This commit is contained in:
Devine Lu Linvega 2021-11-13 10:50:21 -05:00
parent cd427e5e56
commit 7d74fa95f0
1 changed files with 11 additions and 29 deletions

View File

@ -40,27 +40,13 @@ BRK
@op ( op -- ) @op ( op -- )
LIT '> !~ ,&right JCN LIT '> !~ ,&movr JCN [ .pointer LDZ2k INC2 ROT STZ2 POP RTN ] &movr
.pointer LDZ2k INC2 ROT STZ2 LIT '< !~ ,&movl JCN [ .pointer LDZ2k DEC2 ROT STZ2 POP RTN ] &movl
POP RTN &right LIT '+ !~ ,&incr JCN [ .pointer LDZ2 STH2k LDA INC STH2r STA POP RTN ] &incr
LIT '< !~ ,&left JCN LIT '- !~ ,&decr JCN [ .pointer LDZ2 STH2k LDA DEC STH2r STA POP RTN ] &decr
.pointer LDZ2k DEC2 ROT STZ2 LIT '. !~ ,&emit JCN [ .pointer LDZ2 LDA EMIT POP RTN ] &emit
POP RTN &left LIT '[ !~ ,&next JCN [ POP ,goto-next JSR RTN ] &next
LIT '+ !~ ,&inc JCN LIT '] !~ ,&prev JCN [ POP ,goto-back JSR RTN ] &prev
.pointer LDZ2 STH2k LDA INC STH2r STA
POP RTN &inc
LIT '- !~ ,&dec JCN
.pointer LDZ2 STH2k LDA DEC STH2r STA
POP RTN &dec
LIT '. !~ ,&emit JCN
.pointer LDZ2 LDA EMIT
POP RTN &emit
LIT '[ !~ ,&next JCN
POP ,goto-next JSR
RTN &next
LIT '] !~ ,&prev JCN
POP ,goto-back JSR
RTN &prev
POP POP
RTN RTN
@ -107,11 +93,7 @@ RTN
@program ( Hello World! ) @program ( Hello World! )
2b 2b 2b 2b 2b 2b 2b 2b 5b 3e 2b 2b 2b 2b 5b 3e "++++++++[>++++[>++>+++>+++>+<<<<
2b 2b 3e 2b 2b 2b 3e 2b 2b 2b 3e 2b 3c 3c 3c 3c "-]>+>+>->>+[<]<-]>>.>---.+++++++
2d 5d 3e 2b 3e 2b 3e 2d 3e 3e 2b 5b 3c 5d 3c 2d "..+++.>>.<-.<.+++.------.-------
5d 3e 3e 2e 3e 2d 2d 2d 2e 2b 2b 2b 2b 2b 2b 2b "-.>>+.>++.
2e 2e 2b 2b 2b 2e 3e 3e 2e 3c 2d 2e 3c 2e 2b 2b
2b 2e 2d 2d 2d 2d 2d 2d 2e 2d 2d 2d 2d 2d 2d 2d
2d 2e 3e 3e 2b 2e 3e 2b 2b 2e 0a