[gforth] / gforth / Attic / tools.fs  

gforth: gforth/Attic/tools.fs


1 : anton 1.1 \ TOOLS.FS Toolkit extentions 2may93jaw
2 :    
3 :     \ May be cross-compiled
4 :    
5 :     hex
6 :    
7 :     \ .S CORE / CORE EXT 9may93jaw
8 :    
9 :     : .s ( -- )
10 :     \ depth 0= IF ." <empty> " THEN
11 :     depth 0 ?DO I pick . LOOP ;
12 :    
13 :     \ DUMP 2may93jaw - 9may93jaw 06jul93py
14 :     \ looks very nice, I know
15 :    
16 :     : .4 ( addr -- addr' )
17 :     3 FOR dup c@ 0 <# # # #> type space char+ NEXT ;
18 :     : .chars ( addr -- )
19 :     10 bounds DO I c@ dup 7f bl within
20 :     IF drop [char] . THEN emit LOOP ;
21 :    
22 :     : .line ( addr -- )
23 :     dup .4 space .4 ." - " .4 space .4 drop space .chars ;
24 :    
25 :     : dump ( addr u -- )
26 :     cr base @ >r hex \ save base on return stack
27 :     $F + $10 / \ calc number of lines
28 :     0 ?DO dup 8 u.r ." : " dup .line 10 + cr LOOP
29 :     drop r> base ! ;
30 :    
31 :     \ ? 17may93jaw
32 :    
33 :     : ? @ . ;
34 :    
35 :     \ INCLUDE see.fs
36 :    

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help