News for hackers. Stuff that matters.
Re:What's your favorite weird CPU instruction? any architect... by rep_lodsb on Monday November 22, 2021 @01:23AM (#29303423)
username related - read lots of stuff while doing nothing useful with it :)

other fun x86 ones:

CALL SP

will call whatever code has been pushed on the stack. Unlike PUSH SP, it works the same on 8086 and newer CPUs

RET -2 (16 bit; -4 or -8 for 32/64 bit)

return but leave address on stack

LAR

load access rights; doesn't trap to kernel, so you can use this in ring3 code to scan through segment selectors and find out which are accessible and what type they are. On any x64 Linux, you can switch between 32 and 64 bit modes via far call, and syscalls will work in both modes (though they use different numbers).

There are no comments on this comment yet.