Pergunta

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.

Foi útil?

Solução

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.

Outras dicas

I'd consider "xlat" (from Intel x86) to be fairly specialized. Does something in particular that doesn't have a whole lot of demand.

I would guess "specialized" here means: Instruction that is tailored to do something fairly complicated that would have normally been done by a block of simpler more RISC-like instructions, but given high demand (or if the CPU designer believes it would be useful or that he can do it better in HW or micro-code flows) - a special instruction (or a family of such) was added to the ISA. A good example in that sense would be AES ISA for e.g. - http://en.wikipedia.org/wiki/AES_instruction_set

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top