lab7

lab7 - MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
6.004 Computation Structures - 1 - Lab #7 M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 6.004 Computation Structures Lab #7 The goal of this lab is to add support for two new instructions to the Beta. But instead of adding hardware, we’ll support the instructions in software (!) by writing the appropriate emulation code in the handler for “illegal instruction” exceptions. The new instructions implement load and store operations for byte (8-bit) data: LDB Usage: LDB(Ra,literal,Rc) Opcode: 010000 Rc Ra literal Operation: PC PC+4 EA Reg[Ra] + SEXT(literal) MDATA Mem[EA] Reg[Rc] 7:0 if EA 1:0 = 0b00 then MDATA 7:0 else if EA 1:0 = 0b01 then MDATA 15:8 else if EA 1:0 = 0b10 then MDATA 23:16 else if EA 1:0 = 0b11 then MDATA 31:24 Reg[Rc] 31:8 0x000000 The effective address EA is computed by adding the contents of register Ra to the sign- extended 16-bit displacement literal . The byte location in memory specified by EA is read into the low-order 8 bits of register Rc; bits 31:8 of Rc are cleared. STB Usage: STB(Rc,literal,Ra) Opcode: 010001 Rc Ra literal Operation: PC PC+4 EA Reg[Ra] + SEXT(literal) MDATA Mem[EA] if EA 1:0 = 0b00 then MDATA 7:0 Reg[Rc] 7:0 else if EA 1:0 = 0b01 then MDATA 15:8 Reg[Rc] 7:0 else if EA 1:0 = 0b10 then MDATA 23:16 Reg[Rc] 7:0 else if EA 1:0 = 0b11 then MDATA 31:24 Reg[Rc]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

lab7 - MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online