coding-pepper
green means fully implemented as described by standard
yellow means partially implemented as described by standard / work in progress
red means not yet implemented as described by standard
currently working on: x86cputalk
planned projects
- x86cputalk - a programming language written in assembly to build my projects
- x86plink - a linker supporting inputs: elf outputs: elf raw
- peppermake - a small make like build system written in x86cputalk
- kode - a text editor written in x86cputalk
defined standards
linux functions
stack means that you push arguments on the stack in reverse order
so myfn(a, b, c) you push c then b then a
writef(file_desc=rdi, string=rsi, var_args=stack) bytes_written=rax
description:
writef writes to buffer a formatted string
formats:
%int% int (max 128bit but in reality 64bits because of the processor)
%uint% uint (max 128bit but in reality 64bits because of the processor)
%str% null-terminated string
%char% character 8bit
%float% float 32bit
%ptr% pointer in hex 64bit
memcmp(a=rdi, b=rsi, len_a=rdx, len_b=rcx) difference=rax
description:
memcmp compares two buffers limited by respective lenghts
result will be 1 if lenghts are different
result will be more than 0 if contents aren't the same
open(filename=rdi, flags=rsi, mode=rdx) file_desc=rax
description:
returns file descriptor of requested file or -1
this is just a syscall wrapper im not explaining this
fopen_r(filename=rdi) file_desc=rax
description:
returns file descriptor of requested file for reading alone or -1
fopen_w(filename=rdi, mode=rdx) file_desc=rax
description:
returns file descriptor of target file for writing alone or -1
if the target file doesn't exist it creates it
if the target file exists it gets recreated
close(file_desc=rdi)
description:
closes file handle or something, idk its a linux syscall
exit(exit_code=rdi)
description:
exits the program with given exit_code
fread(file_desc=rdi) pointer_to_file=rax
description:
allocates a null-terminated buffer using brk and reads the entire file.
brk(address=rdi) (address == 0 ? address_of_brk : status)=rax
description:
linux syscall wrapper
get_brk() address_of_brk=rax
description:
get address of brk