#// A swap that does work.
#void swap( int *x, int *y ) {  x in $a0,  y in $a1
#  int temp;    temp in $t0
#
.text
	j main
swap:
#  temp = *x;
	lw $t0,($a0)
	
#  * x = * y;
	lw $t1,($a1)
	sw $t1,($a0)
	
#  y = * temp;
	sw $t0,($a1)
#}
	jr   $ra
#
#int main( int argc, char * argv[] ) {   argc in $a0,  argv in $a1
#
.data
#  int a = 10;
a:    .word	10
#  int b = 100;
b:    .word	100

#
.text
	

#  swap( a, b );
main:	la	$a0,a
	la	$a1,b
	jal	swap
#
#  printf( "a = %d, b = %d\n", a, b );
	li	$v0,4
	la	$a0,aMess
	syscall
	
	li      $v0,1
	lw      $a0,a
	syscall
	
	li	$v0,4
	la	$a0,bMess
	syscall
	
	li	$v0,1
	lw	$a0,b
	syscall
	
	li	$v0,4
	la	$a0,newLine
	syscall
	
	li	$v0,10
	syscall
	
.data
aMess:	.asciiz "a = "

bMess: 	.asciiz " b = "

newLine: .asciiz "\n"
#
#}
