我有一些汇编脚本代码:
export function run(): void {
store<string>(0, 'hello, my name is marty');
}
它将一个字符串存储0
在内存中的指针处。
但是,生成的 .wat 文件将字符串存储在 location1056
而不是0
:
(module
(type $none_=>_none (func))
(memory $0 1)
(data (i32.const 1036) "L")
(data (i32.const 1048) "\01\00\00\00.\00\00\00h\00e\00l\00l\00o\00,\00 \00m\00y\00 \00n\00a\00m\00e\00 \00i\00s\00 \00m\00a\00r\00t\00y")
(export "run" (func $assembly/index/run))
(export "memory" (memory $0))
(func $assembly/index/run
i32.const 0
i32.const 1056
i32.store
)
)