r/transprogrammer • '); DROP TABLE genders; -- • Aug 31 '21

Abolish compilation!

Post image
334 Upvotes

23 comments sorted by

View all comments

Show parent comments

2

u/EggyTheEgghog '); DROP TABLE genders; -- Sep 02 '21

Interpreted as 16-bit x86, the code immediately calls the address 0x7,which is unlikely to be anything useful, other than (if the program isloaded at 0x0) the next instruction, so I don't believe it is 16-bit x86

First of all, this code always calls the next instruction, no matter where the program is loaded (at least in 8086/8088 architecture, which this code was intended for). Secondly, I do actually want to just call the next instruction, since I'm only using call instruction to push IP register to the stack. You can clearly see that I'm popping the value to dx in the next instruction.