Fixed error with the way the string pool worked
This commit is contained in:
40
test/hellosir.c0.bc0
Normal file
40
test/hellosir.c0.bc0
Normal file
@@ -0,0 +1,40 @@
|
||||
C0 C0 FF EE # magic number
|
||||
00 09 # version 4, arch = 1 (64 bits)
|
||||
|
||||
00 00 # int pool count
|
||||
# int pool
|
||||
|
||||
00 1E # string pool total size
|
||||
# string pool
|
||||
57 68 61 74 27 73 20 79 6F 75 72 20 6E 61 6D 65 3F 20 00 # "What\'s your name\? "
|
||||
48 65 6C 6C 6F 2C 20 00 # "Hello, "
|
||||
21 0A 00 # "!\n"
|
||||
|
||||
00 01 # function count
|
||||
# function_pool
|
||||
|
||||
#<main>
|
||||
00 00 # number of arguments = 0
|
||||
00 01 # number of local variables = 1
|
||||
00 21 # code length = 33 bytes
|
||||
14 00 00 # aldc 0 # s[0] = "What\'s your name\? "
|
||||
B7 00 00 # invokenative 0 # print("What\'s your name\? ")
|
||||
57 # pop # (ignore result)
|
||||
B7 00 01 # invokenative 1 # readline()
|
||||
36 00 # vstore 0 # name = readline();
|
||||
14 00 13 # aldc 19 # s[19] = "Hello, "
|
||||
15 00 # vload 0 # name
|
||||
14 00 1B # aldc 27 # s[27] = "!\n"
|
||||
B7 00 02 # invokenative 2 # string_join(name, "!\n")
|
||||
B7 00 02 # invokenative 2 # string_join("Hello, ", string_join(name, "!\n"))
|
||||
B7 00 00 # invokenative 0 # print(string_join("Hello, ", string_join(name, "!\n")))
|
||||
57 # pop # (ignore result)
|
||||
10 00 # bipush 0 # 0
|
||||
B0 # return #
|
||||
|
||||
00 03 # native count
|
||||
# native pool
|
||||
00 01 00 06 # print
|
||||
00 00 00 0B # readline
|
||||
00 02 00 4F # string_join
|
||||
|
||||
Reference in New Issue
Block a user