Mesabloo

Results 39 comments of Mesabloo

System calls are a bit harder to handle than what was currently thought. Let's take the example of Linux' `open` (2) system call: - Inputs: - `eax = 0x02` -...

In a sense, `syscall`s as presented in the comment above are like (unsafely[^1]) typed macros. [^1]: Unsafely because `interrupt` does not have a clear type, and also because these macros'...

See https://syscalls32.paolostivanin.com/, https://syscalls64.paolostivanin.com/ or https://syscall.sh/ for system call codes and arguments on Linux. Note that all system calls return an integer value in `%rax` (but we may choose to discard...

> The `interrupt N` instruction exists in order to generate the correct code for the INT (or INT-like) instructions. These codes depend on the kernel, not the CPU, so we...

There is no need to repeat `syscall`s within the block (because the block itself is only for syscall declarations).

> What is the size of a unicode character? Languages supporting unicode characters out of the box use 32-bit integers to encode characters. This is a little wasteful in most...

__Note on boolean instructions:__ there are no direct equivalent in modern machine code (x86 does not have such concept of "boolean"). `notb %r0` will therefore be compiled to code similar...

Conditional moves are also a very good part of the instruction set. They avoid most of branches. See the example above for `notb`, which uses conditional moves. If they were...

With all the “recent” changes in the language, all this will need happen that way. Let's elaborate. A typeclass is basically a record definition. An instance is a specific value...