File: e01-asm-comparators

package info (click to toggle)
ceccomp 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,648 kB
  • sloc: ansic: 6,531; python: 1,078; makefile: 248; sh: 145
file content (44 lines) | stat: -rw-r--r-- 1,302 bytes parent folder | download
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
Test comparators in asm
CLI
asm - -a x86_64 -f hexfmt
STDIN
if ($A == 0) goto end
if ($A == 0) goto end, else goto kill
if ($A != 0) goto end
if ($A != 0) goto end, else goto kill
if ($A > 0) goto end
if ($A > 0) goto end, else goto kill
if ($A <= 0) goto end
if ($A <= 0) goto end, else goto kill
if ($A >= 0) goto end
if ($A >= 0) goto end, else goto kill
if ($A < 0) goto end
if ($A < 0) goto end, else goto kill
if ($A & 0xff) goto end
if ($A & 0xff) goto end, else goto kill
if !($A & 0xff) goto end
if !($A & 0xff) goto end, else goto kill

return ERRNO(1) # separator
end: return ALLOW
kill: return KILL
STDOUT
"\x15\x00\x10\x00\x00\x00\x00\x00",
"\x15\x00\x0f\x10\x00\x00\x00\x00",
"\x15\x00\x00\x0e\x00\x00\x00\x00",
"\x15\x00\x0e\x0d\x00\x00\x00\x00",
"\x25\x00\x0c\x00\x00\x00\x00\x00",
"\x25\x00\x0b\x0c\x00\x00\x00\x00",
"\x25\x00\x00\x0a\x00\x00\x00\x00",
"\x25\x00\x0a\x09\x00\x00\x00\x00",
"\x35\x00\x08\x00\x00\x00\x00\x00",
"\x35\x00\x07\x08\x00\x00\x00\x00",
"\x35\x00\x00\x06\x00\x00\x00\x00",
"\x35\x00\x06\x05\x00\x00\x00\x00",
"\x45\x00\x04\x00\xff\x00\x00\x00",
"\x45\x00\x03\x04\xff\x00\x00\x00",
"\x45\x00\x00\x02\xff\x00\x00\x00",
"\x45\x00\x02\x01\xff\x00\x00\x00",
"\x06\x00\x00\x00\x01\x00\x05\x00",
"\x06\x00\x00\x00\x00\x00\xff\x7f",
"\x06\x00\x00\x00\x00\x00\x00\x00",