130 likes | 151 Views
LC-2 : The Little Computer 2. Gabriella Trucco Email: gabriella.trucco@unimi.it https://homes.di.unimi.it/trucco/didattica.html. Informazioni. Reference guide available online ( google : LC-2 little computer) Introduction to Computing Systems From Bits and Gates to C and Beyond
E N D
LC-2: The Little Computer 2 Gabriella Trucco Email: gabriella.trucco@unimi.it https://homes.di.unimi.it/trucco/didattica.html
Informazioni • Reference guide available online (google: LC-2 little computer) • Introductionto Computing Systems From Bits and Gates to C and Beyond (A First Course in Computer Science and Engineering)
Instruction • 2 parts • Opcode • Operands • LC-2 instruction: 16 bit
LC-2 overview • Memory organization • Address space: 2 16 locations • Addressability: 16 bit • Registers: additional temporary storage locations accessed in a single machine cycle • Registers uniquely identifiable • 8 registers, identified by 3 bit register number (R0..R7) • Addressing modes: to specify where the operand is located • Immediate (or literal): operand is part of the instruction • Register • Memory addressing modes • Direct • Indirect • Base + off-set
LC-2 overview • Condition codes: allow instruction sequencing to change on the bases of previously generated results • N: negative • Z: zero • P: positive
Operate instructions • NOT • ADD • AND
Data movement • Load: from memory to register • Store: from register to memory • LEA: immediate mode • LD and ST: direct mode
Data movement • LDI and STI: Indirect mode • LDR and STR: Base + offset