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

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
8/27/09 Loads Load Immediate Load data register with constant Load Address Load address register with constant Move register Moves register data from one to another li $s1, 10 # $s1 = 10 la $a0, 10 # $a0 = 10 move $s0, $t1 # $s0 = $t1
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
Image of page 3

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

View Full Document Right Arrow Icon
8/27/09 Input/Output Output String: li $v0, 4
Image of page 4
Image of page 5

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern