summaryrefslogtreecommitdiff
path: root/test/dump/basic.txt
blob: 092a9c05fe1a86c23d5b8dc24cb07357c3b10eb9 (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
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
;;; TOOL: run-objdump
;;; ARGS0: -v
;;; ARGS1: --headers
(module
  (memory 1)
  (func $f (param i32 i32) (result i32)
    i32.const 0
    i32.const 0
    i32.load
    i32.const 1
    i32.add
    i32.store
    local.get 0
    local.get 1
    i32.add)
  (export "f" (func $f)))
(;; STDERR ;;;
0000000: 0061 736d                                 ; WASM_BINARY_MAGIC
0000004: 0100 0000                                 ; WASM_BINARY_VERSION
; section "Type" (1)
0000008: 01                                        ; section code
0000009: 00                                        ; section size (guess)
000000a: 01                                        ; num types
; func type 0
000000b: 60                                        ; func
000000c: 02                                        ; num params
000000d: 7f                                        ; i32
000000e: 7f                                        ; i32
000000f: 01                                        ; num results
0000010: 7f                                        ; i32
0000009: 07                                        ; FIXUP section size
; section "Function" (3)
0000011: 03                                        ; section code
0000012: 00                                        ; section size (guess)
0000013: 01                                        ; num functions
0000014: 00                                        ; function 0 signature index
0000012: 02                                        ; FIXUP section size
; section "Memory" (5)
0000015: 05                                        ; section code
0000016: 00                                        ; section size (guess)
0000017: 01                                        ; num memories
; memory 0
0000018: 00                                        ; limits: flags
0000019: 01                                        ; limits: initial
0000016: 03                                        ; FIXUP section size
; section "Export" (7)
000001a: 07                                        ; section code
000001b: 00                                        ; section size (guess)
000001c: 01                                        ; num exports
000001d: 01                                        ; string length
000001e: 66                                       f  ; export name
000001f: 00                                        ; export kind
0000020: 00                                        ; export func index
000001b: 05                                        ; FIXUP section size
; section "Code" (10)
0000021: 0a                                        ; section code
0000022: 00                                        ; section size (guess)
0000023: 01                                        ; num functions
; function body 0
0000024: 00                                        ; func body size (guess)
0000025: 00                                        ; local decl count
0000026: 41                                        ; i32.const
0000027: 00                                        ; i32 literal
0000028: 41                                        ; i32.const
0000029: 00                                        ; i32 literal
000002a: 28                                        ; i32.load
000002b: 02                                        ; alignment
000002c: 00                                        ; load offset
000002d: 41                                        ; i32.const
000002e: 01                                        ; i32 literal
000002f: 6a                                        ; i32.add
0000030: 36                                        ; i32.store
0000031: 02                                        ; alignment
0000032: 00                                        ; store offset
0000033: 20                                        ; local.get
0000034: 00                                        ; local index
0000035: 20                                        ; local.get
0000036: 01                                        ; local index
0000037: 6a                                        ; i32.add
0000038: 0b                                        ; end
0000024: 14                                        ; FIXUP func body size
0000022: 16                                        ; FIXUP section size
;;; STDERR ;;)
(;; STDOUT ;;;

basic.wasm:	file format wasm 0x1

Sections:

     Type start=0x0000000a end=0x00000011 (size=0x00000007) count: 1
 Function start=0x00000013 end=0x00000015 (size=0x00000002) count: 1
   Memory start=0x00000017 end=0x0000001a (size=0x00000003) count: 1
   Export start=0x0000001c end=0x00000021 (size=0x00000005) count: 1
     Code start=0x00000023 end=0x00000039 (size=0x00000016) count: 1

Code Disassembly:

000025 func[0] <f>:
 000026: 41 00                      | i32.const 0
 000028: 41 00                      | i32.const 0
 00002a: 28 02 00                   | i32.load 2 0
 00002d: 41 01                      | i32.const 1
 00002f: 6a                         | i32.add
 000030: 36 02 00                   | i32.store 2 0
 000033: 20 00                      | local.get 0
 000035: 20 01                      | local.get 1
 000037: 6a                         | i32.add
 000038: 0b                         | end
;;; STDOUT ;;)