I'm currently studying for a Assembly Language Exam and have come across this question in a past paper,
In assembly what is meant by a specialized instruction? Give an example of one. How does a CPU designer decide which instruction to specialize?
it has me stumped and my lecturers notes aren't helping either.
The simulator we work with is 8-bit similar to the x86 family to clarify.
Interesting. I haven't heard of that before and Google showed nothing either (this very page comes up 3rd). But with reasoning we can find out what lecturer meant: in order for some instruction to be specialized, it has to do a single one task only.
So it could mean that MOV
is a "generic" instruction where it could do many different operations based on operands. But on the other hand NOP
or HALT
instructions do only one thing and nothing else. Of course that single thing could be used to perform many different tasks. For instance NOP could be used for delay or just as a placeholder. But NOP only does one thing in the end.
Similarly INT 3
although seems to look like an INT
instruction with parameter 3
is actually a single opcode, 0xCC
. That's because INT 3
is used for breakpoints, and therefore has to have the ability to fit in a single opcode. That's why it's specialized.