Chapter 2 Apendix - la $a0, str # address of string to...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style 8/27/09 Chapter 2 Appendix
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8/27/09 Loads Load Immediate Load data register with constant Load Address Load address register with constant Move register li $s1, 10 # $s1 = 10 la $a0, 10 # $a0 = 10 move $s0, $t1 # $s0 = $t1
Background image of page 2
8/27/09 Input/Output Apdx A, pA.43 Service System Call Code (in $v0) Arguments Result print_int 1 $a0 = integer print_float 2 $f12 = float print_double 3 $f12 = double print_string 4 $a0 = string read_int 5 integer (in $v0) read_float 6 float (in $f0) read_doubl e 7 double (in $f0) read_string 8 $a0 = buffer, $a1 = length
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8/27/09 Input/Output Output String: li $v0, 4 # system call code for print_str
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: la $a0, str # address of string to print syscall # print the string • Output Integer: li $v0, 1 # system call code for print_int 8/27/09 Constants • Apdx A, pA.46 • .ascii str • .asciiz str • .byte b1,. .., bn • .double d1, . .., dn • .float f1,. .., fn • .word w1,. .., wn 8/27/09 Pseudoinstructions • Assemblers often provide pseudoinstructions to ease the pain • Pseudoinstructions – not implemented directly by hardware – translated to instructions implemented by hardware – ex. move $t0, $t1 translates to add $t0,...
View Full Document

This note was uploaded on 08/26/2009 for the course CS 312 taught by Professor Tornaritis,s during the Spring '08 term at Southern Illinois University Edwardsville.

Page1 / 6

Chapter 2 Apendix - la $a0, str # address of string to...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online