1 / 11

Computer Science 210 Computer Organization

Computer Science 210 Computer Organization. Machine Language Instructions: Computation. Types of Instructions. Operate (computation): NOT, AND, ADD Data movement: LD, LDR, LDI, LEA, ST, STR, STI Control: BR, JMP, JSR, JSRR, RET, RTI, TRAP. Bitwise NOT.

Download Presentation

Computer Science 210 Computer Organization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Science 210Computer Organization Machine Language Instructions: Computation

  2. Types of Instructions • Operate (computation): NOT, AND, ADD • Data movement: LD, LDR, LDI, LEA, ST, STR, STI • Control: BR, JMP, JSR, JSRR, RET, RTI, TRAP

  3. Bitwise NOT 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst NOT RSrc NOT Dst Src 1 1 1 1 1 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 R3  NOT R5 1 0 0 1 0 1 1 1 0 1 1 1 1 1 1 1

  4. Data Path for NOT 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 NOT Dst Src 1 1 1 1 1 1 RDst NOT RSrc

  5. Bitwise AND (2 flavors) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst RSrc1 AND RSrc2 AND Dst Src1 0 0 0 Src2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst RSrc1 AND Data AND Dst Src1 1 imm5 Data is the sign-extend of imm5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Clear R1 0 1 0 10 0 10 011 0 0 0 0 0

  6. ADD (2 flavors) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst RSrc1 ADD RSrc2 ADD Dst Src1 0 0 0 Src2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 RDst RSrc1 ADD Data ADD Dst Src1 1 imm5 Data is the sign-extend of imm5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Increment R1 0 0 0 10 0 10 011 0 0 0 0 1

  7. Data Path for AND/ADD (register mode) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 AND Dst Src1 0 0 0 Src2 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADD Dst Src1 0 0 0 Src2 RDst RSrc1 AND RSrc2 0 bit means register mode RDst RSrc1 ADD RSrc2

  8. Data Path for AND/ADD (immediate mode) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 AND Dst Src1 1 imm5 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADD Dst Src1 1 imm5 RDst RSrc1 AND Data 1 bit means immediate mode RDst RSrc1 ADD Data

  9. Other Useful Operations • Decrement the contents of a given register • Copy the contents of RA to RB • Subtract RB from RA and store the result in RC

  10. The LC-3 Simulator • Various versions, ours comes from U Texas • Supports assembly, loading of object files, and visualized execution • Next, Step, Finish, Continue, Stop • Can edit PC, registers, and memory

  11. Using the Simulator • Run /opt/lc3tools/lc3sim-tk • Enter instructions starting at x3000 • Set PC to x3000, then Next or Continue

More Related