how to assemble and link:
nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o
template code (hello world):
section .text
global _start
This is a not great piece of code I've wrote few years ago (I didn't have better things to do when I was 17, apperantly),
when I was fiddling around with the V8 JS Engine. It doesn't work with newer versions of V8, since the library doesn't have a
stable API. Time, where I had time to fight with the depot_tools
and lackluster MSVC support for fun is long gone.
I've tried to redo this example once in the past, after I've got an email notification that someone got interested in stuff
that I've put on the net and have forgotten about. Toolset got even more picky than I remember it being and my attention
for personal programming projects drifted away somewhere else, so it's highly unlikely that I'll update it to the newer API.
But I'm leaving the code there, maybe someone will make good use of it.
I like the ?
syntax a lot because it is very readable and delegates errors nicely but it often becomes unwieldly because ?
only coerces between like-typed error types.
If you define a type which contains each error type and the necessary impls for automatic type coercion, your life becomes much easier.
This macro does that. You define a list of all possible error types, and this macro spits out a system which you need only import.
pub mod error;