drop some libc functions, octal numerals, io.println, mem.read32

This commit is contained in:
2025-11-22 17:31:36 +01:00
parent 5a41163ca1
commit 7cffd73406
28 changed files with 165 additions and 126 deletions

View File

@@ -106,7 +106,7 @@ section .text
);
// take that rustfmt
for name in "malloc,memset,realloc,free,puts,putchar,printf,snprintf,strtol,strlen,strcmp,strcat,strcpy,strncpy,fopen,fseek,ftell,fread,fwrite,fclose,rewind,system,opendir,readdir,closedir,exit,gettimeofday,connect,socket,send,write,read,close,bind,listen,accept,getchar,gethostbyname,dlopen,dlsym".split(",")
for name in "syscall,malloc,realloc,free,snprintf,strtol,system,opendir,readdir,closedir,gettimeofday,send,write,read,close,getchar,gethostbyname".split(",")
{
emit!(&mut self.output, "extern {}", name);
emit!(&mut self.output, "c.{} equ {}", name, name);
@@ -121,6 +121,11 @@ _builtin_read8:
mov al, byte [rdi]
ret
section .text._builtin_read32
_builtin_read32:
mov eax, dword [rdi]
ret
section .text._builtin_read64
_builtin_read64:
mov rax, qword [rdi]