Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Disassembly Listing for messingWithRTOS
- Generated From:
- --- D:/Documents/MPLABXProjects/messingWithRTOS.X/main.c ----------------------------------------------
- 1: /*
- 2: * File: main.c
- 3: * Author: abdullah
- 4: *
- 5: * Created on 10 Haziran 2012 Pazar, 14:43
- 6: */
- 7: #include <xc.h> // Include the header file needed by the compiler
- 8: __CONFIG(FOSC_INTOSCIO & WDTE_OFF & PWRTE_ON & MCLRE_OFF & CP_OFF & IOSCFS_4MHZ & BOREN_ON);
- 9: /*
- 10: * INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN
- 11: * WDT disabled and can be enabled by SWDTEN bit of the WDTCON register
- 12: * PWRT enabled
- 13: * MCLR pin function is digital input, MCLR internally tied to VDD
- 14: * Program memory code protection is disabled
- 15: * Internal Oscillator Frequency Select bit : 4MHz
- 16: * Brown-out Reset Selection bits : BOR enabled
- 17: */
- 18:
- 19: /*
- 20: * OS_initializeTask(); definition will copy the PCLATH register to the task's PCLATH , which is held in taskx.pch
- 21: * This will help us hold the PCLATH at the point we yield.
- 22: * After that, it will copy the (PCL register + 8) to current task's PCL which is held in taskx.pcl.
- 23: * 8 is added to PCL because this line plus the "return" takes 8 instructions.
- 24: * We will set the PCL after these instructions, because
- 25: * we want to be in the point after OS_initializeTask when we come back to this task.
- 26: * After all, the function returns without doing anything more. This will initialize the task's PCLATH and PCL.
- 27: */
- 28: #define numberOfTasks 2
- 29: #define OS_initializeTask(x); tasks[x].pch = PCLATH;\
- 30: tasks[x].pcl = PCL + 6;\
- 31: asm("return");
- 32:
- 33: /*
- 34: * OS_yield(); definition will do the same stuff that OS_initializeTask(); definition do, however
- 35: * it will return to "taskswitcher" label, which is the start of OS_runTasks(); definition.
- 36: */
- 37:
- 38: #define OS_yield(x); tasks[x].pch = PCLATH;\
- 39: tasks[x].pcl = PCL + 6;\
- 40: asm("goto _taskswitcher");
- 41:
- 42: /*
- 43: * OS_runTasks(); definition will set the "taskswitcher" label. After that it will change the
- 44: * current task to the next task, by pointing the next item in the linked list of "TCB"s.
- 45: * After that, it will change the PCLATH and PCL registers with the current task's. That will
- 46: * make the program continue the next task from the place it left last time.
- 47: */
- 48:
- 49: #define OS_runTasks(); asm("_taskswitcher");\
- 50: ++currentTask;\
- 51: if (currentTask > (numberOfTasks - 1))currentTask = 0; \
- 52: PCLATH = tasks[currentTask].pch; \
- 53: PCL = tasks[currentTask].pcl;
- 54:
- 55: typedef struct _TCB // Create task control block and type define it as "TCB"
- 56: {
- 57: unsigned char pch; // pch register will hold the PCLATH value of the task after the last yield.
- 58: unsigned char pcl; // pcl register will hold the PCL value of the task after the last yield.
- 59: } TCB;
- 60:
- 61: unsigned char currentTask = 0; // This TCB pointer will point to the current task's TCB.
- 62:
- 63: TCB tasks[2]; // Define the TCB for task1 and task2.
- 64:
- 65: void fTask1(void); // Prototype the function for task1.
- 66: void fTask2(void); // Prototype the function for task2.
- 67:
- 68: void main(void)
- 69: {
- 70: TRISA = 0; // Set all of the PORTA pins as outputs.
- 07D8 1683 BSF STATUS, 0x5
- 07D9 0185 CLRF PORTA
- 71: TRISC = 0; // Set all of the PORTC pins as outputs.
- 07DA 0187 CLRF PORTC
- 72: ANSEL = 0; // Set all of the analog input pins as digital i/o.
- 07DB 0191 CLRF TMR2
- 73: PORTA = 0; // Clear PORTA bits.
- 07DC 1283 BCF STATUS, 0x5
- 07DD 0185 CLRF PORTA
- 74: PORTC = 0; // Clear PORTC bits.
- 07DE 0187 CLRF PORTC
- 75:
- 76: /*
- 77: * Before running the tasks, we should initialize the PCL and PCLATH registers for the tasks.
- 78: * In order to do this, we could have looked up the absolute address with a function pointer.
- 79: * However, it seems like this is not possible with this compiler (or all the x16 PICs?)
- 80: * What this compiler creates is a table of the addresses of the functions and a bunch of GOTOs.
- 81: * This will not let us get the absolute address of the function by doing something like:
- 82: * "currentTask->pcl=low(functionpointer);"
- 83: */
- 84: fTask1(); // Run task1 so that we get the address of it and initialize pch and pcl registers.
- 07DF 27B9 CALL 0x7B9
- 85: currentTask = currentTask++; // Point the currentTask pointer to the next pointer which
- 07E0 3001 MOVLW 0x1
- 07E1 00F6 MOVWF 0x76
- 07E2 0876 MOVF 0x76, W
- 07E3 07F4 ADDWF currentTask, F
- 86: fTask2(); // is task2. And run task2 so that we get the correct pch and pcl.
- 07E4 279A CALL 0x79A
- 87:
- 88: //OS_runTasks(); // Task switcher. See the comments in the definitions above.
- 89: asm("_taskswitcher");
- 90: ++currentTask;
- 07E5 3001 MOVLW 0x1
- 07E6 00F6 MOVWF 0x76
- 07E7 0876 MOVF 0x76, W
- 07E8 07F4 ADDWF currentTask, F
- 91: if (currentTask == 2)currentTask = 0;
- 07E9 0874 MOVF currentTask, W
- 07EA 3A02 XORLW 0x2
- 07EB 1D03 BTFSS STATUS, 0x2
- 07EC 2FEE GOTO 0x7EE
- 07ED 2FEF GOTO 0x7EF
- 07EE 2FF1 GOTO 0x7F1
- 07EF 01F4 CLRF currentTask
- 07F0 2FF1 GOTO 0x7F1
- 92: PCLATH = tasks[currentTask].pch;
- 07F1 0874 MOVF currentTask, W
- 07F2 00F6 MOVWF 0x76
- 07F3 0776 ADDWF 0x76, W
- 07F4 3E70 ADDLW 0x70
- 07F5 0084 MOVWF FSR
- 07F6 0800 MOVF INDF, W
- 07F7 1283 BCF STATUS, 0x5
- 07F8 008A MOVWF PCLATH
- 93: PCL = tasks[currentTask].pcl;
- 07F9 1403 BSF STATUS, 0x0
- 07FA 0D74 RLF currentTask, W
- 07FB 3E70 ADDLW 0x70
- 07FC 0084 MOVWF FSR
- 07FD 0800 MOVF INDF, W
- 07FE 0082 MOVWF PCL
- 94: }
- 95:
- 96: void fTask1(void)
- 97: {
- 98: //OS_initializeTask(0); // Initialize the task
- 99: tasks[0].pch = PCLATH;
- 07B9 1283 BCF STATUS, 0x5
- 07BA 080A MOVF PCLATH, W
- 07BB 00F5 MOVWF 0x75
- 07BC 0875 MOVF 0x75, W
- 07BD 00F0 MOVWF tasks
- 100: tasks[0].pcl = PCL + 6;
- 07BE 0802 MOVF PCL, W
- 07BF 3E06 ADDLW 0x6
- 07C0 00F5 MOVWF 0x75
- 07C1 0875 MOVF 0x75, W
- 07C2 00F1 MOVWF 0x71
- 101: asm("return");
- 07C3 0008 RETURN
- 07C4 2FC5 GOTO 0x7C5
- 102:
- 103: while (1)
- 07D6 2FC5 GOTO 0x7C5
- 104: {
- 105: PORTA = 0xAA; // Toggle PORTA.0
- 07C5 30AA MOVLW 0xAA
- 07C6 1283 BCF STATUS, 0x5
- 07C7 0085 MOVWF PORTA
- 106: //OS_yield(0); // Yield
- 107: tasks[0].pch = PCLATH;
- 07C8 080A MOVF PCLATH, W
- 07C9 00F5 MOVWF 0x75
- 07CA 0875 MOVF 0x75, W
- 07CB 00F0 MOVWF tasks
- 108: tasks[0].pcl = PCL + 6;
- 07CC 0802 MOVF PCL, W
- 07CD 3E06 ADDLW 0x6
- 07CE 00F5 MOVWF 0x75
- 07CF 0875 MOVF 0x75, W
- 07D0 00F1 MOVWF 0x71
- 109: asm("goto _taskswitcher");
- 07D1 2FE5 GOTO 0x7E5
- 110:
- 111: PORTA = 0x55; // Toggle PORTA.0
- 07D2 3055 MOVLW 0x55
- 07D3 1283 BCF STATUS, 0x5
- 07D4 0085 MOVWF PORTA
- 07D5 2FC5 GOTO 0x7C5
- 112: }
- 113: }
- 07D7 0008 RETURN
- 114:
- 115: void fTask2(void)
- 116: {
- 117: //OS_initializeTask(1); // Initialize the task
- 118: tasks[1].pch = PCLATH;
- 079A 1283 BCF STATUS, 0x5
- 079B 080A MOVF PCLATH, W
- 079C 00F5 MOVWF 0x75
- 079D 0875 MOVF 0x75, W
- 079E 00F2 MOVWF 0x72
- 119: tasks[1].pcl = PCL + 6;
- 079F 0802 MOVF PCL, W
- 07A0 3E06 ADDLW 0x6
- 07A1 00F5 MOVWF 0x75
- 07A2 0875 MOVF 0x75, W
- 07A3 00F3 MOVWF 0x73
- 120: asm("return");
- 07A4 0008 RETURN
- 07A5 2FA6 GOTO 0x7A6
- 121:
- 122: while (1)
- 07B7 2FA6 GOTO 0x7A6
- 123: {
- 124: PORTC = 0xAA; // Toggle PORTA.1
- 07A6 30AA MOVLW 0xAA
- 07A7 1283 BCF STATUS, 0x5
- 07A8 0087 MOVWF PORTC
- 125: OS_yield(1); // Yield
- 07A9 080A MOVF PCLATH, W
- 07AA 00F5 MOVWF 0x75
- 07AB 0875 MOVF 0x75, W
- 07AC 00F2 MOVWF 0x72
- 07AD 0802 MOVF PCL, W
- 07AE 3E06 ADDLW 0x6
- 07AF 00F5 MOVWF 0x75
- 07B0 0875 MOVF 0x75, W
- 07B1 00F3 MOVWF 0x73
- 07B2 2FE5 GOTO 0x7E5
- 126: PORTC = 0x55; // Toggle PORTA.1
- 07B3 3055 MOVLW 0x55
- 07B4 1283 BCF STATUS, 0x5
- 07B5 0087 MOVWF PORTC
- 07B6 2FA6 GOTO 0x7A6
- 127: }
- 128: }
- 07B8 0008 RETURN
- --- D:/Documents/MPLABXProjects/messingWithRTOS.X/dist/default/production/messingWithRTOS.X.production.as
- 1: opt subtitle "HI-TECH Software Omniscient Code Generator (Lite mode) build 12136"
- 2:
- 3: opt pagewidth 120
- 4:
- 5: opt lm
- 6:
- 7: processor 16F616
- 8: clrc macro
- 9: bcf 3,0
- 10: endm
- 11: clrz macro
- 12: bcf 3,2
- 13: endm
- 14: setc macro
- 15: bsf 3,0
- 16: endm
- 17: setz macro
- 18: bsf 3,2
- 19: endm
- 20: skipc macro
- 21: btfss 3,0
- 22: endm
- 23: skipz macro
- 24: btfss 3,2
- 25: endm
- 26: skipnc macro
- 27: btfsc 3,0
- 28: endm
- 29: skipnz macro
- 30: btfsc 3,2
- 31: endm
- 32: indf equ 0
- 33: indf0 equ 0
- 34: pc equ 2
- 35: pcl equ 2
- 36: status equ 3
- 37: fsr equ 4
- 38: fsr0 equ 4
- 39: c equ 1
- 40: z equ 0
- 41: pclath equ 10
- 42: # 8 "main.c"
- 43: psect config,class=CONFIG,delta=2 ;#
- 44: # 8 "main.c"
- 45: dw 0xFFFC & 0xFFF7 & 0xFFEF & 0xFFDF & 0xFFFF & 0xFF7F & 0xFFFF ;#
- 46: FNCALL _main,_fTask1
- 47: FNCALL _main,_fTask2
- 48: FNROOT _main
- 49: global _tasks
- 50: global _currentTask
- 51: global _PCL
- 52: _PCL set 0x2
- 53: global _PCLATH
- 54: _PCLATH set 0xA
- 55: global _PORTA
- 56: _PORTA set 0x5
- 57: global _PORTC
- 58: _PORTC set 0x7
- 59: global _ANSEL
- 60: _ANSEL set 0x91
- 61: global _TRISA
- 62: _TRISA set 0x85
- 63: global _TRISC
- 64: _TRISC set 0x87
- 65: psect text36,local,class=CODE,delta=2,merge=1
- 66: global __ptext36
- 67: __ptext36:
- 68: file "dist/default/production\messingWithRTOS.X.production.as"
- 69: line #
- 70: psect cinit,class=CODE,delta=2
- 71: global start_initialization
- 72: start_initialization:
- 73:
- 74: psect bssCOMMON,class=COMMON,space=1
- 75: global __pbssCOMMON
- 76: __pbssCOMMON:
- 77: _tasks:
- 78: ds 4
- 79:
- 80: _currentTask:
- 81: ds 1
- 82:
- 83: ; Clear objects allocated to COMMON
- 84: psect cinit,class=CODE,delta=2,merge=1
- 85: clrf ((__pbssCOMMON)+0)&07Fh
- 0793 01F0 CLRF tasks
- 86: clrf ((__pbssCOMMON)+1)&07Fh
- 0794 01F1 CLRF 0x71
- 87: clrf ((__pbssCOMMON)+2)&07Fh
- 0795 01F2 CLRF 0x72
- 88: clrf ((__pbssCOMMON)+3)&07Fh
- 0796 01F3 CLRF 0x73
- 89: clrf ((__pbssCOMMON)+4)&07Fh
- 0797 01F4 CLRF currentTask
- 90: psect cinit,class=CODE,delta=2,merge=1
- 91: global end_of_initialization
- 92:
- 93: ;End of C runtime variable initialization code
- 94:
- 95: end_of_initialization:
- 96: clrf status
- 0798 0183 CLRF STATUS
- 97: ljmp _main ;jump to C main() function
- 0799 2FD8 GOTO 0x7D8
- 98: psect cstackCOMMON,class=COMMON,space=1
- 99: global __pcstackCOMMON
- 100: __pcstackCOMMON:
- 101: global ?_fTask1
- 102: ?_fTask1: ; 0 bytes @ 0x0
- 103: global ??_fTask1
- 104: ??_fTask1: ; 0 bytes @ 0x0
- 105: global ?_fTask2
- 106: ?_fTask2: ; 0 bytes @ 0x0
- 107: global ??_fTask2
- 108: ??_fTask2: ; 0 bytes @ 0x0
- 109: global ?_main
- 110: ?_main: ; 0 bytes @ 0x0
- 111: ds 1
- 112: global ??_main
- 113: ??_main: ; 0 bytes @ 0x1
- 114: ds 1
- 115: ;!
- 116: ;!Data Sizes:
- 117: ;! Strings 0
- 118: ;! Constant 0
- 119: ;! Data 0
- 120: ;! BSS 5
- 121: ;! Persistent 0
- 122: ;! Stack 0
- 123: ;!
- 124: ;!Auto Spaces:
- 125: ;! Space Size Autos Used
- 126: ;! COMMON 14 2 7
- 127: ;! BANK0 80 0 0
- 128: ;! BANK1 32 0 0
- 129:
- 130: ;!
- 131: ;!Pointer List with Targets:
- 132: ;!
- 133: ;! None.
- 134:
- 135:
- 136: ;!
- 137: ;!Critical Paths under _main in COMMON
- 138: ;!
- 139: ;! _main->_fTask1
- 140: ;! _main->_fTask2
- 141: ;!
- 142: ;!Critical Paths under _main in BANK0
- 143: ;!
- 144: ;! None.
- 145: ;!
- 146: ;!Critical Paths under _main in BANK1
- 147: ;!
- 148: ;! None.
- 149:
- 150: ;;
- 151: ;;Main: autosize = 0, tempsize = 1, incstack = 0, save=0
- 152: ;;
- 153:
- 154: ;!
- 155: ;!Call Graph Tables:
- 156: ;!
- 157: ;! ---------------------------------------------------------------------------------
- 158: ;! (Depth) Function Calls Base Space Used Autos Params Refs
- 159: ;! ---------------------------------------------------------------------------------
- 160: ;! (0) _main 1 1 0 0
- 161: ;! 1 COMMON 1 1 0
- 162: ;! _fTask1
- 163: ;! _fTask2
- 164: ;! ---------------------------------------------------------------------------------
- 165: ;! (1) _fTask1 1 1 0 0
- 166: ;! 0 COMMON 1 1 0
- 167: ;! ---------------------------------------------------------------------------------
- 168: ;! (1) _fTask2 1 1 0 0
- 169: ;! 0 COMMON 1 1 0
- 170: ;! ---------------------------------------------------------------------------------
- 171: ;! Estimated maximum stack depth 1
- 172: ;! ---------------------------------------------------------------------------------
- 173: ;!
- 174: ;! Call Graph Graphs:
- 175: ;!
- 176: ;! _main (ROOT)
- 177: ;! _fTask1
- 178: ;! _fTask2
- 179: ;!
- 180:
- 181: ;! Address spaces:
- 182:
- 183: ;!Name Size Autos Total Cost Usage
- 184: ;!BITCOMMON E 0 0 0 0.0%
- 185: ;!NULL 0 0 0 0 0.0%
- 186: ;!CODE 0 0 0 0 0.0%
- 187: ;!COMMON E 2 7 1 50.0%
- 188: ;!BITSFR0 0 0 0 1 0.0%
- 189: ;!SFR0 0 0 0 1 0.0%
- 190: ;!BITSFR1 0 0 0 2 0.0%
- 191: ;!SFR1 0 0 0 2 0.0%
- 192: ;!STACK 0 0 1 2 0.0%
- 193: ;!BITBANK0 50 0 0 3 0.0%
- 194: ;!BANK0 50 0 0 4 0.0%
- 195: ;!BANK1 20 0 0 5 0.0%
- 196: ;!ABS 0 0 7 6 0.0%
- 197: ;!BITBANK1 20 0 0 7 0.0%
- 198: ;!DATA 0 0 8 8 0.0%
- 199:
- 200: global _main
- 201:
- 202: ;; *************** function _main *****************
- 203: ;; Defined at:
- 204: ;; line 69 in file "main.c"
- 205: ;; Parameters: Size Location Type
- 206: ;; None
- 207: ;; Auto vars: Size Location Type
- 208: ;; None
- 209: ;; Return value: Size Location Type
- 210: ;; None void
- 211: ;; Registers used:
- 212: ;; wreg, fsr0l, fsr0h, status,2, status,0, pclath, cstack
- 213: ;; Tracked objects:
- 214: ;; On entry : 17F/0
- 215: ;; On exit : 0/0
- 216: ;; Unchanged: 0/0
- 217: ;; Data sizes: COMMON BANK0 BANK1
- 218: ;; Params: 0 0 0
- 219: ;; Locals: 0 0 0
- 220: ;; Temps: 1 0 0
- 221: ;; Totals: 1 0 0
- 222: ;;Total ram usage: 1 bytes
- 223: ;; Hardware stack levels required when called: 1
- 224: ;; This function calls:
- 225: ;; _fTask1
- 226: ;; _fTask2
- 227: ;; This function is called by:
- 228: ;; Startup code after reset
- 229: ;; This function uses a non-reentrant model
- 230: ;;
- 231: psect maintext,global,class=CODE,delta=2,split=1
- 232: global __pmaintext
- 233: __pmaintext:
- 234: psect maintext
- 235: file "main.c"
- 236: line 69
- 237: global __size_of_main
- 238: __size_of_main equ __end_of_main-_main
- 239:
- 240: _main:
- 241: opt stack 7
- 242: ; Regs used in _main: [wreg-fsr0h+status,2+status,0+pclath+cstack]
- 243: line 70
- 244:
- 245: l431:
- 246: ;main.c: 70: TRISA = 0;
- 247: bsf status, 5 ;RP0=1, select bank1
- 248: clrf (133)^080h ;volatile
- 249: line 71
- 250: ;main.c: 71: TRISC = 0;
- 251: clrf (135)^080h ;volatile
- 252: line 72
- 253: ;main.c: 72: ANSEL = 0;
- 254: clrf (145)^080h ;volatile
- 255: line 73
- 256: ;main.c: 73: PORTA = 0;
- 257: bcf status, 5 ;RP0=0, select bank0
- 258: clrf (5) ;volatile
- 259: line 74
- 260: ;main.c: 74: PORTC = 0;
- 261: clrf (7) ;volatile
- 262: line 84
- 263:
- 264: l433:
- 265: ;main.c: 85: currentTask = currentTask++;
- 266: fcall _fTask1
- 267: line 85
- 268:
- 269: l435:
- 270: movlw (01h)
- 271: movwf (??_main+0)+0
- 272: movf (??_main+0)+0,w
- 273: addwf (_currentTask),f
- 274: line 86
- 275:
- 276: l437:
- 277: ;main.c: 86: fTask2();
- 278: fcall _fTask2
- 279: line 89
- 280: # 89 "main.c"
- 281: _taskswitcher ;#
- 282: psect maintext
- 283: line 90
- 284:
- 285: l439:
- 286: ;main.c: 90: ++currentTask;
- 287: movlw (01h)
- 288: movwf (??_main+0)+0
- 289: movf (??_main+0)+0,w
- 290: addwf (_currentTask),f
- 291: line 91
- 292:
- 293: l441:
- 294: ;main.c: 91: if (currentTask == 2)currentTask = 0;
- 295: movf (_currentTask),w
- 296: xorlw 02h
- 297: skipz
- 298: goto u11
- 299: goto u10
- 300: u11:
- 301: goto l445
- 302: u10:
- 303:
- 304: l443:
- 305: clrf (_currentTask)
- 306: goto l445
- 307:
- 308: l25:
- 309: line 92
- 310:
- 311: l445:
- 312: ;main.c: 92: PCLATH = tasks[currentTask].pch;
- 313: movf (_currentTask),w
- 314: movwf (??_main+0)+0
- 315: addwf (??_main+0)+0,w
- 316: addlw _tasks&0ffh
- 317: movwf fsr0
- 318: movf indf,w
- 319: bcf status, 5 ;RP0=0, select bank0
- 320: movwf (10) ;volatile
- 321: line 93
- 322: ;main.c: 93: PCL = tasks[currentTask].pcl;
- 323: setc
- 324: rlf (_currentTask),w
- 325: addlw _tasks&0ffh
- 326: movwf fsr0
- 327: movf indf,w
- 328: movwf (2) ;volatile
- 329: line 94
- 330:
- 331: l26:
- 332: global start
- 333: ljmp start
- 334: opt stack 0
- 335: GLOBAL __end_of_main
- 336: __end_of_main:
- 337: signat _main,88
- 338: global _fTask1
- 339:
- 340: ;; *************** function _fTask1 *****************
- 341: ;; Defined at:
- 342: ;; line 97 in file "main.c"
- 343: ;; Parameters: Size Location Type
- 344: ;; None
- 345: ;; Auto vars: Size Location Type
- 346: ;; None
- 347: ;; Return value: Size Location Type
- 348: ;; None void
- 349: ;; Registers used:
- 350: ;; wreg, status,2, status,0
- 351: ;; Tracked objects:
- 352: ;; On entry : 0/0
- 353: ;; On exit : 0/0
- 354: ;; Unchanged: 0/0
- 355: ;; Data sizes: COMMON BANK0 BANK1
- 356: ;; Params: 0 0 0
- 357: ;; Locals: 0 0 0
- 358: ;; Temps: 1 0 0
- 359: ;; Totals: 1 0 0
- 360: ;;Total ram usage: 1 bytes
- 361: ;; Hardware stack levels used: 1
- 362: ;; This function calls:
- 363: ;; Nothing
- 364: ;; This function is called by:
- 365: ;; _main
- 366: ;; This function uses a non-reentrant model
- 367: ;;
- 368: psect text37,local,class=CODE,delta=2,merge=1
- 369: global __ptext37
- 370: __ptext37:
- 371: psect text37
- 372: file "main.c"
- 373: line 97
- 374: global __size_of_fTask1
- 375: __size_of_fTask1 equ __end_of_fTask1-_fTask1
- 376:
- 377: _fTask1:
- 378: opt stack 7
- 379: ; Regs used in _fTask1: [wreg+status,2+status,0]
- 380: line 99
- 381:
- 382: l411:
- 383: ;main.c: 99: tasks[0].pch = PCLATH;
- 384: bcf status, 5 ;RP0=0, select bank0
- 385: movf (10),w ;volatile
- 386: movwf (??_fTask1+0)+0
- 387: movf (??_fTask1+0)+0,w
- 388: movwf (_tasks)
- 389: line 100
- 390:
- 391: l413:
- 392: ;main.c: 100: tasks[0].pcl = PCL + 6;
- 393: movf (2),w ;volatile
- 394: addlw 06h
- 395: movwf (??_fTask1+0)+0
- 396: movf (??_fTask1+0)+0,w
- 397: movwf 0+(_tasks)+01h
- 398: line 101
- 399: # 101 "main.c"
- 400: return ;#
- 401: psect text37
- 402: goto l415
- 403: line 103
- 404: ;main.c: 103: while (1)
- 405:
- 406: l29:
- 407: line 105
- 408:
- 409: l415:
- 410: ;main.c: 104: {
- 411: ;main.c: 105: PORTA = 0xAA;
- 412: movlw (0AAh)
- 413: bcf status, 5 ;RP0=0, select bank0
- 414: movwf (5) ;volatile
- 415: line 107
- 416:
- 417: l417:
- 418: ;main.c: 107: tasks[0].pch = PCLATH;
- 419: movf (10),w ;volatile
- 420: movwf (??_fTask1+0)+0
- 421: movf (??_fTask1+0)+0,w
- 422: movwf (_tasks)
- 423: line 108
- 424:
- 425: l419:
- 426: ;main.c: 108: tasks[0].pcl = PCL + 6;
- 427: movf (2),w ;volatile
- 428: addlw 06h
- 429: movwf (??_fTask1+0)+0
- 430: movf (??_fTask1+0)+0,w
- 431: movwf 0+(_tasks)+01h
- 432: line 109
- 433: # 109 "main.c"
- 434: goto _taskswitcher ;#
- 435: psect text37
- 436: line 111
- 437: ;main.c: 111: PORTA = 0x55;
- 438: movlw (055h)
- 439: bcf status, 5 ;RP0=0, select bank0
- 440: movwf (5) ;volatile
- 441: goto l415
- 442: line 112
- 443:
- 444: l30:
- 445: line 103
- 446: goto l415
- 447:
- 448: l31:
- 449: line 113
- 450:
- 451: l32:
- 452: return
- 453: opt stack 0
- 454: GLOBAL __end_of_fTask1
- 455: __end_of_fTask1:
- 456: signat _fTask1,88
- 457: global _fTask2
- 458:
- 459: ;; *************** function _fTask2 *****************
- 460: ;; Defined at:
- 461: ;; line 116 in file "main.c"
- 462: ;; Parameters: Size Location Type
- 463: ;; None
- 464: ;; Auto vars: Size Location Type
- 465: ;; None
- 466: ;; Return value: Size Location Type
- 467: ;; None void
- 468: ;; Registers used:
- 469: ;; wreg, status,2, status,0
- 470: ;; Tracked objects:
- 471: ;; On entry : 0/0
- 472: ;; On exit : 0/0
- 473: ;; Unchanged: 0/0
- 474: ;; Data sizes: COMMON BANK0 BANK1
- 475: ;; Params: 0 0 0
- 476: ;; Locals: 0 0 0
- 477: ;; Temps: 1 0 0
- 478: ;; Totals: 1 0 0
- 479: ;;Total ram usage: 1 bytes
- 480: ;; Hardware stack levels used: 1
- 481: ;; This function calls:
- 482: ;; Nothing
- 483: ;; This function is called by:
- 484: ;; _main
- 485: ;; This function uses a non-reentrant model
- 486: ;;
- 487: psect text38,local,class=CODE,delta=2,merge=1
- 488: global __ptext38
- 489: __ptext38:
- 490: psect text38
- 491: file "main.c"
- 492: line 116
- 493: global __size_of_fTask2
- 494: __size_of_fTask2 equ __end_of_fTask2-_fTask2
- 495:
- 496: _fTask2:
- 497: opt stack 7
- 498: ; Regs used in _fTask2: [wreg+status,2+status,0]
- 499: line 118
- 500:
- 501: l421:
- 502: ;main.c: 118: tasks[1].pch = PCLATH;
- 503: bcf status, 5 ;RP0=0, select bank0
- 504: movf (10),w ;volatile
- 505: movwf (??_fTask2+0)+0
- 506: movf (??_fTask2+0)+0,w
- 507: movwf 0+(_tasks)+02h
- 508: line 119
- 509:
- 510: l423:
- 511: ;main.c: 119: tasks[1].pcl = PCL + 6;
- 512: movf (2),w ;volatile
- 513: addlw 06h
- 514: movwf (??_fTask2+0)+0
- 515: movf (??_fTask2+0)+0,w
- 516: movwf 0+(_tasks)+03h
- 517: line 120
- 518: # 120 "main.c"
- 519: return ;#
- 520: psect text38
- 521: goto l425
- 522: line 122
- 523: ;main.c: 122: while (1)
- 524:
- 525: l35:
- 526: line 124
- 527:
- 528: l425:
- 529: ;main.c: 123: {
- 530: ;main.c: 124: PORTC = 0xAA;
- 531: movlw (0AAh)
- 532: bcf status, 5 ;RP0=0, select bank0
- 533: movwf (7) ;volatile
- 534: line 125
- 535:
- 536: l427:
- 537: ;main.c: 125: ; tasks[1].pch = PCLATH; tasks[1].pcl = PCL + 6; asm("goto _taskswitcher");;
- 538: movf (10),w ;volatile
- 539: movwf (??_fTask2+0)+0
- 540: movf (??_fTask2+0)+0,w
- 541: movwf 0+(_tasks)+02h
- 542:
- 543: l429:
- 544: movf (2),w ;volatile
- 545: addlw 06h
- 546: movwf (??_fTask2+0)+0
- 547: movf (??_fTask2+0)+0,w
- 548: movwf 0+(_tasks)+03h
- 549: # 125 "main.c"
- 550: goto _taskswitcher ;#
- 551: psect text38
- 552: line 126
- 553: ;main.c: 126: PORTC = 0x55;
- 554: movlw (055h)
- 555: bcf status, 5 ;RP0=0, select bank0
- 556: movwf (7) ;volatile
- 557: goto l425
- 558: line 127
- 559:
- 560: l36:
- 561: line 122
- 562: goto l425
- 563:
- 564: l37:
- 565: line 128
- 566:
- 567: l38:
- 568: return
- 569: opt stack 0
- 570: GLOBAL __end_of_fTask2
- 571: __end_of_fTask2:
- 572: signat _fTask2,88
- 573: psect text39,local,class=CODE,delta=2,merge=1
- 574: global __ptext39
- 575: __ptext39:
- 576: global btemp
- 577: btemp set 07Eh
- 578:
- 579: DABS 1,126,2 ;btemp
- 580: global wtemp0
- 581: wtemp0 set btemp
- 582: end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement