Advertisement
Guest User

Untitled

a guest
Nov 5th, 2011
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # File:         demo1.asm
  2. # Written by:   Yeukhon Wong, October 31, 2011
  3. # Version:      1
  4. #
  5. #   This file contains MIPS assembly instructions. Tested under Windows 7 and QtSpim 9.14
  6. #
  7. #   This is a demo file for CSC 342, under the teaching of Professor Gertner.
  8. #
  9.                
  10.     .data
  11.     str1: .asciiz "A"
  12.     str2: .asciiz "1"
  13.     myInt:
  14.           .word 42      # allocate an integer word: 42
  15.     myChar:
  16.           .word 'Q'     # allocate a char word
  17.    
  18.     .text    
  19.     .align 2
  20.     .globl main
  21.    
  22. main:
  23.     lw          $t0, myInt          # load myInt into register $t0
  24.     lw      $t3, str1           # load str1 into register $t3
  25.     lw      $t4, str2           # load str2 into register $t4
  26.    
  27.     la      $a0, str1           # load address str2
  28.     la      $a0, str2           # load address str1
  29.  
  30.     la      $a0, str2           # load address str2
  31.     la      $a0, str1           # load address str1
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement