summary refs log tree commit diff stats
path: root/test
ModeNameSize
-rw-r--r--__init__.py557log stats plain blame
-rw-r--r--tc_bookmarks.py1399log stats plain blame
-rw-r--r--tc_colorscheme.py883log stats plain blame
-rw-r--r--tc_directory.py3133log stats plain blame
-rw-r--r--tc_displayable.py3188log stats plain blame
-rw-r--r--tc_history.py989log stats plain blame
-rw-r--r--tc_keyapi.py519log stats plain blame
-rw-r--r--tc_ui.py1016log stats plain blame
-rw-r--r--test.py164log stats plain blame
d---------testdir153log stats plain
{ color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# Example showing arg order on the stack.
#
# Show difference between ascii codes of first letter of first arg and first
# letter of second arg.
#
# To run:
#   $ ./subx translate init.linux examples/ex9.subx -o examples/ex9
#   $ ./subx run examples/ex9 z x
# Expected result:
#   $ echo $?
#   2
#
# At the start of a SubX program:
#   argc: *esp
#   argv[0]: *(esp+4)
#   argv[1]: *(esp+8)
#   ...
# Locals start from esp-4 downwards.

== code
#   instruction                     effective address                                                   register    displacement    immediate
# . op          subop               mod             rm32          base        index         scale       r32
# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

Entry:
    # . prologue
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # ascii-difference(argv[1], argv[2])
    # . . push argv[2]
    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
    # . . push argv[1]
    ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
    # . . call
    e8/call  ascii-difference/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # exit(eax)
    89/copy                         3/mod/direct    3/rm32/ebx    .           .             .           0/r32/eax   .               .                 # copy eax to ebx
    e8/call  syscall_exit/disp32

ascii-difference:  # (s1, s2): null-terminated ascii strings
    # a = first letter of s1 (ecx)
    8b/copy                         1/mod/*+disp8   4/rm32/sib    4/base/esp  4/index/none              0/r32/eax   4/disp8         .                 # copy *(esp+4) to eax
    8b/copy                         0/mod/indirect  0/rm32/eax    .           .             .           0/r32/eax   .               .                 # copy *eax to eax
    # b = first letter of s2 (edx)
    8b/copy                         1/mod/*+disp8   4/rm32/sib    4/base/esp  4/index/none              1/r32/ecx   8/disp8                           # copy *(esp+8) to ecx
    8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           1/r32/ecx   .               .                 # copy *ecx to ecx
    # a-b
    29/subtract                     3/mod/direct    0/rm32/eax    .           .             .           1/r32/ecx   .               .                 # subtract ecx from eax
    c3/return

# . . vim:nowrap:textwidth=0
26 01:19:47 -0800 committer Kartik Agaram <vc@akkartik.com> 2018-11-26 01:19:47 -0800 4782' href='/akkartik/mu/commit/html/subx/054string_equal.subx.html?h=hlt&id=d1c9392a5461e0d33e226375a8f7986a97d2d66b'>d1c9392a ^
c56d803c ^
14a38052 ^


ebd35521 ^
ac07e589 ^
14a38052 ^

6e181e7f ^
96a6bac5 ^



















14a38052 ^
ac07e589 ^
14a38052 ^
ac07e589 ^
c98d4b1c ^

ac07e589 ^
c98d4b1c ^
ac07e589 ^
6e181e7f ^

14a38052 ^





6e181e7f ^
c98d4b1c ^
ac07e589 ^
6e181e7f ^
14a38052 ^

ac07e589 ^
14a38052 ^
ac07e589 ^
6e181e7f ^
14a38052 ^




6e181e7f ^

14a38052 ^

6e181e7f ^

14a38052 ^

6e181e7f ^
14a38052 ^





ac07e589 ^
14a38052 ^




901ae474 ^
6e181e7f ^
14a38052 ^



6e181e7f ^
14a38052 ^
ac07e589 ^
14a38052 ^

c6f52200 ^
14a38052 ^


ac07e589 ^
14a38052 ^
ac07e589 ^
14a38052 ^

901ae474 ^
6e181e7f ^
14a38052 ^
c6f52200 ^
14a38052 ^

6e181e7f ^
14a38052 ^
ac07e589 ^
14a38052 ^

c6f52200 ^
14a38052 ^


ac07e589 ^
14a38052 ^
ac07e589 ^
14a38052 ^

901ae474 ^
6e181e7f ^
14a38052 ^
c6f52200 ^

14a38052 ^
6e181e7f ^
14a38052 ^
ac07e589 ^
14a38052 ^

c6f52200 ^
14a38052 ^


ac07e589 ^
14a38052 ^
ac07e589 ^
14a38052 ^

901ae474 ^
6e181e7f ^
14a38052 ^
c6f52200 ^

14a38052 ^
6e181e7f ^
14a38052 ^
ac07e589 ^
14a38052 ^

c6f52200 ^
14a38052 ^


ac07e589 ^
14a38052 ^
ac07e589 ^
14a38052 ^


104e521c ^



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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235