-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathif.yml
67 lines (65 loc) · 2.52 KB
/
if.yml
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
in_source: |
(print (if (print (readline)) (readline) (readline)))
in_stdin: |
abc
def
out_stdout: |
abcdef
out_debug: |-
##### Data memory #####
<address> <length> <data>
##### Instruction memory #####
<address> <hexcode> <mnemonica>
#:
0x00000000 0x0c200025 br *0x25 ('start' function)
print:
0x00000001 0x06000000 push
0x00000002 0x02100000 ld #0x0
0x00000003 0x06000000 push
0x00000004 0x02500001 ld **spr+0x1
0x00000005 0x09100000 cmp #0x0
0x00000006 0x0a300008 bre *ipr+0x8
0x00000007 0x032015b4 st *0x15b4
0x00000008 0x0d400001 inc *spr+0x1
0x00000009 0x0d400000 inc *spr
0x0000000a 0x02400000 ld *spr
0x0000000b 0x09100080 cmp #0x80
0x0000000c 0x0a300002 bre *ipr+0x2
0x0000000d 0x0c3ffff7 br *ipr-0x9
0x0000000e 0x07000000 pop
0x0000000f 0x08000000 popn
0x00000010 0x05000000 ret
readline:
0x00000011 0x06000000 push
0x00000012 0x06000000 push
0x00000013 0x02100000 ld #0x0
0x00000014 0x06000000 push
0x00000015 0x022015b3 ld *0x15b3
0x00000016 0x0910000a cmp #0xa
0x00000017 0x0a300008 bre *ipr+0x8
0x00000018 0x03500001 st **spr+0x1
0x00000019 0x0d400001 inc *spr+0x1
0x0000001a 0x0d400000 inc *spr
0x0000001b 0x02400000 ld *spr
0x0000001c 0x09100080 cmp #0x80
0x0000001d 0x0a300002 bre *ipr+0x2
0x0000001e 0x0c3ffff7 br *ipr-0x9
0x0000001f 0x02100000 ld #0x0
0x00000020 0x03500001 st **spr+0x1
0x00000021 0x07000000 pop
0x00000022 0x07000000 pop
0x00000023 0x07000000 pop
0x00000024 0x05000000 ret
start:
0x00000025 0x02100000 ld #0x0 ('anon$0' const)
0x00000026 0x04200011 call *0x11 ('readline' function)
0x00000027 0x04200001 call *0x1 ('print' function)
0x00000028 0x09100000 cmp #0x0
0x00000029 0x0a300004 bre *ipr+0x4
0x0000002a 0x02100081 ld #0x81 ('anon$1' const)
0x0000002b 0x04200011 call *0x11 ('readline' function)
0x0000002c 0x0c300003 br *ipr+0x3
0x0000002d 0x02100102 ld #0x102 ('anon$2' const)
0x0000002e 0x04200011 call *0x11 ('readline' function)
0x0000002f 0x04200001 call *0x1 ('print' function)
0x00000030 0x01000000 halt