-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
109 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
include std.sys.mem | ||
|
||
[ret:void] | ||
sub main | ||
mem_init | ||
1024 malloc clone printx | ||
mem_walk | ||
1024 malloc clone printx | ||
mem_walk | ||
free | ||
mem_walk | ||
marine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
global _start | ||
segment .text | ||
print: | ||
mov rax, 1 | ||
syscall | ||
ret | ||
dump: | ||
mov r9, -3689348814741910323 | ||
sub rsp, 40 | ||
mov BYTE [rsp+31], 10 | ||
lea rcx, [rsp+30] | ||
.dump_loop: | ||
mov rax, rdi | ||
lea r8, [rsp+32] | ||
mul r9 | ||
mov rax, rdi | ||
sub r8, rcx | ||
shr rdx, 3 | ||
lea rsi, [rdx+rdx*4] | ||
add rsi, rsi | ||
sub rax, rsi | ||
add eax, 48 | ||
mov BYTE [rcx], al | ||
mov rax, rdi | ||
mov rdi, rdx | ||
mov rdx, rcx | ||
sub rcx, 1 | ||
cmp rax, 9 | ||
ja .dump_loop | ||
lea rax, [rsp+32] | ||
mov edi, 1 | ||
sub rdx, rax | ||
lea rsi, [rsp+32+rdx] | ||
mov rdx, r8 | ||
call print | ||
add rsp, 40 | ||
ret | ||
usr_main: | ||
|
||
push lit_2 | ||
mov rax, 0x1; 1 | ||
push rax | ||
mov rax, 0x1; 1 | ||
push rax | ||
pop rax | ||
pop rdi | ||
pop rsi | ||
pop rdx | ||
syscall | ||
mov rax, 0x0; 0 | ||
push rax | ||
mov rax, 0x3C; 60 | ||
push rax | ||
pop rax | ||
pop rdi | ||
syscall | ||
ret | ||
_start: | ||
call usr_main | ||
mov rax, 60 | ||
mov rdi, 0 | ||
syscall | ||
segment .data | ||
lit_2: db 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x00 | ||
segment .bss | ||
mem: resb 640000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from "./amd64"; | ||
export * from "./alchemy"; | ||
export * from "./amd64"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export * from "./alchemy"; | ||
export * from "./compiler"; | ||
export * from "./nasm"; | ||
export * from "./result"; | ||
export * from "./alchemy"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export * from "./alchemy"; | ||
export * from "./alchemy_source"; | ||
export * from "./lexer"; | ||
export * from "./line_buffer"; | ||
export * from "./lookup_table"; | ||
export * from "./newline_escaped_string"; | ||
export * from "./refmodel"; | ||
export * from "./alchemy"; | ||
export * from "./alchemy_source"; | ||
export * from "./unknown_instruction_error"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.