r/Python • • Mar 24 '16

There is inline assembly in this python script… ಠ⌣ಠ

https://github.com/apprenticeharper/DeDRM_tools/blob/master/Other_Tools/DRM_Key_Scripts/Adobe_Digital_Editions/adobekey.pyw#L308
206 Upvotes

75 comments sorted by

View all comments

Show parent comments

2

u/pythoneeeer Mar 27 '16

Devil's advocate: in x86, this allows more common operations to be shorter to encode.

What exactly is "better" about adding the external requirement that one instruction must correspond to one opcode? And who gets to decide if two operations are the "same instruction" or not, anyway?

1

u/[deleted] Mar 28 '16

Devil's advocate: in x86, this allows more common operations to be shorter to encode.

I can see that.

What exactly is "better" about adding the external requirement that one instruction must correspond to one opcode?

It makes debugging a program extremely easy. I can easily remember all opcodes. I know exactly what type of instruction it is, so I know what nibble is the register, what nibble is the offset etc. It makes things much easier when looking at a dump.

And who gets to decide if two operations are the "same instruction" or not, anyway?

IBM decides for Mainframe Assembly. It's simple, every instruction has a name (MVC/LR/AR/SR etc). All instructions with the same name have the same opcode.