perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r35067 - trunk/languages/befunge

Subject: [svn:parrot] r35067 - trunk/languages/befunge
From:
Date: Tue, 6 Jan 2009 10:50:49 -0800 PST
Newsgroups: perl.cvs.parrot

Author: jquelin
Date: Tue Jan  6 10:50:48 2009
New Revision: 35067

Modified:
   trunk/languages/befunge/befunge.pir

Log:
fetching current instruction character


Modified: trunk/languages/befunge/befunge.pir
==============================================================================
--- trunk/languages/befunge/befunge.pir (original)
+++ trunk/languages/befunge/befunge.pir Tue Jan  6 10:50:48 2009
@@ -24,7 +24,7 @@
     # parsing argv
     .local int debug
     .local pmc playfield
-    (debug, playfield) = _parse_argv(argv)
+    (playfield,debug) = _parse_argv(argv)
 
     # various inits
     .local int x, y, dir, flag
@@ -53,15 +53,20 @@
         # I4 = flag (1=string-mode,2=bridge,3=end)
         # N0 = random seed
         # S2 = user input
+        # S0 = current instruction
+
+    .local int    val
+    .local string char
+  TICK:
+    val  = playfield[y;x]
+    char = chr val
+    if debug == 0 goto TICK_NODEBUG
+    #bsr DEBUG_CHECK_BREAKPOINT
+  TICK_NODEBUG:
 
 =pod
 
-TICK:
-        set I20, P1[I1;I0]
-        chr S0, I20             # S0 = current instruction
-        eq I5, 0, TICK_NODEBUG
-        bsr DEBUG_CHECK_BREAKPOINT
-TICK_NODEBUG:
+
         eq S0, "\"", FLOW_TOGGLE_STRING_MODE
         eq I4, 1, IO_PUSH_CHAR
         eq I4, 2, MAIN_TRAMPOLINE

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r35067 - trunk/languages/befunge, jquelin <=