-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinput.s
More file actions
61 lines (56 loc) · 662 Bytes
/
input.s
File metadata and controls
61 lines (56 loc) · 662 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Input
verb forth TIB
scratch 256 #80
endword
verb forth numtib "\#TIB"
variable
endword
verb forth numin "\#IN"
variable
endword
verb code ACCEPT
minstk 2
mov $0, CMD
mov $0, ARGA
mov (SP), ARGB
mov TOS, ARGC
syscall
mov CMD, (SP)
jmp _drop
verb forth WORD
do pushret
do HERE
const 0
do OVER
do store
const 8
do plus
1: get numin
get numtib
do gequal
if 3f
do TIB
get numin
do plus
do fetchb
do numin
do incaddr
do DUP
const ' '
do less
do OVER
do peekret
do equal
do OR
if 2f
do HERE
do incaddr
do OVER
do storeb
do inc
goto 1b
2: do DROP
3: do popret
do drop2
do HERE
endword