Last active
October 5, 2015 00:23
-
-
Save pathawks/cca541e8ccf8293da4f0 to your computer and use it in GitHub Desktop.
Revisions
-
pathawks revised this gist
Oct 5, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,21 +20,21 @@ main: li $t0 99 PrintAnotherVerse: move $a0 $t0 li $v0 1 syscall la $a0 Lyric1 li $v0 4 syscall move $a0 $t0 li $v0 1 syscall la $a0 Lyric2 li $v0 4 syscall addi $t0 $t0 -1 beq $t0 1 PrintLastVerse move $a0 $t0 li $v0 1 syscall la $a0 Lyric1 li $v0 4 -
pathawks created this gist
Oct 4, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ # filename: 99Bottles.s # author: Pat Hawks <[email protected]> .data Lyric1: .asciiz " bottles of beer on the wall\n" Lyric2: .ascii " bottles of beer\n" .asciiz "Take one down, Pass it around\n" Lyric3: .ascii "One last bottle of beer one the wall\n\n" .ascii "One last bottle of beer one the wall\n" .ascii "One last bottle of beer\n" .ascii "Take it down, Pass it around\n" .asciiz "No more bottles of beer one the wall\n" .text .globl main main: li $t0 99 PrintAnotherVerse: move $a0 $t0 li $v0 1 syscall la $a0 Lyric1 li $v0 4 syscall move $a0 $t0 li $v0 1 syscall la $a0 Lyric2 li $v0 4 syscall addi $t0 $t0 -1 beq $t0 1 PrintLastVerse move $a0 $t0 li $v0 1 syscall la $a0 Lyric1 li $v0 4 syscall li $a0 10 li $v0 11 syscall j PrintAnotherVerse PrintLastVerse: la $a0 Lyric3 li $v0 4 syscall li $v0 10 syscall