Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[bf] fix after ops massacre

  • Loading branch information...
commit a1bd98074fec54e3075efa9759b57d74a03ad11d 1 parent 585a75b
@fperrad fperrad authored
Showing with 10 additions and 1 deletion.
  1. +2 −0  bf.pasm
  2. +3 −0  bfc.pir
  3. +3 −1 bfco.pir
  4. +2 −0  t/test_bfco.t
View
2  bf.pasm
@@ -5,6 +5,8 @@
# See http://www.catseye.mb.ca/esoteric/bf/
# for more information on this silly language
+.loadlib 'io_ops'
+
get_params '0', P5 # P5 = @ARGV
# Get the brainfuck source file into S0
set S0, P5[1]
View
3  bfc.pir
@@ -4,6 +4,9 @@
#
# See http://www.catseye.mb.ca/esoteric/bf/
# for more information on this silly language
+
+.loadlib 'io_ops'
+
.sub _main
.param pmc argv
.local int pc
View
4 bfco.pir
@@ -7,6 +7,8 @@
# XXX does no register range checking
# it runs the bench.bf 15 times faster then bfc.imc
+.loadlib 'io_ops'
+
.macro debug()
concat code, "# depth "
$S0 = depth
@@ -62,6 +64,7 @@ SOURCE_LOOP:
# Initialise
code = "# Code generated by bfco.pir\n"
+ concat code, ".loadlib 'io_ops'\n"
# concat code, "trace 1\n"
concat code, "new P0, 'ResizableIntegerArray' # memory\n"
# this array doesn't support negative indices properly
@@ -74,7 +77,6 @@ SOURCE_LOOP:
label = 0 # label count
.local int depth, n_lt, n_gt, reg
reg = 0
- concat code, " cleari\n"
# The main compiler loop
INTERP:
View
2  t/test_bfco.t
@@ -3,6 +3,8 @@
# Test bf interpreter
# Print TAP, Test Anything Protocol
+.loadlib 'sys_ops'
+
.sub 'main' :main
$S0 = 'parrot -r bfco.pbc test.bf'
$I0 = spawnw $S0
Please sign in to comment.
Something went wrong with that request. Please try again.