Comment

Comment by blovescoffee

Halfway through the article and we have

unsafe { asm!( "mov edi, 42", "mov eax, 60", "syscall", options(nostack, noreturn) ) // nostack prevents `asm!` from push/pop rax // noreturn prevents it putting a 'ret' at the end // but it does put a ud2 (undefined instruction) instead }

and

> We will need to tell the C compiler that we’re providing our own entry point, telling it not to include it’s own start files.

So it's a Rust program but it's just calling inline assembly and using a C compiler?

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton