aboutsummaryrefslogtreecommitdiff
path: root/ia32/macro.sts
blob: 9335176f80206d320f84433cd6eb0dd11a35cd61 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[ next 0
    # ad ?' # ff ?' # 20 ?'
]

[ defasm 1
    [ %1% 0
        _%0% ?.
    \]
    ?$ ?? _%1%
    ?$ # 4 ?+ ?.
]

[ defword 1
    [ %1% 0
        _%0% ?.
    \]
    ?$ ?? _%1%
    _docol # 4 ?+ ?.
]

[ defconst 2
    defasm %1%
    # 68 ?' # %2% ?.                      ; push %2%
    next
]

[ defarr 2
    _data_segment ?choose
    ?$ ?? _%1%_arr
    # %2% # 4 ?* ?res
    _code_segment ?choose
    defasm %1%
    # 68 ?' _%1%_arr ?.                 ; push _%1%_arr
    next
]

[ defvar 1
    defarr %1% 1
]

[ as 1
    _data_segment ?choose
        defword %1%
            lit ?$ # 0 ?.
        exit
    _code_segment ?choose
    lit ?. !
]

[ local 1
    top as %1%
]

[ literal 0
    lit # %1% ?.
]

[ set_entry 0
    ?$ _threaded_code_entry ?!
]

[ if 0
    0branch ?$ # 0 ?.
]

[ fi 0
    ?$ ?swap ?!
]

[ else 0
    branch ?$ # 0 ?.
    ?swap ?$ ?swap ?!
]

[ do 0
    ?$
]

[ untilod 0
    0branch ?.
]

[ until 0
    0 = 0branch ?$ # 0 ?.
]

[ od 0
    branch ?swap ?.
    ?$ ?swap ?!
]

[ change 0
    dup get
    swap 2 get swap 2 + set
    swap drop
]