Mid-term Study Flashcards
For decimal encoding, what exponents values are reserved?
00000000 and 11111111
What are the general types of ISA commands on the CPU?
- Data processing (AND, NOT)
- Data movement (LD, LEA)
- Control Instructions (JMP, BRP)
- I/O Instructions (getc)
What is CISC and RISC what are their differences?
CISC - Complex Instruction Set Computer
- Robust instructions, reduced ASM
- Can op directly on data
- Translating from high level languages is easier
- Con - Lots of unused instructions
RISC - Reduced Instruction Set Computer
- Single clock-cycle instructions (very simple)
- Can only LD and ST directly on data
- ALU only works on registers
- Allows for super efficiency (pipelining)
- Con - results in complex ASM
What is the address space for LS3 and what does that mean?
Address space is 216 (16 bit addresses)
Each memory locations holds a 16-bit value
Draw the diagram of the LC3 memory layout
What LC3 registered are not directly accessible?
- PC - What line of code we are on
- IR - Currently instruction executed
- CC - Used to for loops
What are the first 4 bits of an LC3 instruction for?
The opcode
What are the addressing modes that LC-3 supports?
What are the assembler directives?
What are the traps in LC3?
What happens during the first and second pass of LC3 assembly?
First pass:
- symbol table created for labels
Second pass:
- symbols are used to build machine languages and the following files are output
- .sym
- .hex
- .bin
- .asm
- .lst (file list)
What are the instructions that affect conditions codes?
- ADD
- AND
- LD
- LDI
- LEA
- NOT
What are the limitations of branching, and how can those limitations be circumvented?
Branching is PC-relative
- The offset is added to the PC counter for the new mem location
- This offset is 9 bits (limited to -255 to 256 memory space)
One can use JMP to circumvent this (and jump anywhere in memory space)
- Store new memory address in variable
- LEA variable into a register
- Use the register to JMP
- JMP R1
What are the 5 addressing modes that LC3 supports?
- Immediate
- Register
- Direct (or PC-Relative)
- Indirect
- Relative (or base+offset)
How do you calculate the EA of Direct(Pc-Relative) mode?
It loads or stores the data in:
Reg <–> M[(PC)+SEXT(IR[8:0])]
OP Codes:
LD [0010][Dst][PCoffset9]
ST [0011][Src][PCoffset9]
The range can be (pc) - 256 <= x <= 255 + (pc)