Overview
| SHA1 Hash: | 04301827ca074edd92c4edbd3dc012041224cf16 |
|---|---|
| Date: | 2011-10-26 17:36:27 |
| User: | crc |
| Comment: | autopsy: more refactorings |
| Timelines: | family | ancestors | descendants | both | trunk |
| Other Links: | files | manifest |
Tags And Properties
- branch=trunk inherited from [dc67bca1f3]
- sym-trunk inherited from [dc67bca1f3]
Changes
[hide diffs]
[patch]Modified autopsy.rx from [4dfbbdb703574f38] to [67c4bc45a69f2486].
@@ -285,28 +285,34 @@
: process
@ip >image @ dup 0 30 within
[ 1 over counts + +! opcodes + @ do ]
[ calls ++ @ip >rs 1- !ip ] if ;
- : --- ( - )
+ : --- ( - )
24 [ '- putc ] times cr ;
: display ( q- )
cr --- do --- ;
- : registers ( - )
+ : registers ( - )
depth size @ip "IP: %d RSP: %d SP: %d" puts .s cr ;
- : instruction ( - )
+ : instruction ( - )
@ip decompile drop ;
+
+ : atEndOfMemory? ( -f )
+ @ip 32768 > ;
+
+ : atEndOfFunction? ( -f )
+ size 0 < ;
variable (steps)
---reveal---
- : step ( - )
- @ip 32768 < 0; drop
+ : step ( - )
+ atEndOfMemory? if;
(steps) ++
- size 0 >= 0; drop
+ atEndOfFunction? if;
[ registers instruction ] display
process ip ++ ;
: steps ( n- )
&step times ;