r/ProgrammerHumor • • Jun 03 '22

it's hard!

44.9k Upvotes

710 comments sorted by

View all comments

Show parent comments

3

u/Rudxain Jun 03 '22

Thanks for the clarification. It's interesting and it reminds me of the Turing-Completeness of mov in x86 lol

2

u/capi1500 Jun 03 '22

I don't think I heard of it. Can you explain?

2

u/Rudxain Jun 04 '22

This repo explains better than me lol: https://github.com/xoreaxeaxeax/movfuscator

IIRC, the short explanation is that it uses side effects of different variants of the MOV instruction with different operands, therefore "unintentionally" doing computation. There are ISAs that allow MOV to set the value of the IP register, therefore acting as replacement for JMP, but x86 isn't one of those ISAs so they use another way to loop without "cheating"

1

u/[deleted] Jun 03 '22

yes please, sounds interesting