CS2.201 - Computer Systems Organization | CSO Lecture 13 Notes

with Prof. Avinash Sharma
Jun 23, 2021 - Wednesday
Written by: Pratyaksh Gautam

Comparing Instruction Set Architecture paradigms (Complex vs Reduced)

CISC RISC
Adopted by Intel Promoted by IBM and ARM family
Large number of instructions Fewer instructions (<100)
Allow instructions with long execution time No instruction with long execution time
Variable-length instruction encodings Fixed length instruction encodings
Multiple formats for specifying operands Simple addressing formats
Implementation artefacts abstracted away Implementation artefacts exposed to programmer
Condition codes. Special flags set as side No condition codes. Explicit test instructions
effects of instructions. store the test results in normal registers

Y86 ISA

It is a simplified version of the IA32 instruction set, which applies some of the principles of RISC. It has fewer data types, instructions etc. Y86 only allows 4 byte integer operations.

In the context of Y86, we use “word” to mean 4-bytes, since it is the only size we will operate on.

Registers available are, %eax, %ebx, %ecx, %edx, %esi, %edi, %esp, %ebp.

It also has condition codes, ZF, SF, OF, a program counter, and a program status code, and of course a memory.

Assembly code

The numbers in the brackets are 4 bits each, representing the bit-level encoding of the instructions.

Thus some instructions are just 1 byte long, but those that require operands have longer encodings. There is no support for the second index register or scaling, only offsets are allowed.

Arithmetic Codes

The fn mentioned in OP1 addl - 0 subl - 1 andl - 2 xorl - 3

Jump Codes

the fn mentioned in jXX jmp - 0 jle - 1 jl - 2 je - 3 jne - 4 jge - 5 jg - 6

Conditional move instructions

States / Exceptions

| Name | Meaning | |— |— | | AOK | Normal operation | | HLT | halt instruction encountered | | ADR | Invalid address encountered | | INS | Invalid instruction encountered |