//////////////////////////////////////////////////////////////////////////////
//                                                                           /
// IAR ARM ANSI C/C++ Compiler V4.11A/W32              20/Jul/2004  18:58:47 /
// Copyright 1999-2004 IAR Systems. All rights reserved.                     /
//                                                                           /
//    Cpu mode        =  arm                                                 /
//    Endian          =  little                                              /
//    Stack alignment =  4                                                   /
//    Source file     =  C:\medusa\medusa.c                                  /
//    Command line    =  -I "C:\Program Files\IAR Systems\Embedded           /
//                       Workbench 4.0\ARM\INC\" -lc C:\medusa\Debug\List\   /
//                       -la C:\medusa\Debug\List\ -o C:\medusa\Debug\Obj\   /
//                       -s2 --no_cse --no_unroll --no_inline                /
//                       --no_code_motion --no_tbaa --no_clustering          /
//                       --no_scheduling --debug --cpu_mode arm --endian     /
//                       little --cpu ARM7TDMI-S --stack_align 4 -e --fpu    /
//                       None "-D_DLIB_CONFIG_FILE=C:\Program Files\IAR      /
//                       Systems\Embedded Workbench                          /
//                       4.0\ARM\LIB\dl4tpannl8n.h" C:\medusa\medusa.c       /
//    List file       =  C:\medusa\Debug\List\medusa.s79                     /
//                                                                           /
//                                                                           /
//////////////////////////////////////////////////////////////////////////////

        NAME medusa

        RTMODEL "ARMv4M", "USED"
        RTMODEL "StackAlign4", "USED"
        RTMODEL "__cpu_mode", "__pcs__arm"
        RTMODEL "__data_model", "absolute"
        RTMODEL "__endian", "little"
        RTMODEL "__rt_version", "6"

        RSEG CSTACK:DATA:NOROOT(2)

??DataTable0 EQU 0
??DataTable2 EQU 0
        PUBWEAK ?init?tab?DATA_Z
        PUBLIC medusaInit
        FUNCTION medusaInit,0203H
        PUBLIC medusaSetGreenLed
        FUNCTION medusaSetGreenLed,0203H
        PUBLIC medusaSetOrangeLed
        FUNCTION medusaSetOrangeLed,0203H
        PUBLIC medusaToggleGreenLed
        FUNCTION medusaToggleGreenLed,0203H
        LOCFRAME CSTACK, 4, STACK
        PUBLIC medusaToggleOrangeLed
        FUNCTION medusaToggleOrangeLed,0203H
        LOCFRAME CSTACK, 4, STACK
        
        CFI Names cfiNames0
        CFI StackFrame CFA R13 HUGEDATA
        CFI Resource R0:32, R1:32, R2:32, R3:32, R4:32, R5:32, R6:32, R7:32
        CFI Resource R8:32, R9:32, R10:32, R11:32, R12:32, CPSR:32, R13:32
        CFI Resource R14:32, SPSR:32
        CFI VirtualResource ?RET:32
        CFI EndNames cfiNames0
        
        CFI Common cfiCommon0 Using cfiNames0
        CFI CodeAlign 4
        CFI DataAlign 4
        CFI ReturnAddress ?RET CODE
        CFI CFA R13+0
        CFI R0 Undefined
        CFI R1 Undefined
        CFI R2 Undefined
        CFI R3 Undefined
        CFI R4 SameValue
        CFI R5 SameValue
        CFI R6 SameValue
        CFI R7 SameValue
        CFI R8 SameValue
        CFI R9 SameValue
        CFI R10 SameValue
        CFI R11 SameValue
        CFI R12 Undefined
        CFI CPSR SameValue
        CFI R14 Undefined
        CFI SPSR SameValue
        CFI ?RET R14
        CFI EndCommon cfiCommon0
        

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
greenLedState:
        DS8 4

        RSEG DATA_Z:DATA:SORT:NOROOT(2)
orangeLedState:
        DS8 4

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock0 Using cfiCommon0
        CFI Function medusaInit
   CODE32      
