TMS320C2000 Evaluation Assembler PC v5.2.6 Wed Feb 09 14:48:37 2011

Tools Copyright (c) 1996-2010 Texas Instruments Incorporated
../Lab3e.asm                                                         PAGE    1

       1              ;Lab3 Part A
       2              ;Andrew Fowler
       3              ;Damian Szmulewicz Section: 3276
       4              ;Controls LED based on inputs
       5              
       6              
       7              ;*****************************************************************
       8              
       9              
      10              
      11                              .global         _c_int00
      12              
      13        A000  data_sect       .set            0xa000                  ;constant that is actually the starting addr of .data
      14        B000  bss_sect        .set            0xb000                  ;constant that is actually the starting addr of .bss 
      15        6F86  GPAMUX1         .set            0x6F86
      16        7029  WDCR            .set            0x7029
      17        6F8A  GPADIR          .set            0x6F8A
      18        6FC2  GPASET          .set            0x6FC2
      19        6FC0  GPADAT          .set            0x6FC0
      20        6FC6  GPATOGGLE       .set            0x6FC6
      21              ;*****************************************************************
      22              
      23 00000000                       .data                           
      24              
      25              ;char    .byte          '4'     ;define string, ASCII characters placed in memory as WORDS!
      26              
      27                          ;.bss               results,256     ;reserves 256 words at label 'results' in the .bss section   
      28                              
      29              ;               .global         char            ;.global directive lets you to see the assigned addresses in 
      30                              
      31              ;****************** Part A ***********************
      32 00000000                       .text                                   ; Program section, see the command linker file, progr
      33                                                                              ; should be placed in the text section which 
      34                                                              
      35 00000000       _c_int00:                                               ; This label tells the linker where the entry (starti
      36 00000000 7622                  EALLOW                                          ; Allow access to protected registers
      37 00000001 561F                  SETC    OBJMODE                         ; Allow 32 bit mov instructions
      38                                                                              ; WDCR is watchdog timer control register
      39                                                                              ; In constants section need to set WDCR=0x702
      40 00000002 9A68                  MOV     AL,#1101000b    ; Disable the watchdog timer.
      41                                                                              ; Must have 101 in bits 5, 4, 3 for
      42                                                                              ; any writes to WDCR. 1 in bit 6
      43                                                                              ; disables watchdog
      44 00000003 28A1                  MOV     AR1,#WDCR
         00000004 7029 
      45 00000005 96C1                  MOV             *AR1, AL                ; Disables watchdog timer
      46 00000006 9A00                  MOV             AL, #0x0000             ;Sets MUX to all input/output
      47 00000007 28A1                  MOV             AR1, #GPAMUX1
         00000008 6F86 
      48 00000009 96C1                  MOV             *AR1,AL
      49 0000000a 9AFF                  MOV             AL, #0x00FF             ;Sets GPIO to input and output (1=out)
      50 0000000b 28A1                  MOV             AR1, #GPADIR
         0000000c 6F8A 
      51 0000000d 96C1                  MOV             *AR1,AL
      52              
TMS320C2000 Evaluation Assembler PC v5.2.6 Wed Feb 09 14:48:37 2011

Tools Copyright (c) 1996-2010 Texas Instruments Incorporated
../Lab3e.asm                                                         PAGE    2

      53              ;*****************************************************************
      54              ; Part E main program 
      55                      
      56 0000000e       MainE   
      57                              
      58 0000000e 28A0  TestCond MOV            AR0, #GPADAT    ; Sets AR0 to the read the input register
         0000000f 6FC0 
      59 00000010 92C0                   MOV            AL, *AR0                ; Moves contents of GPADAT to accumulator
      60 00000011 FFCE                   LSR            AL, 15                  ; Shifts the 15th bit all the way to the end to 
      61                                                                                      ; see if the number is 1 or 0
      62 00000012 6003                   B                      StartL,NEQ              ; If not 0 (aka 1), go to Night rider
      63 00000013 6F35                   B                      loopc,UNC               ; else, go to input thing
      64                               
      65                              
      66                              
      67                                      
      68                              
      69                              
      70              ;**************************************************************
      71              ;Main night rider
      72 00000014 6FFA  StartL0 B               TestCond,UNC            ; CHecks to see if its Night Rider time or Input time
      73 00000015 9A00  StartL  MOV             AL, #0
      74 00000016 28A1                  MOV             AR1, #GPADAT
         00000017 6FC0 
      75 00000018 96C1                  MOV             *AR1, AL
      76 00000019 28A2                  MOV             AR2, #0x80                      ;Sets AR4 to be the light on the left
         0000001a 0080 
      77 0000001b 28A5                  MOV             AR5, #0x01                      ;Sets AR5 to be the light on the right
         0000001c 0001 
      78 0000001d 2BA0                  MOV             AR0, #0
      79 0000001e 6F0D                  B               QuarterLoop,UNC         ;Branches to turn the light on
      80 0000001f 7AA9  loopM   MOV             @AL,AR2                         ;Shifts the bit right so the next light will turn on
      81 00000020 FFC0                  LSR             AL,1
      82 00000021 96A2                  MOV             @AR2, AL
      83 00000022 7DA8                  MOV             @AH,AR5                         ;Shifts bit left one so the lefter light will
      84 00000023 FF90                  LSL             AH,1
      85 00000024 97A5                  MOV             @AR5, AH
      86 00000025 0AA0                  INC             AR0                                     ;Increment Coutner
      87 00000026 78A8                  MOV             @AH,AR0
      88 00000027 08A8                  SUB             AH,#7                           ;Subtract then compare the coutner with 7
         00000028 FFF9 
      89 00000029 61EB                  B               StartL0, EQ                     ;If the coutner has reached 7 go back to star
      90              ;               B               loopM, UNC                      ;made in QuarterLoop routine
      91 0000002a 6F01                  B               QuarterLoop,UNC         ;Branches to turn the light on
      92                              
      93                              
      94              ;***************************************************************
      95              ;Quarter Second Loop
      96              
      97              ; A "^" signifies the above comment is pertinent to this line
      98              
      99 0000002b       QuarterLoop
     100 0000002b 2BA6                  MOV             AR6, #0                 ; See part D for comments about timing
     101 0000002c 9A00                  MOV             AL, #0
     102 0000002d 28A3  loop25  MOV             AR3, #2
TMS320C2000 Evaluation Assembler PC v5.2.6 Wed Feb 09 14:48:37 2011

Tools Copyright (c) 1996-2010 Texas Instruments Incorporated
../Lab3e.asm                                                         PAGE    3

         0000002e 0002 
     103 0000002f 9B00                  MOV             AH,     #0      
     104 00000030 0AA9                  INC             AL
     105 00000031 74A3                  SUB             @AR3,AL
     106 00000032 6010                  B               loop125, NEQ
     107                              
     108 00000033 7AA9                  MOV             @AL, AR2                ;Sets the pin at AR4 true
     109 00000034 28A1                  MOV             AR1, #GPATOGGLE ; ^
         00000035 6FC6 
     110 00000036 96C1                  MOV             *AR1, AL                ; ^
     111 00000037 7DA9                  MOV             @AL, AR5                ;Sets the pin at AR5 true
     112 00000038 28A1                  MOV             AR1, #GPATOGGLE ; ^
         00000039 6FC6 
     113 0000003a 96C1                  MOV             *AR1, AL                ; ^
     114 0000003b 9A00                  MOV             AL, #0                  ;Resets AL
     115 0000003c 0AA6                  INC             AR6                             ;Increments counters and compares
     116 0000003d 7EA8                  MOV             @AH,AR6                 ; ^
     117 0000003e 08A8                  SUB             AH,#2                   ; ^
         0000003f FFFE 
     118 00000040 61DF                  B               loopM, EQ               ; go to main loop and turn on next lights
     119 00000041 6FEC                  B               loop25, UNC             ; else go to this loop again to turn off lights
     120                              
     121              
     122 00000042 28A4  loop125 MOV             AR4, #57344
         00000043 E000 
     123 00000044 0AA8                  INC             AH
     124 00000045 75A4                  SUB             @AR4,AH
     125 00000046 60FC                  B               loop125, NEQ
     126 00000047 6FE6                  B               loop25,UNC
     127              
     128              ;***************************************************************
     129              ;Read output
     130              
     131 00000048 92C0  loopc   MOV             AL, *AR0                ;Mvoes contents of GPADAT to accumulator
     132 00000049 FFC7                  LSR             AL, 8
     133 0000004a 28A1                  MOV             AR1, #GPADAT
         0000004b 6FC0 
     134 0000004c 96C1                  MOV             *AR1, AL
     135 0000004d 6FC1                  B               TestCond, UNC
     136              ;               B               loopc, UNC
     137                              
     138              ;
     139              ;*******************************************************************            
     140 0000004e 6F00  END1    B               END1,UNC                ; infinite loop to just keep us from trying to execute
     141                                                                              ; un-initialized (no program) memory. 
     142              

No Assembly Errors, No Assembly Warnings
