1 / 3

MIPS coding

MIPS coding. SPIM syscalls. http://www.inf.pucrs.br/~eduardob/disciplinas/arqi/mips/syscall_codes.html. .data msg_hello: .asciiz &quot;Hello! This is CDA3100!<br>&quot; msg_empty: .space 400 msg_done: .asciiz &quot;done!<br>&quot; .text .globl main main: done: li $v0,1 li $a0,100 syscall

karena
Télécharger la présentation

MIPS coding

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. 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

More Related