mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Fix bytecode generation for .array
This commit is contained in:
parent
ac02ff3b8d
commit
987381c751
2 changed files with 4 additions and 4 deletions
|
|
@ -209,7 +209,7 @@ void disassemble (FILE *f, bytefile *bf) {
|
|||
break;
|
||||
|
||||
case 6:
|
||||
fprintf (f, "CALL\t%0x%.8x ", INT);
|
||||
fprintf (f, "CALL\t0x%.8x ", INT);
|
||||
fprintf (f, "%d", INT);
|
||||
break;
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ void disassemble (FILE *f, bytefile *bf) {
|
|||
break;
|
||||
|
||||
case 4:
|
||||
fprintf (f, "CALL\tBarray");
|
||||
fprintf (f, "CALL\tBarray\t%d", INT);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -191,8 +191,8 @@ module ByteCode =
|
|||
(* 0x70 *) | CALL ("Lread", _, _) -> add_bytes [7*16 + 0]
|
||||
(* 0x71 *) | CALL ("Lwrite", _, _) -> add_bytes [7*16 + 1]
|
||||
(* 0x72 *) | CALL ("Llength", _, _) -> add_bytes [7*16 + 2]
|
||||
(* 0x72 *) | CALL ("Lstring", _, _) -> add_bytes [7*16 + 3]
|
||||
(* 0x72 *) | CALL (".array", _, _) -> add_bytes [7*16 + 4]
|
||||
(* 0x73 *) | CALL ("Lstring", _, _) -> add_bytes [7*16 + 3]
|
||||
(* 0x74 *) | CALL (".array", n, _) -> add_bytes [7*16 + 4]; add_ints [n]
|
||||
|
||||
(* 0x52 n:32 n:32 *) | BEGIN (_, a, l, [], _, _) -> add_bytes [5*16 + 2]; add_ints [a; l] (* with no closure *)
|
||||
(* 0x53 n:32 n:32 *) | BEGIN (_, a, l, _, _, _) -> add_bytes [5*16 + 3]; add_ints [a; l] (* with a closure *)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue