CS334: Number Systems&& Mars simulator Lab 1_2
Ins.Ebtesam AL-Etowi Quizzes/Participation/Absence 5% Logisim/MIPS Programming5% CPU Design Project10% Website: cs334
Ins.Ebtesam AL-Etowi Contents: Exercises && HW solution. Mars simulator.
Ins.Ebtesam AL-Etowi Perform the binary subtraction. Did signed overflow occur? determined whether or not overflow occurred Perform the binary addition. Did signed overflow occur? determined whether or not overflow occurred Exercises discarde solution You are given the following two numbers in two ’ s complement representation:
solution Ins.Ebtesam AL-Etowi H.W solution
simulator Mars 4.2 Ins.Ebtesam AL-Etowi Download the Mars simulator from Step 1: Step 2: Launch the Mars simulator. Step 3: Click on the Edit tab on the top left (in this pane, you'll see your assembly language program. Well, after you've created it). Step 4: Go to File and click on New, to start a new program. Step 5: Let's start with a simple program.
Ins.Ebtesam AL-Etowi
MIPS assembly language Ins.Ebtesam AL-Etowi Registers 32 general-purpose registers register preceded by $ in assembly language instruction Program Structure data declaration section followed by program code section
Cont..))MIPS assembly language Ins.Ebtesam AL-Etowi Data Declarations placed in section of program identified with assembler directive.data Code placed in section of text identified with assembler directive.text contains program code (instructions).
Cont..))MIPS assembly language Ins.Ebtesam AL-Etowi Comments anything following # on a line # This comment Data Declarations format for declarations: name: storage_type value(s( example var1:.word 3 # create a single integer variable with initial value 3
Ins.Ebtesam AL-Etowi Arithmetic Instructions most use 3 operands. all operands are registers; no RAM or indirect addressing. operand size is word (4 bytes). Cont..))MIPS assembly language
General Example Ins.Ebtesam AL-Etowi