2 data: (handle array int)
6 fn initialize-int-stack _self: (addr int-stack), n: int {
7 var self/esi: (addr int-stack) <- copy _self
8 var d/edi: (addr handle array int) <- get self, data
10 var top/eax: (addr int) <- get self, top
14 fn push-int-stack _self: (addr int-stack), _val: int {
15 var self/esi: (addr int-stack) <- copy _self
16 var top-addr/ecx: (addr int) <- get self, top
17 var data-ah/edx: (addr handle array int) <- get self, data
18 var data/eax: (addr array int) <- lookup *data-ah
19 var top/edx: int <- copy *top-addr
20 var dest-addr/edx: (addr int) <- index data, top
21 var val/eax: int <- copy _val
22 copy-to *dest-addr, val
26 fn pop-int-stack _self: (addr int-stack) -> _/eax: int {
27 var self/esi: (addr int-stack) <- copy _self
28 var top-addr/ecx: (addr int) <- get self, top
34 subtract-from *top-addr, 1
35 var data-ah/edx: (addr handle array int) <- get self, data
36 var data/eax: (addr array int) <- lookup *data-ah
37 var top/edx: int <- copy *top-addr
38 var result-addr/eax: (addr int) <- index data, top
39 var val/eax: int <- copy *result-addr
43 fn int-stack-empty? _self: (addr int-stack) -> _/eax: boolean {
44 var self/esi: (addr int-stack) <- copy _self
45 var top-addr/ecx: (addr int) <- get self, top
54 fn int-stack-top _self: (addr int-stack) -> _/eax: int {
55 var self/esi: (addr int-stack) <- copy _self
56 var top-addr/ecx: (addr int) <- get self, top
57 var top/ecx: int <- copy *top-addr
64 var data-ah/edx: (addr handle array int) <- get self, data
65 var data/eax: (addr array int) <- lookup *data-ah
66 var result-addr/eax: (addr int) <- index data, top
67 var val/eax: int <- copy *result-addr