[svn:parrot] r47327 - trunk/examples/pir/befunge

fperrad at svn.parrot.org fperrad at svn.parrot.org
Thu Jun 3 08:53:49 UTC 2010


Author: fperrad
Date: Thu Jun  3 08:53:49 2010
New Revision: 47327
URL: https://trac.parrot.org/parrot/changeset/47327

Log:
[befunge] remove opcodes getstdin/getstdout

Modified:
   trunk/examples/pir/befunge/befunge.pir
   trunk/examples/pir/befunge/debug.pir
   trunk/examples/pir/befunge/io.pir

Modified: trunk/examples/pir/befunge/befunge.pir
==============================================================================
--- trunk/examples/pir/befunge/befunge.pir	Thu Jun  3 08:45:54 2010	(r47326)
+++ trunk/examples/pir/befunge/befunge.pir	Thu Jun  3 08:53:49 2010	(r47327)
@@ -3,6 +3,7 @@
 
 .loadlib 'io_ops'
 
+.include "stdio.pasm"
 .include "debug.pir"
 .include "flow.pir"
 .include "io.pir"
@@ -17,7 +18,8 @@
 
     # disable buffering on stdout
     .local pmc stdout
-    getstdout stdout
+    $P0 = getinterp
+    stdout = $P0.'stdhandle'(.PIO_STDOUT_FILENO)
     stdout.'buffer_type'("unbuffered")
 
     # parsing argv

Modified: trunk/examples/pir/befunge/debug.pir
==============================================================================
--- trunk/examples/pir/befunge/debug.pir	Thu Jun  3 08:45:54 2010	(r47326)
+++ trunk/examples/pir/befunge/debug.pir	Thu Jun  3 08:53:49 2010	(r47327)
@@ -179,8 +179,9 @@
     _debug__print_status()
 
     print "bef> "
-    $P0 = getstdin
-    $S0 = readline $P0
+    $P0 = getinterp
+    $P0 = $P0.'stdhandle'(.PIO_STDIN_FILENO)
+    $S0 = $P0.'readline'()
     $S0 = chopn $S0, 1
     $I0 = length $S0
 

Modified: trunk/examples/pir/befunge/io.pir
==============================================================================
--- trunk/examples/pir/befunge/io.pir	Thu Jun  3 08:45:54 2010	(r47326)
+++ trunk/examples/pir/befunge/io.pir	Thu Jun  3 08:53:49 2010	(r47327)
@@ -39,8 +39,9 @@
     $I0 = length $S0
     if $I0 > 0 goto _IO__INPUT_CHAR__SUBSTR
 
-    $P1 = getstdin
-    $S0 = readline $P1
+    $P1 = getinterp
+    $P1 = $P1.'stdhandle'(.PIO_STDIN_FILENO)
+    $S0 = $P1.'readline'()
     $S0 = chopn $S0, 1
 
   _IO__INPUT_CHAR__SUBSTR:
@@ -71,8 +72,9 @@
     len = length $S0
     if len > 0 goto _IO__INPUT_INT__PARSE_INPUT
 
-    $P1 = getstdin
-    $S0 = readline $P1
+    $P1 = getinterp
+    $P1 = $P1.'stdhandle'(.PIO_STDIN_FILENO)
+    $S0 = $P1.'readline'()
     $S0 = chopn $S0, 1
     len = length $S0
 


More information about the parrot-commits mailing list