medusaInit:
   MOV         R0,#+0xE0000000
   ORR         R0,R0,#+0x2C000
   LDR         R1,??medusaInit_0  ;; 0x80005555
   STR         R1,[R0, #+0]
   MOV         R2,#+0xE0000004
   ORR         R2,R2,#+0x2C000
   MOV         R3,#+0x40000000
   ORR         R3,R3,#+0x15400000
   STR         R3,[R2, #+0]
   MOV         R12,#+0xE0000004
   ORR         R12,R12,#+0x28000
   MOV         R0,#+0xE00
   STR         R0,[R12, #+0]
   MOV         R1,#+0xE000000C
   ORR         R1,R1,#+0x28000
   MOV         R2,#+0x4000000
   ORR         R2,R2,#+0x3000
   STR         R2,[R1, #+0]
   MOV         R3,#+0xE0000008
   ORR         R3,R3,#+0x28000
   MOV         R12,#+0x4000000
   ORR         R12,R12,#+0x3E00
   STR         R12,[R3, #+0]
   MOV         R0,#+0x0
   MOV         PC,LR              ;; return
   DATA        
??medusaInit_0:
   DC32        0x80005555
        CFI EndBlock cfiBlock0

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock1 Using cfiCommon0
        CFI Function medusaSetGreenLed
   CODE32      
medusaSetGreenLed:
   CMP         R0,#+0x0
   BNE         ??medusaSetGreenLed_0
   MOV         R1,#+0xE000000C
   ORR         R1,R1,#+0x28000
   MOV         R2,#+0x2000
   STR         R2,[R1, #+0]
   B           ??medusaSetGreenLed_1
??medusaSetGreenLed_0:
   MOV         R3,#+0xE0000004
   ORR         R3,R3,#+0x28000
   MOV         R12,#+0x2000
   STR         R12,[R3, #+0]
??medusaSetGreenLed_1:
   LDR         R1,??DataTable1    ;; greenLedState
   STR         R0,[R1, #+0]
   MOV         PC,LR              ;; return
        CFI EndBlock cfiBlock1

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock2 Using cfiCommon0
        CFI Function medusaToggleGreenLed
   CODE32      
medusaToggleGreenLed:
   STMDB       SP!,{LR}           ;; Push
        CFI ?RET Frame(CFA, -4)
        CFI CFA R13+4
   LDR         R0,??DataTable1    ;; greenLedState
   LDR         R1,[R0, #+0]
   CMP         R1,#+0x1
   BNE         ??medusaToggleGreenLed_0
   MOV         R0,#+0x0
   B           ??medusaToggleGreenLed_1
??medusaToggleGreenLed_0:
   MOV         R0,#+0x1
??medusaToggleGreenLed_1:
   BL          medusaSetGreenLed
   LDMIA       SP!,{PC}           ;; return
        CFI EndBlock cfiBlock2

        RSEG CODE:CODE:NOROOT(2)
   DATA        
??DataTable1:
   DC32        greenLedState

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock3 Using cfiCommon0
        CFI Function medusaSetOrangeLed
   CODE32      
medusaSetOrangeLed:
   CMP         R0,#+0x0
   BNE         ??medusaSetOrangeLed_0
   MOV         R1,#+0xE000000C
   ORR         R1,R1,#+0x28000
   MOV         R2,#+0x1000
   STR         R2,[R1, #+0]
   B           ??medusaSetOrangeLed_1
??medusaSetOrangeLed_0:
   MOV         R3,#+0xE0000004
   ORR         R3,R3,#+0x28000
   MOV         R12,#+0x1000
   STR         R12,[R3, #+0]
??medusaSetOrangeLed_1:
   LDR         R1,??DataTable3    ;; orangeLedState
   STR         R0,[R1, #+0]
   MOV         PC,LR              ;; return
        CFI EndBlock cfiBlock3

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock4 Using cfiCommon0
        CFI Function medusaToggleOrangeLed
   CODE32      
medusaToggleOrangeLed:
   STMDB       SP!,{LR}           ;; Push
        CFI ?RET Frame(CFA, -4)
        CFI CFA R13+4
   LDR         R0,??DataTable3    ;; orangeLedState
   LDR         R1,[R0, #+0]
   CMP         R1,#+0x1
   BNE         ??medusaToggleOrangeLed_0
   MOV         R0,#+0x0
   B           ??medusaToggleOrangeLed_1
??medusaToggleOrangeLed_0:
   MOV         R0,#+0x1
??medusaToggleOrangeLed_1:
   BL          medusaSetOrangeLed
   LDMIA       SP!,{PC}           ;; return
        CFI EndBlock cfiBlock4

        RSEG CODE:CODE:NOROOT(2)
   DATA        
??DataTable3:
   DC32        orangeLedState

        RSEG INITTAB:CODE:ROOT(2)
   DATA
?init?tab?DATA_Z:
   DCD      sfe(DATA_Z) - sfb(DATA_Z), sfb(DATA_Z), sfb(DATA_Z)

        END
// 
// 304 bytes in segment CODE
//   8 bytes in segment DATA_Z
//  12 bytes in segment INITTAB
// 
// 304 bytes of CODE memory (+ 12 bytes shared)
//   8 bytes of DATA memory
//
//Errors: none
//Warnings: none
