root/hodgestar/WhitespaceCode/tabs2spaces/tabs2spaces.wsa @ 425

Revision 425, 390 bytes (checked in by hodgestar, 23 months ago)

Playing around with Whitespace.

Line 
1label 1
2
3# read a char and put copies on the stack
4push 0
5readchar
6push 0
7retrieve
8
9# compate to EOF and jump to end if it matches
10dup
11push -1
12sub
13jz 5
14
15# compare to \t and jump to 3 if it matches
16dup
17push 9
18sub
19jz 3
20jump 2
21
22# non-tab
23label 2
24outchar
25jump 4
26
27# tab
28label 3
29discard
30push 32
31dup
32dup
33dup
34outchar
35outchar
36outchar
37outchar
38jump 4
39
40# goto start
41label 4
42jump 1
43
44# end
45label 5
46exit
Note: See TracBrowser for help on using the browser.