.text
	j main
	
##include <stdio.h>
#
#// Print a string one character per line
#void printDown( char arg[] ) {   &arg in $a0 must be moved to $t0
printDown:
	move $t0,$a0
#  int p;     use $t1 for p

#  for ( p = 0; arg[p]; p++ ) {
	li	$t1,0
printLoopStart:
	add	$a0,$t1,$t0       #use a0 to prep for printf
	lb	$a0,($a0)
	beq	$a0,$0,printLoopEnd
	
#    printf( "%c\n", arg[p] );
	li	$v0,11
	syscall
	li	$v0,4
	la	$a0,newLine
	syscall
	
	addi	$t1,$t1,1
	j	printLoopStart
printLoopEnd:
	jr	$ra
#  }
#}
#
#
#// This program takes a single argument and prints its text
#// in a vertical column on the screen
#int main( int argc, char * argv[] ) {    argv in $a1
main:
#  printDown( argv[0] );      # print 0th arg for MARS
	lw	$a0,($a1)
	jal	printDown
#}	
	li	$v0,10
	syscall

.data
newLine: .asciiz "\n"