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) @ 0x0099
- 69: {
- 70: TRISA = 0; // Set all of the PORTA pins as outputs.
- 0099 1683 BSF STATUS, 0x5
- 009A 0185 CLRF PORTA
- 71: TRISC = 0; // Set all of the PORTC pins as outputs.
- 009B 0187 CLRF PORTC
- 72: ANSEL = 0; // Set all of the analog input pins as digital i/o.
- 009C 0191 CLRF TMR2
- 73: PORTA = 0; // Clear PORTA bits.
- 009D 1283 BCF STATUS, 0x5
- 009E 0185 CLRF PORTA
- 74: PORTC = 0; // Clear PORTC bits.
- 009F 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.
- 00A0 20C1 CALL 0xC1
- 85: currentTask = currentTask++; // Point the currentTask pointer to the next pointer which
- 00A1 3001 MOVLW 0x1
- 00A2 00F6 MOVWF 0x76
- 00A3 0876 MOVF 0x76, W
- 00A4 07F4 ADDWF currentTask, F
- 86: fTask2(); // is task2. And run task2 so that we get the correct pch and pcl.
- 00A5 20E0 CALL 0xE0
- 87:
- 88: //OS_runTasks(); // Task switcher. See the comments in the definitions above.
- 89: asm("_taskswitcher");
- 90: ++currentTask;
- 00A6 3001 MOVLW 0x1
- 00A7 00F6 MOVWF 0x76
- 00A8 0876 MOVF 0x76, W
- 00A9 07F4 ADDWF currentTask, F
- 91: if (currentTask == 2)currentTask = 0;
- 00AA 0874 MOVF currentTask, W
- 00AB 3A02 XORLW 0x2
- 00AC 1D03 BTFSS STATUS, 0x2
- 00AD 28AF GOTO 0xAF
- 00AE 28B0 GOTO 0xB0
- 00AF 28B2 GOTO 0xB2
- 00B0 01F4 CLRF currentTask
- 00B1 28B2 GOTO 0xB2
- 92: PCLATH = tasks[currentTask].pch;
- 00B2 0874 MOVF currentTask, W
- 00B3 00F6 MOVWF 0x76
- 00B4 0776 ADDWF 0x76, W
- 00B5 3E70 ADDLW 0x70
- 00B6 0084 MOVWF FSR
- 00B7 0800 MOVF INDF, W
- 00B8 1283 BCF STATUS, 0x5
- 00B9 008A MOVWF PCLATH
- 93: PCL = tasks[currentTask].pcl;
- 00BA 1403 BSF STATUS, 0x0
- 00BB 0D74 RLF currentTask, W
- 00BC 3E70 ADDLW 0x70
- 00BD 0084 MOVWF FSR
- 00BE 0800 MOVF INDF, W
- 00BF 0082 MOVWF PCL
- 94: }
- 00C0 2800 GOTO 0x0
- 95:
- 96: void fTask1(void)
- 97: {
- 98: //OS_initializeTask(0); // Initialize the task
- 99: tasks[0].pch = PCLATH;
- 00C1 1283 BCF STATUS, 0x5
- 00C2 080A MOVF PCLATH, W
- 00C3 00F5 MOVWF 0x75
- 00C4 0875 MOVF 0x75, W
- 00C5 00F0 MOVWF tasks
- 100: tasks[0].pcl = PCL + 6;
- 00C6 0802 MOVF PCL, W
- 00C7 3E06 ADDLW 0x6
- 00C8 00F5 MOVWF 0x75
- 00C9 0875 MOVF 0x75, W
- 00CA 00F1 MOVWF 0x71
- 101: asm("return");
- 00CB 0008 RETURN
- 00CC 28CD GOTO 0xCD
- 102:
- 103: while (1)
- 00DE 28CD GOTO 0xCD
- 104: {
- 105: PORTA = 0xAA; // Toggle PORTA.0
- 00CD 30AA MOVLW 0xAA
- 00CE 1283 BCF STATUS, 0x5
- 00CF 0085 MOVWF PORTA
- 106: //OS_yield(0); // Yield
- 107: tasks[0].pch = PCLATH;
- 00D0 080A MOVF PCLATH, W
- 00D1 00F5 MOVWF 0x75
- 00D2 0875 MOVF 0x75, W
- 00D3 00F0 MOVWF tasks
- 108: tasks[0].pcl = PCL + 6;
- 00D4 0802 MOVF PCL, W
- 00D5 3E06 ADDLW 0x6
- 00D6 00F5 MOVWF 0x75
- 00D7 0875 MOVF 0x75, W
- 00D8 00F1 MOVWF 0x71
- 109: asm("goto _taskswitcher");
- 00D9 28A6 GOTO 0xA6
- 110:
- 111: PORTA = 0x55; // Toggle PORTA.0
- 00DA 3055 MOVLW 0x55
- 00DB 1283 BCF STATUS, 0x5
- 00DC 0085 MOVWF PORTA
- 00DD 28CD GOTO 0xCD
- 112: }
- 113: }
- 00DF 0008 RETURN
- 114:
- 115: void fTask2(void)
- 116: {
- 117: //OS_initializeTask(1); // Initialize the task
- 118: tasks[1].pch = PCLATH;
- 00E0 1283 BCF STATUS, 0x5
- 00E1 080A MOVF PCLATH, W
- 00E2 00F5 MOVWF 0x75
- 00E3 0875 MOVF 0x75, W
- 00E4 00F2 MOVWF 0x72
- 119: tasks[1].pcl = PCL + 6;
- 00E5 0802 MOVF PCL, W
- 00E6 3E06 ADDLW 0x6
- 00E7 00F5 MOVWF 0x75
- 00E8 0875 MOVF 0x75, W
- 00E9 00F3 MOVWF 0x73
- 120: asm("return");
- 00EA 0008 RETURN
- 00EB 28EC GOTO 0xEC
- 121:
- 122: while (1)
- 00FD 28EC GOTO 0xEC
- 123: {
- 124: PORTC = 0xAA; // Toggle PORTA.1
- 00EC 30AA MOVLW 0xAA
- 00ED 1283 BCF STATUS, 0x5
- 00EE 0087 MOVWF PORTC
- 125: OS_yield(1); // Yield
- 00EF 080A MOVF PCLATH, W
- 00F0 00F5 MOVWF 0x75
- 00F1 0875 MOVF 0x75, W
- 00F2 00F2 MOVWF 0x72
- 00F3 0802 MOVF PCL, W
- 00F4 3E06 ADDLW 0x6
- 00F5 00F5 MOVWF 0x75
- 00F6 0875 MOVF 0x75, W
- 00F7 00F3 MOVWF 0x73
- 00F8 28A6 GOTO 0xA6
- 126: PORTC = 0x55; // Toggle PORTA.1
- 00F9 3055 MOVLW 0x55
- 00FA 1283 BCF STATUS, 0x5
- 00FB 0087 MOVWF PORTC
- 00FC 28EC GOTO 0xEC
- 127: }
- 128: }
- 00FE 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
- 00FF 01F0 CLRF tasks
- 86: clrf ((__pbssCOMMON)+1)&07Fh
- 0100 01F1 CLRF 0x71
- 87: clrf ((__pbssCOMMON)+2)&07Fh
- 0101 01F2 CLRF 0x72
- 88: clrf ((__pbssCOMMON)+3)&07Fh
- 0102 01F3 CLRF 0x73
- 89: clrf ((__pbssCOMMON)+4)&07Fh
- 0103 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
- 0104 0183 CLRF STATUS
- 97: ljmp _main ;jump to C main() function
- 0105 2899 GOTO 0x99
- 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 _main_text,class=CODE,delta=2
- 232: global __p_main_text
- 233: __p_main_text:
- 234: psect _main_text
- 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: global _main_absaddr
- 243: _main_absaddr equ 0x99
- 244: ; Regs used in _main: [wreg-fsr0h+status,2+status,0+pclath+cstack]
- 245: line 70
- 246:
- 247: l431:
- 248: ;main.c: 70: TRISA = 0;
- 249: bsf status, 5 ;RP0=1, select bank1
- 250: clrf (133)^080h ;volatile
- 251: line 71
- 252: ;main.c: 71: TRISC = 0;
- 253: clrf (135)^080h ;volatile
- 254: line 72
- 255: ;main.c: 72: ANSEL = 0;
- 256: clrf (145)^080h ;volatile
- 257: line 73
- 258: ;main.c: 73: PORTA = 0;
- 259: bcf status, 5 ;RP0=0, select bank0
- 260: clrf (5) ;volatile
- 261: line 74
- 262: ;main.c: 74: PORTC = 0;
- 263: clrf (7) ;volatile
- 264: line 84
- 265:
- 266: l433:
- 267: ;main.c: 85: currentTask = currentTask++;
- 268: fcall _fTask1
- 269: line 85
- 270:
- 271: l435:
- 272: movlw (01h)
- 273: movwf (??_main+0)+0
- 274: movf (??_main+0)+0,w
- 275: addwf (_currentTask),f
- 276: line 86
- 277:
- 278: l437:
- 279: ;main.c: 86: fTask2();
- 280: fcall _fTask2
- 281: line 89
- 282: # 89 "main.c"
- 283: _taskswitcher ;#
- 284: psect _main_text
- 285: line 90
- 286:
- 287: l439:
- 288: ;main.c: 90: ++currentTask;
- 289: movlw (01h)
- 290: movwf (??_main+0)+0
- 291: movf (??_main+0)+0,w
- 292: addwf (_currentTask),f
- 293: line 91
- 294:
- 295: l441:
- 296: ;main.c: 91: if (currentTask == 2)currentTask = 0;
- 297: movf (_currentTask),w
- 298: xorlw 02h
- 299: skipz
- 300: goto u11
- 301: goto u10
- 302: u11:
- 303: goto l445
- 304: u10:
- 305:
- 306: l443:
- 307: clrf (_currentTask)
- 308: goto l445
- 309:
- 310: l25:
- 311: line 92
- 312:
- 313: l445:
- 314: ;main.c: 92: PCLATH = tasks[currentTask].pch;
- 315: movf (_currentTask),w
- 316: movwf (??_main+0)+0
- 317: addwf (??_main+0)+0,w
- 318: addlw _tasks&0ffh
- 319: movwf fsr0
- 320: movf indf,w
- 321: bcf status, 5 ;RP0=0, select bank0
- 322: movwf (10) ;volatile
- 323: line 93
- 324: ;main.c: 93: PCL = tasks[currentTask].pcl;
- 325: setc
- 326: rlf (_currentTask),w
- 327: addlw _tasks&0ffh
- 328: movwf fsr0
- 329: movf indf,w
- 330: movwf (2) ;volatile
- 331: line 94
- 332:
- 333: l26:
- 334: global start
- 335: ljmp start
- 336: opt stack 0
- 337: GLOBAL __end_of_main
- 338: __end_of_main:
- 339: signat _main,88
- 340: global _fTask1
- 341:
- 342: ;; *************** function _fTask1 *****************
- 343: ;; Defined at:
- 344: ;; line 97 in file "main.c"
- 345: ;; Parameters: Size Location Type
- 346: ;; None
- 347: ;; Auto vars: Size Location Type
- 348: ;; None
- 349: ;; Return value: Size Location Type
- 350: ;; None void
- 351: ;; Registers used:
- 352: ;; wreg, status,2, status,0
- 353: ;; Tracked objects:
- 354: ;; On entry : 0/0
- 355: ;; On exit : 0/0
- 356: ;; Unchanged: 0/0
- 357: ;; Data sizes: COMMON BANK0 BANK1
- 358: ;; Params: 0 0 0
- 359: ;; Locals: 0 0 0
- 360: ;; Temps: 1 0 0
- 361: ;; Totals: 1 0 0
- 362: ;;Total ram usage: 1 bytes
- 363: ;; Hardware stack levels used: 1
- 364: ;; This function calls:
- 365: ;; Nothing
- 366: ;; This function is called by:
- 367: ;; _main
- 368: ;; This function uses a non-reentrant model
- 369: ;;
- 370: psect text37,local,class=CODE,delta=2,merge=1
- 371: global __ptext37
- 372: __ptext37:
- 373: psect text37
- 374: file "main.c"
- 375: line 97
- 376: global __size_of_fTask1
- 377: __size_of_fTask1 equ __end_of_fTask1-_fTask1
- 378:
- 379: _fTask1:
- 380: opt stack 7
- 381: ; Regs used in _fTask1: [wreg+status,2+status,0]
- 382: line 99
- 383:
- 384: l411:
- 385: ;main.c: 99: tasks[0].pch = PCLATH;
- 386: bcf status, 5 ;RP0=0, select bank0
- 387: movf (10),w ;volatile
- 388: movwf (??_fTask1+0)+0
- 389: movf (??_fTask1+0)+0,w
- 390: movwf (_tasks)
- 391: line 100
- 392:
- 393: l413:
- 394: ;main.c: 100: tasks[0].pcl = PCL + 6;
- 395: movf (2),w ;volatile
- 396: addlw 06h
- 397: movwf (??_fTask1+0)+0
- 398: movf (??_fTask1+0)+0,w
- 399: movwf 0+(_tasks)+01h
- 400: line 101
- 401: # 101 "main.c"
- 402: return ;#
- 403: psect text37
- 404: goto l415
- 405: line 103
- 406: ;main.c: 103: while (1)
- 407:
- 408: l29:
- 409: line 105
- 410:
- 411: l415:
- 412: ;main.c: 104: {
- 413: ;main.c: 105: PORTA = 0xAA;
- 414: movlw (0AAh)
- 415: bcf status, 5 ;RP0=0, select bank0
- 416: movwf (5) ;volatile
- 417: line 107
- 418:
- 419: l417:
- 420: ;main.c: 107: tasks[0].pch = PCLATH;
- 421: movf (10),w ;volatile
- 422: movwf (??_fTask1+0)+0
- 423: movf (??_fTask1+0)+0,w
- 424: movwf (_tasks)
- 425: line 108
- 426:
- 427: l419:
- 428: ;main.c: 108: tasks[0].pcl = PCL + 6;
- 429: movf (2),w ;volatile
- 430: addlw 06h
- 431: movwf (??_fTask1+0)+0
- 432: movf (??_fTask1+0)+0,w
- 433: movwf 0+(_tasks)+01h
- 434: line 109
- 435: # 109 "main.c"
- 436: goto _taskswitcher ;#
- 437: psect text37
- 438: line 111
- 439: ;main.c: 111: PORTA = 0x55;
- 440: movlw (055h)
- 441: bcf status, 5 ;RP0=0, select bank0
- 442: movwf (5) ;volatile
- 443: goto l415
- 444: line 112
- 445:
- 446: l30:
- 447: line 103
- 448: goto l415
- 449:
- 450: l31:
- 451: line 113
- 452:
- 453: l32:
- 454: return
- 455: opt stack 0
- 456: GLOBAL __end_of_fTask1
- 457: __end_of_fTask1:
- 458: signat _fTask1,88
- 459: global _fTask2
- 460:
- 461: ;; *************** function _fTask2 *****************
- 462: ;; Defined at:
- 463: ;; line 116 in file "main.c"
- 464: ;; Parameters: Size Location Type
- 465: ;; None
- 466: ;; Auto vars: Size Location Type
- 467: ;; None
- 468: ;; Return value: Size Location Type
- 469: ;; None void
- 470: ;; Registers used:
- 471: ;; wreg, status,2, status,0
- 472: ;; Tracked objects:
- 473: ;; On entry : 0/0
- 474: ;; On exit : 0/0
- 475: ;; Unchanged: 0/0
- 476: ;; Data sizes: COMMON BANK0 BANK1
- 477: ;; Params: 0 0 0
- 478: ;; Locals: 0 0 0
- 479: ;; Temps: 1 0 0
- 480: ;; Totals: 1 0 0
- 481: ;;Total ram usage: 1 bytes
- 482: ;; Hardware stack levels used: 1
- 483: ;; This function calls:
- 484: ;; Nothing
- 485: ;; This function is called by:
- 486: ;; _main
- 487: ;; This function uses a non-reentrant model
- 488: ;;
- 489: psect text38,local,class=CODE,delta=2,merge=1
- 490: global __ptext38
- 491: __ptext38:
- 492: psect text38
- 493: file "main.c"
- 494: line 116
- 495: global __size_of_fTask2
- 496: __size_of_fTask2 equ __end_of_fTask2-_fTask2
- 497:
- 498: _fTask2:
- 499: opt stack 7
- 500: ; Regs used in _fTask2: [wreg+status,2+status,0]
- 501: line 118
- 502:
- 503: l421:
- 504: ;main.c: 118: tasks[1].pch = PCLATH;
- 505: bcf status, 5 ;RP0=0, select bank0
- 506: movf (10),w ;volatile
- 507: movwf (??_fTask2+0)+0
- 508: movf (??_fTask2+0)+0,w
- 509: movwf 0+(_tasks)+02h
- 510: line 119
- 511:
- 512: l423:
- 513: ;main.c: 119: tasks[1].pcl = PCL + 6;
- 514: movf (2),w ;volatile
- 515: addlw 06h
- 516: movwf (??_fTask2+0)+0
- 517: movf (??_fTask2+0)+0,w
- 518: movwf 0+(_tasks)+03h
- 519: line 120
- 520: # 120 "main.c"
- 521: return ;#
- 522: psect text38
- 523: goto l425
- 524: line 122
- 525: ;main.c: 122: while (1)
- 526:
- 527: l35:
- 528: line 124
- 529:
- 530: l425:
- 531: ;main.c: 123: {
- 532: ;main.c: 124: PORTC = 0xAA;
- 533: movlw (0AAh)
- 534: bcf status, 5 ;RP0=0, select bank0
- 535: movwf (7) ;volatile
- 536: line 125
- 537:
- 538: l427:
- 539: ;main.c: 125: ; tasks[1].pch = PCLATH; tasks[1].pcl = PCL + 6; asm("goto _taskswitcher");;
- 540: movf (10),w ;volatile
- 541: movwf (??_fTask2+0)+0
- 542: movf (??_fTask2+0)+0,w
- 543: movwf 0+(_tasks)+02h
- 544:
- 545: l429:
- 546: movf (2),w ;volatile
- 547: addlw 06h
- 548: movwf (??_fTask2+0)+0
- 549: movf (??_fTask2+0)+0,w
- 550: movwf 0+(_tasks)+03h
- 551: # 125 "main.c"
- 552: goto _taskswitcher ;#
- 553: psect text38
- 554: line 126
- 555: ;main.c: 126: PORTC = 0x55;
- 556: movlw (055h)
- 557: bcf status, 5 ;RP0=0, select bank0
- 558: movwf (7) ;volatile
- 559: goto l425
- 560: line 127
- 561:
- 562: l36:
- 563: line 122
- 564: goto l425
- 565:
- 566: l37:
- 567: line 128
- 568:
- 569: l38:
- 570: return
- 571: opt stack 0
- 572: GLOBAL __end_of_fTask2
- 573: __end_of_fTask2:
- 574: signat _fTask2,88
- 575: psect text39,local,class=CODE,delta=2,merge=1
- 576: global __ptext39
- 577: __ptext39:
- 578: global btemp
- 579: btemp set 07Eh
- 580:
- 581: DABS 1,126,2 ;btemp
- 582: global wtemp0
- 583: wtemp0 set btemp
- 584: end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement