initial commit
[fifth.git] / imageFile / f / lib / 5TH_UICMD
1 : words\r
2 cr lp @\r
3 max do\r
4 118 do\r
5         dup 0 = if pop pop 2drop drop ret then\r
6         colnorm\r
7         dup 13 + c@\r
8         dup 2 = if colhigh then\r
9         0 = if colneg then\r
10         dup 4 + write colnorm\r
11         curx @ 10 mod 10 swap - do space loop\r
12         @\r
13 loop\r
14 cr 50 do asc = emit loop KBD_FW@ drop\r
15 loop ;\r
16 \r
17 : statinc\r
18 inccur @ dup ." depth: " d. cr\r
19 ." <handle> <size> <current offset>" cr\r
20 incfiles swap 1+ do\r
21         dup @ dup d. space dyns d. space 4 + dup @ d. 4 + cr\r
22 loop drop ;\r
23 \r
24 : (cmdline\r
25 \ colhigh\r
26 200 dynal\r
27 0\r
28 cr\r
29 until\r
30         KBD_FW@ ( handle addr key )\r
31         push\r
32         0 swap 200 bound\r
33         over dynp over + i swap c!      ( handle addr )\r
34         1+\r
35         i FC = if 2 - FC emit space then\r
36         pop dup FE - if                 ( handle addr )\r
37                 emit\r
38         else\r
39                 drop space\r
40                 over dynresize  ( handle )\r
41                 dyninc\r
42                 done\r
43         then\r
44 loop \ colnorm\r
45 ;\r
46 \r
47 ' (cmdline ' cmdline is\r
48 \r
49 : ascii\r
50 until KBD_FW@ dup 1B = if done then\r
51 dup emit space d. space loop ;\r
52 \r
53 : fs. ( fname -- ) fsDloadnew dup dyn. dynde ;\r
54 \r
55 : fsdisp ( fname -- )\r
56 screen cls 0 0 at! fs. cr\r
57 ." press any key to continue ..."\r
58 KBD_FW@ drop ;\r
59 \r
60 create tmpbuf 100 alloc\r
61 : s.\r
62 depth 2 - push\r
63 ." depth: " i . cr\r
64 1 i 400 bound? if\r
65         i do\r
66                 i 4 * tmpbuf + !\r
67         loop\r
68         0 i for\r
69                 i 4 * tmpbuf + @ dup . tab.\r
70         loop\r
71 then pop drop ; rh tmpbuf\r
72 \r
73 : bye 2dup push push    \ R: n1 n2\r
74 i2 3 = if\r
75         i FE = if halt then\r
76 then\r
77 ." unbalanced stack: " swap . space . KBD_FW@ halt ;\r