Professional Documents
Culture Documents
Lecture # 3
Instruction Set Architecture
software
instruction set
hardware
RISC
(Mips,Sparc,88000,IBM RS6000, . . .1987+)
06/23/20 ACA Spring 2011 Bahria Shaftab Ahmed 6
Classifying ISAs
Variable Size
Instruction length varies based on opcode and address
specifiers
For example, VAX instructions vary between 1 and 53 bytes,
while x86 instruction vary between 1 and 17 bytes.
Good source code density, but difficult to decode and pipeline
Fixed Size
Only a single size for all instructions
For example, DLX, MIPS, Power PC, Sparc all have 32 bit
instructions
Not as good code density, but easier to decode and pipeline
Hybrid Size
Have multiple format lengths specified by the opcode
Op rs1 rd immediate
Op offset added to PC
FORMATS
1. One Byte The instructions have implied data or register
operands.The least significant three bits specify register if any
2. Register to Register
Two Byte instruction where first byte contains Opcode followed by width
and second operand has 2nd register and R/ M fields. Mod field is 11
NOTE: W field’s D1 gives Dir i.e. 0 Byte2 Reg is Source, 1 Byte 2 Reg is Destination
W field’s D0 bit specifies whether it is a eight bit data of 16 bit data
R/M field specifies one of 8 registers. The MOD field is 11 for Register, 00 for memory
without displacement, 01 for memory with 8 bit displacement and 10 for 16 bit displacement
06/23/20 ACA Spring 2011 Bahria Shaftab Ahmed 19
06/23/20 ACA Spring 2011 Bahria Shaftab Ahmed 20
4. Register to / from Memory with Displacement
One or Two additional bytes specify displacement
A3 A2 A1 A0
B3 B2 B1 B0
a0*c0+..+ a7*c7
a0*c0+..+ a7*c7