oh, thanks stackoverflow

turns out you can run 64-bit x86 code with 64-bit syscalls in a 32-bit process by running ljmp $0x33, $your_64bit_label because amd reused segmentation for determining the processor's mode.

now i just need to figure out how the hell to set the code segment back to 0x23, since long jumps are not valid in 64-bit mode

@artemist yes they are? you can also retf

@iximeow i get a SIGILL on ljmp, 0x23, $shortcode. i might be misreading the sdm though, ptr16:32 is invalid in 64-bit mode but m16:32 is valid.

i hate at&t syntax but i'm trying to do inline assembly so i don't have a ton of choice.

@artemist @iximeow can't you technically put the thing that switches you into Intel mode into the inline assembly?
@Lunaphied @iximeow yes but i don't like doing that
@artemist oh i see, yes the ptr16:32 operand form did get removed in 64-bit mode. you'd have to put the selector and address in memory and use m16:32 (my fav is putting it all on the stack and doing a `jmpf [rsp]`)