Skip to content

Commit

Permalink
remove opcodes getstdin/getsdout/getstderr
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Jun 3, 2010
1 parent 25498b0 commit b22731f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/builtins/globals.pir
Expand Up @@ -8,6 +8,8 @@ src/builtins/globals.pir - initialize miscellaneous global variables

.namespace []

.include 'stdio.pasm'

.sub 'onload' :anon :load :init
.local pmc cardinalmeta
cardinalmeta = get_hll_global ['CardinalObject'], '!CARDINALMETA'
Expand Down Expand Up @@ -39,14 +41,17 @@ src/builtins/globals.pir - initialize miscellaneous global variables
$P4 = get_hll_global ['NilClass'], '!CARDINALMETA'
set_hll_global '$\', $P4
#getstdin $P5
.local pmc interp
interp = getinterp
#$P5 = interp.'stdhandle'(.PIO_STDIN_FILENO)
#set_hll_global '$stdin', $P5
#set_hll_global '$>', $P5
getstdout $P6
$P6 = interp.'stdhandle'(.PIO_STDOUT_FILENO)
set_hll_global '$stdout', $P6
#getstderr $P7
#$P7 = interp.'stdhandle'(.PIO_STDERR_FILENO)
#set_hll_global 'stderr', $P7
$P2 = new 'CardinalString'
Expand Down
5 changes: 4 additions & 1 deletion src/builtins/say.pir
Expand Up @@ -34,9 +34,12 @@ builtin functions for Ruby.
.tailcall 'print'($S0, "\n")
.end

.include 'stdio.pasm'

.sub 'readline'
#.param pmc sep :optional #record sep
$P0 = getstdin
$P0 = getinterp
$P0 = $P0.'stdhandle'(.PIO_STDIN_FILENO)
$S0 = $P0.'readline'('')
.return($S0)
.end
Expand Down

0 comments on commit b22731f

Please sign in to comment.