Advertisement
Guest User

Untitled

a guest
Nov 5th, 2011
238
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. # I just added myCharB
  12.     myCharB:
  13.           .word 'Q'     # allocate a char word
  14.     str1: .asciiz "A"
  15.     str2: .asciiz "1"
  16.     myInt:
  17.           .word 42      # allocate an integer word: 42
  18.     myChar:
  19.           .word 'Q'     # allocate a char word
  20.    
  21.     .text    
  22.     .align 2
  23.     .globl main
  24.    
  25. main:
  26.     lw          $t0, myInt          # load myInt into register $t0
  27.     lw      $t3, str1           # load str1 into register $t3
  28.     lw      $t4, str2           # load str2 into register $t4
  29.    
  30.     la      $a0, str1           # load address str2
  31.     la      $a0, str2           # load address str1
  32.  
  33.     la      $a0, str2           # load address str2
  34.     la      $a0, str1           # load address str1
  35.  
  36.  
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement