|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Junior Member
Iscritto dal: Mar 2007
Messaggi: 15
|
Esercizio Assembler (SPIM)
TRACCIA:
Eseguire un programma che prenda in input un nome e riscriva su terminale video un messaggio di saluto con il nome della persona accodato alla fine del messaggio Esempio OUTPUT: Come ti chiami? INPUT: Brad Pit OUTPUT: Seee mo sullo spim ce mette mano pure Brad Pit SVOLGIMENTO: .text .globl main main: li $v0, 4 #stampa di una stringa la $a0, stringauno #caricamento stringa da stampare syscall #stampa stringauno li $v0, 8 #lettura di una stringa la $a0, buffer li $a1, 100 syscall #legge un nome li $v0, 4 #stampa di una stringa la $a0, risposta #caricamento stringa da stampare syscall #stampa "Bread Pitt" li $v0, 4 #stampa di una stringa la $a0, rispostadue #caricamento stringa da stampare syscall li $v0, 10 #exit syscall #termina programma .data stringauno: .asciiz "Come ti chiami? " risposta: .asciiz "Bread Pitt" buffer: .space 100 rispostadue: .asciiz "See mo sullo SPIM ce mette mano pure Bread Pitt" MI DITE SE E' GIUSTO? grazie |
![]() |
![]() |
![]() |
#2 |
Junior Member
Iscritto dal: Dec 2006
Messaggi: 15
|
a vederlo a occhio sembrerebbe giusto...ma non potresti provarlo sul simulatore spim?
|
![]() |
![]() |
![]() |
#3 |
Junior Member
Iscritto dal: Mar 2007
Messaggi: 15
|
ho installato pcspim ma non riesco a farlo funzionare
|
![]() |
![]() |
![]() |
#4 |
Junior Member
Iscritto dal: Mar 2007
Messaggi: 15
|
PUOI DIRMI SE E' GIUSTO ANCHE QUESTO? E' L'ULTIMO
NEL LINK C'è LA TRACCIA(E' LA NUMERO 2) http://it.geocities.com/fliberat/arch2/marzo1.htm .text .globl main main: lw $t2,x verifica: rem $t3,$t2,10 beqz $t3,end add $t2,$t2,1 j verifica end: add $t0,$t2,1 sw $t0,y la $t1,y break .data x: .word 38 y: .word 0 |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 22:21.