added support for macros inside macros

This commit is contained in:
MCorange
2023-04-01 17:49:41 +03:00
parent f5d8b3ebca
commit 0a61a599c1
12 changed files with 136 additions and 46 deletions

5
include/compat.mcl Normal file
View File

@@ -0,0 +1,5 @@
macro __compat__
macro !8 load8 end
macro @8 store8 end
end

View File

@@ -1,27 +0,0 @@
macro load8 @8 end
macro store8 !8 end
macro load64
7 + 0
8 shl over !8 + swap 1 - swap
8 shl over !8 + swap 1 - swap
8 shl over !8 + swap 1 - swap
8 shl over !8 + swap 1 - swap
8 shl over !8 + swap 1 - swap
8 shl over !8 + swap 1 - swap
8 shl over !8 + swap 1 - swap
8 shl over !8 + swap drop
end
macro store64
2dup 255 band @8 shr swap 1 + swap
2dup 255 band @8 shr swap 1 + swap
2dup 255 band @8 shr swap 1 + swap
2dup 255 band @8 shr swap 1 + swap
2dup 255 band @8 shr swap 1 + swap
2dup 255 band @8 shr swap 1 + swap
2dup 255 band @8 shr swap 1 + swap
2dup 255 band @8 shr swap 2drop
end

View File

@@ -2,4 +2,5 @@ include "linux.mcl"
include "io.mcl"
include "util.mcl"
include "int.mcl"
include "fs.mcl"
include "fs.mcl"
include "compat.mcl"