You are on page 1of 5

Objectives:

1. Introduction to SRC Simulator and the way it works. 2. To get familiar with SRC Simulators environment and functionalities.

Equipment and Software Tools Required:


1. SRCToolsv3.1.1.jar: Simulates the way SRC processor works and thus allows us to execute SRC instructions even when the processor is missing. 2. Java Runtime Environment: Required to run Java applications, in our case SRCToolsv3.1.1.jar is codded in Java.

Introduction:
SRCToolsv3.1.1.jar contains two major components: SRC assembler and SRC simulator. The assembler translates assembly language into machine code equivalent for the SRC microprocessor, while the simulator simulates the SRC microprocessor which means executing and debugging SRC instructions.

Procedure:
1. Running the SRC simulator by double clicking SRCToolsv3.1.1.jar

2. Clicking on the Edit button opens a window where we can enter the instructions in. Write the following instructions: sub r1, r2, r3

sub r4, r5, r6 add r7, r4, r1 stop

3. Click on the Assemble button, A .lst file will be created for us.

4. Clicking on Show Asm File brings allows us to edit/reassemble our file. While clicking on Show Binary File shows us the machine code equivalent of our instructions along their addreses.

5. To load our code into the simulator, we will have to click on Bin->Sim button.

6. Be sure the PC counter is set to 0x00000000. Set the notation to decimal by clicking on Dec radio button, then edit the values of r2, r3, r5 and r6 and click on Run. Notice the changes in the values of the following registers: r1, r4, r7.

7. Alternatively, you can run the program line-by-line by clicking on Step button.

Discussion:
Using the SRC simulator, write the following program that subtract the values of two variables x and y and replace the result in a third variable, where x and y are the first and second digits of your StudentID respectively (e.g, StudentID = 20011747, x = 7, y = 4, z = 3). Run the program and check the output at the memory display. Provide a snapshot of both.

.org 0h; sets the starting address of the data segment x: .dw 1; define a variable x of size 1 word (4 bytes) y: .dw 1; define a variable x of size 1 word (4 bytes) z: .dw 1; define a variable x of size 1 word (4 bytes) .org 100h; starts the starting address of the code segment la r0, 0; loads the starting address of the data segment ld r1, x(r0); r1 = x ld r2, y(r0); r2 = y sub r3, r1, r2; r3 = r1-r2 st r3, z(r0); z = r3 stop ;end of code.

Conclusion:
This experiment has made me familiar not only with SRCToolsv.3.1.1.jar but simulators in general. Regarding simulators; I have learned that the basic functionalities of them are: Breakpoints, singlestepping through instructions, running (and stopping) instruction processing, reading memorys contents and more. As far as SRCToolsv.3.1.1.jar, I have learned how to enter Assembly instructions, creating and opening .lst/.asm files, editing/reassembling our file, changing the notation from decimal to binary, loading our instructions into the simulator, and editing register or memory values.