(SRCTools Version 3.1.1)
 HexLoc     DecLoc    MachWord   Label        Instruction                Comment
                                                                         ;
                                                                         ;	CPE 221 Assembly Example
                                                                         ;	
                                                                         ;	This program merges two sorted lists into one list.
                                                                         ;
                                                                         
                                              .org 200                   
                                size1:        .equ 15                    
                                size2:        .equ 15                    
                                size3:        .equ 40                    
                                                                         
000000c8  0000000200  ffffb1e0  array1:       .dc -20000, -3000, -386, -122, -44, -11, 1, 59, 267, 999, 1111, 2929, 3333, 3333, 11111  
000000cc  0000000204  fffff448
000000d0  0000000208  fffffe7e
000000d4  0000000212  ffffff86
000000d8  0000000216  ffffffd4
000000dc  0000000220  fffffff5
000000e0  0000000224  00000001
000000e4  0000000228  0000003b
000000e8  0000000232  0000010b
000000ec  0000000236  000003e7
000000f0  0000000240  00000457
000000f4  0000000244  00000b71
000000f8  0000000248  00000d05
000000fc  0000000252  00000d05
00000100  0000000256  00002b67
00000104  0000000260  ffff8ad0  array2:       .dc -30000, -19555, -12222, -8888, -555, -234, -88, 1, 3, 45, 88, 111, 192, 192, 212  
00000108  0000000264  ffffb39d
0000010c  0000000268  ffffd042
00000110  0000000272  ffffdd48
00000114  0000000276  fffffdd5
00000118  0000000280  ffffff16
0000011c  0000000284  ffffffa8
00000120  0000000288  00000001
00000124  0000000292  00000003
00000128  0000000296  0000002d
0000012c  0000000300  00000058
00000130  0000000304  0000006f
00000134  0000000308  000000c0
00000138  0000000312  000000c0
0000013c  0000000316  000000d4
00000140  0000000320  0000014d                .dc 333, 6666, 10000, 11000, 15622, 22312, 33333, 54321, 88976, 100022  
00000144  0000000324  00001a0a
00000148  0000000328  00002710
0000014c  0000000332  00002af8
00000150  0000000336  00003d06
00000154  0000000340  00005728
00000158  0000000344  00008235
0000015c  0000000348  0000d431
00000160  0000000352  00015b90
00000164  0000000356  000186b6
00000168  0000000360            array3:       .dw size3                  
                                                                         
                                orig:         .org 1000                  
000003e8  0000001000  37400078                lar r29, 2less             
000003ec  0000001004  3700007c                lar r28, incindex3         
000003f0  0000001008  36c00080                lar r27, finish1           
000003f4  0000001012  36800028                lar r26, check             
000003f8  0000001016  364000a4                lar r25, finish2           
000003fc  0000001020  360000cc                lar r24, done              
                                                                         
00000400  0000001024  32bffcc4                lar r10, array1            ; pointer to first element of array1
00000404  0000001028  32fffcfc                lar r11, array2            ; pointer to first element of array2
00000408  0000001032  333ffd5c                lar r12, array3            ; pointer to first element of array3
                                                                         
0000040c  0000001036  2840000f                la r1, size1               ; holds size of array1
00000410  0000001040  2880000f                la r2, size2               ; holds size of array2
00000414  0000001044  71084000                sub r4, r4, r4             ; r4 used to hold index1 into array1, initialize to 0
00000418  0000001048  714a5000                sub r5, r5, r5             ; r5 used to hold index2 into array2, initialize to 0
0000041c  0000001052  718c6000                sub r6, r6, r6             ; r6 used to hold index3 into array3, initialize to 0
00000420  0000001056  72481000  check:        sub r9, r4, r1             ; Check to see whether index1 < size1.
00000424  0000001060  40329004                brpl r25, r9               ; If not, done with array1, finish with entries from array2.
00000428  0000001064  724a2000                sub r9, r5, r2             ; Check to see whether index2 < size2.
0000042c  0000001068  40369004                brpl r27, r9               ; If not, done with array2, finish with entries from array1.
                                                                         
