|
Revision 425, 390 bytes
(checked in by hodgestar, 23 months ago)
|
|
Playing around with Whitespace.
|
| Line | |
|---|
| 1 | label 1 |
|---|
| 2 | |
|---|
| 3 | # read a char and put copies on the stack |
|---|
| 4 | push 0 |
|---|
| 5 | readchar |
|---|
| 6 | push 0 |
|---|
| 7 | retrieve |
|---|
| 8 | |
|---|
| 9 | # compate to EOF and jump to end if it matches |
|---|
| 10 | dup |
|---|
| 11 | push -1 |
|---|
| 12 | sub |
|---|
| 13 | jz 5 |
|---|
| 14 | |
|---|
| 15 | # compare to \t and jump to 3 if it matches |
|---|
| 16 | dup |
|---|
| 17 | push 9 |
|---|
| 18 | sub |
|---|
| 19 | jz 3 |
|---|
| 20 | jump 2 |
|---|
| 21 | |
|---|
| 22 | # non-tab |
|---|
| 23 | label 2 |
|---|
| 24 | outchar |
|---|
| 25 | jump 4 |
|---|
| 26 | |
|---|
| 27 | # tab |
|---|
| 28 | label 3 |
|---|
| 29 | discard |
|---|
| 30 | push 32 |
|---|
| 31 | dup |
|---|
| 32 | dup |
|---|
| 33 | dup |
|---|
| 34 | outchar |
|---|
| 35 | outchar |
|---|
| 36 | outchar |
|---|
| 37 | outchar |
|---|
| 38 | jump 4 |
|---|
| 39 | |
|---|
| 40 | # goto start |
|---|
| 41 | label 4 |
|---|
| 42 | jump 1 |
|---|
| 43 | |
|---|
| 44 | # end |
|---|
| 45 | label 5 |
|---|
| 46 | exit |
|---|