SlideServe
Menu
Préférences
© SlideServe · v2026

Simple MIPS Program with Syscalls for String Manipulation

karena avatar
3 diapositives · 170 Views · Sep 05, 2014

This MIPS assembly program demonstrates basic syscalls, including printing messages and copying strings. It begins by printing a greeting message, then waits for user input, and finally displays a message indicating that the program is done. The string copy function, `strcpy`, is implemented to clone data from one location to another in memory. This code serves as a practical example of handling data in MIPS assembly and utilizing system calls effectively.

Simple MIPS Program with Syscalls for String Manipulation - slide 1
01 / 3Simple MIPS Program with Syscalls for String Manipulation
1 / 17

Télécharger la présentation

Simple MIPS Program with Syscalls for String Manipulation
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. MIPS coding

  2. SPIM syscalls • http://www.inf.pucrs.br/~eduardob/disciplinas/arqi/mips/syscall_codes.html

  3. .data msg_hello: .asciiz "Hello! This is CDA3100!\n" msg_empty: .space 400 msg_done: .asciiz "done!\n" .text .globl main main: done: li $v0,1 li $a0,100 syscall li $v0,5 syscall li $v0,4 la $a0,msg_hello syscall li $v0,4 la $a0,msg_empty syscall la $a0,msg_empty #dst la $a1,msg_hello #src jal strcpy li $v0,4 la $a0,msg_empty syscall li $v0,10 #exit syscall strcpy: addi $t0, $a0, 0 addi $t1, $a1, 0 strcpyloop: lb $t3, 0($t1) sb $t3, 0($t0) beq $t3, $0, strcpydone addi $t0, $t0, 1 addi $t1, $t1, 1 j strcpyloop strcpydone: jr $ra