00000430  0000001072  e3480002  next:         shl r13, r4, 2             ; Multiply index1 by 4 to access entry in array1 by byte address.
00000434  0000001076  635aa000                add r13, r13, r10          ; Add index1 to base array1 pointer.
00000438  0000001080  09da0000                ld r7, 0(r13)              ; Load array1[index] into r7.
0000043c  0000001084  e34a0002                shl r13, r5, 2             ; Multiply index2 by 4 to access entry in array2 by byte address.
00000440  0000001088  635ab000                add r13, r13, r11          ; Add index2 to base array2 pointer.
00000444  0000001092  0a1a0000                ld r8, 0(r13)              ; Load array2[index] into r8.
00000448  0000001096  e34c0002                shl r13, r6, 2             ; Multiply index3 by 4 to access entry in array3 by byte address.
0000044c  0000001100  635ac000                add r13, r13, r12          ; Add index3 to base array3 pointer.
00000450  0000001104  724e8000                sub r9, r7, r8             ; Check to see whether array1[index1] < array2[index2]
00000454  0000001108  403a9004                brpl r29, r9               ; If not, branch to 2less.
00000458  0000001112  19da0000  1less:        st r7, 0(r13)              ; Set array3[index3] = array1[index1].
0000045c  0000001116  69080001                addi r4, r4, 1             ; Increment index1 to look at next element in array1.
00000460  0000001120  40380001                br r28                     ; Get ready to increment index3.
00000464  0000001124  1a1a0000  2less:        st r8, 0(r13)              ; Set array3[index3] = array2[index2].
00000468  0000001128  694a0001                addi r5, r5, 1             ; Increment index2 to look at next element in array2.
0000046c  0000001132  698c0001  incindex3:    addi r6, r6, 1             ; Increment index3.
00000470  0000001136  40340001                br r26                     ; Look at next pair of numbers.
                                                                         
00000474  0000001140  72481000  finish1:      sub r9, r4, r1             ; Check to see whether index1 < size1.
00000478  0000001144  40309004                brpl r24, r9               ; If not, done with array1.
0000047c  0000001148  e3480002                shl r13, r4, 2             ; Multiply index1 by 4 to access entry in arrray1 by byte address.
00000480  0000001152  635aa000                add r13, r13, r10          ; Add index1 to base array1 pointer.
00000484  0000001156  09da0000                ld r7, 0(r13)              ; Load array1[index1] into r7.
00000488  0000001160  e34c0002                shl r13, r6, 2             ; Multiple index3 by 4 to access entry in array3 by byte address.
0000048c  0000001164  635ac000                add r13, r13, r12          ; Add index3 to base array3 pointer.
00000490  0000001168  19da0000                st r7, 0(r13)              ; Set array3[index3] = array1[index1].
00000494  0000001172  69080001                addi r4, r4, 1             ; Increment index1.
00000498  0000001176  698c0001                addi r6, r6, 1             ; Increment index3.
0000049c  0000001180  40360001                br r27                     ; Look at next entry in array1.
                                                                         
000004a0  0000001184  724a2000  finish2:      sub r9, r5, r2             ; Check to see whether index2 < size2.
000004a4  0000001188  40309004                brpl r24, r9               ; If not, done with array2.
000004a8  0000001192  e34a0002                shl r13, r5, 2             ; Multiply index2 by 4 to access entry in array2 by byte address.
000004ac  0000001196  635ab000                add r13, r13, r11          ; Add index2 to base array2 pointer.
000004b0  0000001200  0a1a0000                ld r8, 0(r13)              ; Load array2[index2] into r8.
000004b4  0000001204  e34c0002                shl r13, r6, 2             ; Multiply index3 by 4 to access entry in array3 by byte address.
000004b8  0000001208  635ac000                add r13, r13, r12          ; Add index3 to base array3 pointer.
000004bc  0000001212  1a1a0000                st r8, 0(r13)              ; Set array3[index3] = array2[index2].
000004c0  0000001216  694a0001                addi r5, r5, 1             ; Increment index2.
000004c4  0000001220  698c0001                addi r6, r6, 1             ; Increment index3.
000004c8  0000001224  40320001                br r25                     ; Look at next entry in array2.
000004cc  0000001228  f8000000  done:         stop                       

--- Symbol Table ---
check: 1056
finish2: 1184
finish1: 1140
done: 1228
2less: 1124
next: 1072
1less: 1112
size3: 40
orig: 1000
size2: 15
size1: 15
array3: 360
array2: 260
incindex3: 1132
array1: 200
