// rt/start.s — process entry. Linux sets up the stack so that on // entry [SP] holds argc, [SP+8] starts argv (NULL-terminated array // of *u8), [SP+8+(argc+1)*8] starts envp. // // We pull argc into DI and the argv pointer into SI, then jump to // `main`. ww programs that declare `fn main(argc: i32, argv: **u8) // i32` see them; programs declaring `fn main() i32` simply ignore // the regs. Either way, main's return value is fed to the exit // syscall. TEXT _start,$0 MOVQ (SP), DI LEAQ 8(SP), SI CALL main(SB) MOVQ AX, DI MOVQ $60, AX SYSCALL