1 / 6

CPE 232 Computer Organization PCSpim Simulator

CPE 232 Computer Organization PCSpim Simulator. Dr. Iyad Jafar. PCSpim Environment. Registers Pane. Decoded and loaded instructions Pane. Data Memory Pane. Messages Pane. PCSpim Environment. Menus File Open: used to select the file to be loaded Save log file Simulator

urbana
Download Presentation

CPE 232 Computer Organization PCSpim Simulator

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. CPE 232 Computer Organization PCSpim Simulator Dr. Iyad Jafar

  2. PCSpim Environment • Registers Pane • Decoded and loaded instructions Pane • Data Memory Pane • Messages Pane

  3. PCSpim Environment • Menus • File • Open: used to select the file to be loaded • Save log file • Simulator • Clear registers • Reinitialize • Reload • Go: execute the entire loaded program • Break: stop the execution of the program • Single Step: execute the program step by step (F10) • Multiple Steps: run the program for a specified number of steps • Breakpoints: insert breakpoints at specific addresses to ease debug • Set Value: change the value of a memory location of register

  4. Program Structure • Data Segment • Used to define variables and values • Starts with the .data directive • We can define variables and constants by using labels followed by assembler directive .word and .byte • Text segment • The segment that contains the code to be executed • Starts with the .text directive • The first line of code should be labeled main:

  5. Example • Program that loads a number that is stored in memory at some location, multiplies it by 4 then store it another location. .data N: .word 0x00000005 # number in memory M: .word 0x00000000 # place to store result .text Main: lw $s1, N # get number for memory add $s1, $s1 , $s1 add $s1, $s1 , $s1 sw $s1, M

  6. Example • NOTES : • From the File menu, select Open and select the file you want to load. • If there are no error, the program loads in the text segment of the memory. • You can now select Single Step, Multiple Steps, or Go from the Simulator menu to run your program. • To debug, you can place breakpoints by specifying their addresses. • The contents of the registers and memory locations will be updated once the execution is over (if the Go or Multiple Steps options are selected) or after the execution of each instruction is Single Step option is selected.

More Related