# Assembler # - Uso delle syscall in QtSpim ----------------------------------------------------------------------------- | | Code | Arguments | Result ----------------------------------------------------------------------------- | print integer | 1 | $a0 = value | (none) ------------------------------------------------------------------------------ | print string | 4 | $a0 = address of string | (none) ------------------------------------------------------------------------------ | read integer | 5 | (none) | $v0 = value ------------------------------------------------------------------------------ | read string | 8 | $a0 = addr. for string buf. | | | | $a1 = #chars to read + 1 | (none) ------------------------------------------------------------------------------ | exit (end of program) | 10 | (none) | (none) ------------------------------------------------------------------------------ | print character | 11 | $a0 = integer | (none) ------------------------------------------------------------------------------ | read character | 12 | (none) | $v0 = char ------------------------------------------------------------------------------ - Esempio: ``` add $a0, $t0, $t1 # $a0 = x + y addi $v0, $zero, 1 # carica codice print integer syscall ``` - Discussione su esercizio 3 # C # - Discussione esercizio 13