summaryrefslogtreecommitdiff
path: root/demo/test-1.hex
blob: e7f7c6e8d9d835954544228be60f3ccae3fe8aa1 (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
; Function header (3 args, 3 variables)
00 03 00 03

; Store the listing
10 BE 91  D8 8A 21 02 8B 53 C2 01 2B   D7 8A 21 01 8B 52 C2 C8
13 80

; Store the min price
10 0F
13 81

; Store the best offer
10 0F
13 82

; Iterate the offers
19 80

; offersloop: (34)
03                           ; DUP2
38 F7                        ; IFGE2 end
1B 80                        ; STEPIN 1

; structloop: (39)
03                           ; DUP2
38 D1                        ; IFGE2 missingprice
1E 80                        ; SFIELD 1
10 71 0B                     ; PUSH price
36 B3                        ; IFEQ2 endstructloop
1A 80                        ; NEXT 1
01 A5                        ; JMP structloop

; endstructloop: (53)
1D 80                        ; LOADVALUE 1

12 81                        ; LOAD 2
10 0F                        ; PUSH null
36 C1                        ; IFEQ2 saveprice

12 81                        ; LOAD 2
3B CE                        ; IFLT2 skipoffer

; saveprice: (65)
1D 80                        ; SVALUE 1            ; Save the lowest price in var2.
13 81                        ; STORE 2
1C                           ; STEPOUT
1D 80                        ; VALUE 1             ; Save the whole struct in var3.
13 82                        ; STORE 3
1A 80                        ; NEXT 1
01 A0                        ; JMP offersloop

; skipoffer: (78)
1C                           ; STEPOUT
1A 80                        ; NEXT 1
01 A0                        ; JMP offersloop

; missingprice: (83)
10 8E 9F 65 72 72 6F 72 3A 20 6D 69 73 73 69 6E 67 20 70 72 69 63 65 20 69 6E 20 6C 69 73 74 69 6E 67   ; PUSH "error: missing price in listing"
13 82                        ; STORE 3

; end: (119)
11
11
11