RosettaCodeData/Task/Conditional-structures/Phix/conditional-structures-5.phix

24 lines
819 B
Plaintext

without js -- (but maybe, at some point, and obviously that is as custom verbatim JavaScript code instead of assembly code)
#ilASM{
[32]
mov eax,[var]
[64]
mov rax,[var]
[PE32]
push eax -- uExitCode
call "kernel32.dll","ExitProcess"
[PE64]
mov rcx,rax -- uExitCode
call "kernel32.dll","ExitProcess"
[ELF32]
mov ebx,eax -- error_code (p1)
mov eax,1 -- sys_exit(ebx=int error_code)
int 0x80
-- xor ebx,ebx -- (common requirement after int 0x80)
[ELF64]
mov rdi,rax -- error_code (p1)
mov rax,60 -- sys_exit(rdi=int error_code)
syscall
[]
}