Move io
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<attachedFolders>
|
||||
<Path>../input</Path>
|
||||
<Path>../output</Path>
|
||||
</attachedFolders>
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
let SYS_WRITE = 1;
|
||||
let STD_OUT = 1;
|
||||
let STD_ERR = 2;
|
||||
|
||||
func print(msg: String) {
|
||||
syscall(SYS_WRITE, STD_OUT, msg, strlen(msg));
|
||||
}
|
||||
|
||||
func print(value: bool) {
|
||||
if value {
|
||||
print("true");
|
||||
} else {
|
||||
print("false");
|
||||
}
|
||||
}
|
||||
|
||||
func println() {
|
||||
print("\n");
|
||||
}
|
||||
|
||||
func println(msg: String) {
|
||||
print(msg);
|
||||
println();
|
||||
}
|
||||
|
||||
func println(value: bool) {
|
||||
print(value);
|
||||
println();
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
global strlen
|
||||
section .text
|
||||
|
||||
strlen:
|
||||
xor rax, rax
|
||||
.loop:
|
||||
cmp byte [rdi], 0
|
||||
jz .done
|
||||
inc rax
|
||||
inc rdi
|
||||
jmp .loop
|
||||
.done:
|
||||
ret
|
||||
@@ -1 +0,0 @@
|
||||
extern func strlen(msg: String): int64;
|
||||
@@ -1,16 +0,0 @@
|
||||
import "core";
|
||||
|
||||
func main() {
|
||||
println("test");
|
||||
println(true);
|
||||
|
||||
if strlen("1") == 1 {
|
||||
println("1");
|
||||
} else if false {
|
||||
println("2");
|
||||
} else if true {
|
||||
println("3");
|
||||
} else {
|
||||
println("4");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
nasm -g -felf64 out.asm -o out.o
|
||||
nasm -g -felf64 ../input/core/strlen.asm -o strlen.o
|
||||
|
||||
ld -o out out.o strlen.o
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
./build.sh
|
||||
gdb -tui out
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
./build.sh
|
||||
./out
|
||||
echo "Process exited with status code $?"
|
||||
Reference in New Issue
Block a user