SlideServe
Menu
Préférences
© SlideServe · v2026

Lab #1 PCSpim

chloe avatar
5 diapositives · 258 Views · Aug 07, 2014

Lab #1 PCSpim . SPIM is a software simulator that loads and executes assembly language programs for the MIPS RISC computers. Download and install PCSpim from http://www.cs.wisc.edu/~larus/spim.html Introduction to PCSpim can also be found there. Sample Program.

Lab #1 PCSpim - slide 1
01 / 5Lab #1 PCSpim
1 / 17

Télécharger la présentation

Lab #1 PCSpim
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Lab #1 PCSpim • SPIM is a software simulator that loads and executes assembly language programs for the MIPS RISC computers. • Download and install PCSpim from http://www.cs.wisc.edu/~larus/spim.html • Introduction to PCSpim can also be found there

  2. Sample Program ## Your first MIPS assembly program ## Notice the stylized format of the code: 3 columns: ## (1) Optional labels, ## (2) Machine instructions, assembler directives and operands, ## (3) Optional comments: right of a '#' until end of line is ## ignored. .data # "data section" global, static modifiable data SID: .word 50 spc1: .asciiz " " nl: .asciiz "\n" msg1: .asciiz "Hello, World\n" msg2: .asciiz "My name is: XXXXXXXXX\n" msg3: .asciiz "\nMy name is still XXXXXXXXX !\n"

  3. Sample Program (cont’d) .text # "text section" code and read-only data .globl main # declare main as a global symbol main: la $a0, msg1 li $v0, 4 # "print string" system call syscall la $a0, msg2 li $v0, 4 syscall lw $a0, SID la $a1, spc1 Loop: beq $0, $a0, Exit add $a0, $a0, -1 li $v0, 1 # "print int" system call syscall

  4. Sample Program (cont’d) move $t0, $a0 move $a0, $a1 li $v0, 4 syscall move $a0, $t0 j Loop Exit: la $a0, msg3 li $v0, 4 syscall ## Exit from program li $v0, 10 # "Exit" system call syscall

  5. Requirements • Type the MIPS sample program into a file using a text editor. Replace XXXXX by your name. Name the new file lab1.s • Run PCSpim and load lab1.s • Write a report (text file) on what the program does. Name the file lab1.rep • Package the two files as lab1.zip and email to grader Z. Yue (zdyue@ee.tamu.edu) with subject 350lab1 • Due date 2/9 (Wed) 11:30 AM.