Subversion Repositories Bart

Rev

Blame | Last modification | View Log | RSS feed

  1. ;--------------------------------------------------------
  2. ; File Created by SDCC : FreeWare ANSI-C Compiler
  3. ; Version 2.4.4 #831 (Sep  8 2004)
  4. ; This file generated Sat Sep 18 08:25:04 2004
  5. ;--------------------------------------------------------
  6.         .module rt_task
  7.         .optsdcc -mmcs51 --model-large
  8.        
  9. ;--------------------------------------------------------
  10. ; Public variables in this module
  11. ;--------------------------------------------------------
  12.         .globl _priotab
  13.         .globl _TF1
  14.         .globl _TR1
  15.         .globl _TF0
  16.         .globl _TR0
  17.         .globl _IE1
  18.         .globl _IT1
  19.         .globl _IE0
  20.         .globl _IT0
  21.         .globl _T2CON_7
  22.         .globl _T2CON_6
  23.         .globl _T2CON_5
  24.         .globl _T2CON_4
  25.         .globl _T2CON_3
  26.         .globl _T2CON_2
  27.         .globl _T2CON_1
  28.         .globl _T2CON_0
  29.         .globl _TF2
  30.         .globl _EXF2
  31.         .globl _RCLK
  32.         .globl _TCLK
  33.         .globl _EXEN2
  34.         .globl _TR2
  35.         .globl _C_T2
  36.         .globl _CP_RL2
  37.         .globl _SM0
  38.         .globl _SM1
  39.         .globl _SM2
  40.         .globl _REN
  41.         .globl _TB8
  42.         .globl _RB8
  43.         .globl _TI
  44.         .globl _RI
  45.         .globl _CY
  46.         .globl _AC
  47.         .globl _F0
  48.         .globl _RS1
  49.         .globl _RS0
  50.         .globl _OV
  51.         .globl _F1
  52.         .globl _P
  53.         .globl _P5_7
  54.         .globl _P5_6
  55.         .globl _P5_5
  56.         .globl _P5_4
  57.         .globl _P5_3
  58.         .globl _P5_2
  59.         .globl _P5_1
  60.         .globl _P5_0
  61.         .globl _P4_7
  62.         .globl _P4_6
  63.         .globl _P4_5
  64.         .globl _P4_4
  65.         .globl _P4_3
  66.         .globl _P4_2
  67.         .globl _P4_1
  68.         .globl _P4_0
  69.         .globl _RD
  70.         .globl _WR
  71.         .globl _T1
  72.         .globl _T0
  73.         .globl _INT1
  74.         .globl _INT0
  75.         .globl _TXD0
  76.         .globl _TXD
  77.         .globl _RXD0
  78.         .globl _RXD
  79.         .globl _P3_7
  80.         .globl _P3_6
  81.         .globl _P3_5
  82.         .globl _P3_4
  83.         .globl _P3_3
  84.         .globl _P3_2
  85.         .globl _P3_1
  86.         .globl _P3_0
  87.         .globl _P2_7
  88.         .globl _P2_6
  89.         .globl _P2_5
  90.         .globl _P2_4
  91.         .globl _P2_3
  92.         .globl _P2_2
  93.         .globl _P2_1
  94.         .globl _P2_0
  95.         .globl _P1_7
  96.         .globl _P1_6
  97.         .globl _P1_5
  98.         .globl _P1_4
  99.         .globl _P1_3
  100.         .globl _P1_2
  101.         .globl _P1_1
  102.         .globl _P1_0
  103.         .globl _P0_7
  104.         .globl _P0_6
  105.         .globl _P0_5
  106.         .globl _P0_4
  107.         .globl _P0_3
  108.         .globl _P0_2
  109.         .globl _P0_1
  110.         .globl _P0_0
  111.         .globl _PPC
  112.         .globl _PT2
  113.         .globl _PS
  114.         .globl _PT1
  115.         .globl _PX1
  116.         .globl _PT0
  117.         .globl _PX0
  118.         .globl _EA
  119.         .globl _EC
  120.         .globl _ET2
  121.         .globl _ES
  122.         .globl _ET1
  123.         .globl _EX1
  124.         .globl _ET0
  125.         .globl _EX0
  126.         .globl _CF
  127.         .globl _CR
  128.         .globl _CCF4
  129.         .globl _CCF3
  130.         .globl _CCF2
  131.         .globl _CCF1
  132.         .globl _CCF0
  133.         .globl _BREG_F7
  134.         .globl _BREG_F6
  135.         .globl _BREG_F5
  136.         .globl _BREG_F4
  137.         .globl _BREG_F3
  138.         .globl _BREG_F2
  139.         .globl _BREG_F1
  140.         .globl _BREG_F0
  141.         .globl _WDTRST
  142.         .globl _WDTPRG
  143.         .globl _TMOD
  144.         .globl _TL2
  145.         .globl _TL1
  146.         .globl _TL0
  147.         .globl _TH2
  148.         .globl _TH1
  149.         .globl _TH0
  150.         .globl _TCON
  151.         .globl _T2CON
  152.         .globl _SP
  153.         .globl _SCON
  154.         .globl _SBUF0
  155.         .globl _SBUF
  156.         .globl _SADEN0
  157.         .globl _RCAP2L
  158.         .globl _RCAP2H
  159.         .globl _PSW
  160.         .globl _PCON
  161.         .globl _P5
  162.         .globl _P4
  163.         .globl _P3
  164.         .globl _P2
  165.         .globl _P1
  166.         .globl _P0
  167.         .globl _IPH
  168.         .globl _IP
  169.         .globl _IE
  170.         .globl _FCON
  171.         .globl _EETIM
  172.         .globl _EECON
  173.         .globl _DP0L
  174.         .globl _DPL
  175.         .globl _DP0H
  176.         .globl _DPH
  177.         .globl _CMOD
  178.         .globl _CL
  179.         .globl _CKCON
  180.         .globl _CH
  181.         .globl _CCON
  182.         .globl _CCAPM4
  183.         .globl _CCAPM3
  184.         .globl _CCAPM2
  185.         .globl _CCAPM1
  186.         .globl _CCAPM0
  187.         .globl _CCAP4L
  188.         .globl _CCAP3L
  189.         .globl _CCAP2L
  190.         .globl _CCAP1L
  191.         .globl _CCAP0L
  192.         .globl _CCAP4H
  193.         .globl _CCAP3H
  194.         .globl _CCAP2H
  195.         .globl _CCAP1H
  196.         .globl _CCAP0H
  197.         .globl _AUXR1
  198.         .globl _B
  199.         .globl _AUXR
  200.         .globl _ACC
  201.         .globl _signal_PARM_2
  202.         .globl _wait_timed_PARM_2
  203.         .globl _start_task_PARM_2
  204.         .globl _T10sec
  205.         .globl _T100ms
  206.         .globl _T0ctr
  207.         .globl _reschedule_ea
  208.         .globl _T0_interrupt_ea
  209.         .globl _start_stack
  210.         .globl _task_timer
  211.         .globl _task_masks
  212.         .globl _task_signals
  213.         .globl _stack_save
  214.         .globl _stack2
  215.         .globl _stack1
  216.         .globl _stack0
  217.         .globl _run
  218.         .globl _ready
  219.         .globl _rt_tasks_init
  220.         .globl _T0Interrupt
  221.         .globl _reschedule
  222.         .globl _start_task
  223.         .globl _end_run_task
  224.         .globl _wait_timed
  225.         .globl _sleep
  226.         .globl _clear_signal
  227.         .globl _signal
  228.         .globl _rt_system_init
  229. ;--------------------------------------------------------
  230. ; special function registers
  231. ;--------------------------------------------------------
  232.         .area RSEG    (DATA)
  233. G$ACC$0$0 == 0x00e0
  234. _ACC    =       0x00e0
  235. G$AUXR$0$0 == 0x008e
  236. _AUXR   =       0x008e
  237. G$B$0$0 == 0x00f0
  238. _B      =       0x00f0
  239. G$AUXR1$0$0 == 0x00a2
  240. _AUXR1  =       0x00a2
  241. G$CCAP0H$0$0 == 0x00fa
  242. _CCAP0H =       0x00fa
  243. G$CCAP1H$0$0 == 0x00fb
  244. _CCAP1H =       0x00fb
  245. G$CCAP2H$0$0 == 0x00fc
  246. _CCAP2H =       0x00fc
  247. G$CCAP3H$0$0 == 0x00fd
  248. _CCAP3H =       0x00fd
  249. G$CCAP4H$0$0 == 0x00fe
  250. _CCAP4H =       0x00fe
  251. G$CCAP0L$0$0 == 0x00ea
  252. _CCAP0L =       0x00ea
  253. G$CCAP1L$0$0 == 0x00eb
  254. _CCAP1L =       0x00eb
  255. G$CCAP2L$0$0 == 0x00ec
  256. _CCAP2L =       0x00ec
  257. G$CCAP3L$0$0 == 0x00ed
  258. _CCAP3L =       0x00ed
  259. G$CCAP4L$0$0 == 0x00ee
  260. _CCAP4L =       0x00ee
  261. G$CCAPM0$0$0 == 0x00da
  262. _CCAPM0 =       0x00da
  263. G$CCAPM1$0$0 == 0x00db
  264. _CCAPM1 =       0x00db
  265. G$CCAPM2$0$0 == 0x00dc
  266. _CCAPM2 =       0x00dc
  267. G$CCAPM3$0$0 == 0x00dd
  268. _CCAPM3 =       0x00dd
  269. G$CCAPM4$0$0 == 0x00de
  270. _CCAPM4 =       0x00de
  271. G$CCON$0$0 == 0x00d8
  272. _CCON   =       0x00d8
  273. G$CH$0$0 == 0x00f9
  274. _CH     =       0x00f9
  275. G$CKCON$0$0 == 0x008f
  276. _CKCON  =       0x008f
  277. G$CL$0$0 == 0x00e9
  278. _CL     =       0x00e9
  279. G$CMOD$0$0 == 0x00d9
  280. _CMOD   =       0x00d9
  281. G$DPH$0$0 == 0x0083
  282. _DPH    =       0x0083
  283. G$DP0H$0$0 == 0x0083
  284. _DP0H   =       0x0083
  285. G$DPL$0$0 == 0x0082
  286. _DPL    =       0x0082
  287. G$DP0L$0$0 == 0x0082
  288. _DP0L   =       0x0082
  289. G$EECON$0$0 == 0x00d2
  290. _EECON  =       0x00d2
  291. G$EETIM$0$0 == 0x00d3
  292. _EETIM  =       0x00d3
  293. G$FCON$0$0 == 0x00d1
  294. _FCON   =       0x00d1
  295. G$IE$0$0 == 0x00a8
  296. _IE     =       0x00a8
  297. G$IP$0$0 == 0x00b8
  298. _IP     =       0x00b8
  299. G$IPH$0$0 == 0x00b7
  300. _IPH    =       0x00b7
  301. G$P0$0$0 == 0x0080
  302. _P0     =       0x0080
  303. G$P1$0$0 == 0x0090
  304. _P1     =       0x0090
  305. G$P2$0$0 == 0x00a0
  306. _P2     =       0x00a0
  307. G$P3$0$0 == 0x00b0
  308. _P3     =       0x00b0
  309. G$P4$0$0 == 0x00c0
  310. _P4     =       0x00c0
  311. G$P5$0$0 == 0x00e8
  312. _P5     =       0x00e8
  313. G$PCON$0$0 == 0x0087
  314. _PCON   =       0x0087
  315. G$PSW$0$0 == 0x00d0
  316. _PSW    =       0x00d0
  317. G$RCAP2H$0$0 == 0x00cb
  318. _RCAP2H =       0x00cb
  319. G$RCAP2L$0$0 == 0x00ca
  320. _RCAP2L =       0x00ca
  321. G$SADEN0$0$0 == 0x00b9
  322. _SADEN0 =       0x00b9
  323. G$SBUF$0$0 == 0x0099
  324. _SBUF   =       0x0099
  325. G$SBUF0$0$0 == 0x0099
  326. _SBUF0  =       0x0099
  327. G$SCON$0$0 == 0x0098
  328. _SCON   =       0x0098
  329. G$SP$0$0 == 0x0081
  330. _SP     =       0x0081
  331. G$T2CON$0$0 == 0x00c8
  332. _T2CON  =       0x00c8
  333. G$TCON$0$0 == 0x0088
  334. _TCON   =       0x0088
  335. G$TH0$0$0 == 0x008c
  336. _TH0    =       0x008c
  337. G$TH1$0$0 == 0x008d
  338. _TH1    =       0x008d
  339. G$TH2$0$0 == 0x00cd
  340. _TH2    =       0x00cd
  341. G$TL0$0$0 == 0x008a
  342. _TL0    =       0x008a
  343. G$TL1$0$0 == 0x008b
  344. _TL1    =       0x008b
  345. G$TL2$0$0 == 0x00cc
  346. _TL2    =       0x00cc
  347. G$TMOD$0$0 == 0x0089
  348. _TMOD   =       0x0089
  349. G$WDTPRG$0$0 == 0x00a7
  350. _WDTPRG =       0x00a7
  351. G$WDTRST$0$0 == 0x00a6
  352. _WDTRST =       0x00a6
  353. ;--------------------------------------------------------
  354. ; special function bits
  355. ;--------------------------------------------------------
  356.         .area RSEG    (DATA)
  357. G$BREG_F0$0$0 == 0x00f0
  358. _BREG_F0        =       0x00f0
  359. G$BREG_F1$0$0 == 0x00f1
  360. _BREG_F1        =       0x00f1
  361. G$BREG_F2$0$0 == 0x00f2
  362. _BREG_F2        =       0x00f2
  363. G$BREG_F3$0$0 == 0x00f3
  364. _BREG_F3        =       0x00f3
  365. G$BREG_F4$0$0 == 0x00f4
  366. _BREG_F4        =       0x00f4
  367. G$BREG_F5$0$0 == 0x00f5
  368. _BREG_F5        =       0x00f5
  369. G$BREG_F6$0$0 == 0x00f6
  370. _BREG_F6        =       0x00f6
  371. G$BREG_F7$0$0 == 0x00f7
  372. _BREG_F7        =       0x00f7
  373. G$CCF0$0$0 == 0x00d8
  374. _CCF0   =       0x00d8
  375. G$CCF1$0$0 == 0x00d9
  376. _CCF1   =       0x00d9
  377. G$CCF2$0$0 == 0x00da
  378. _CCF2   =       0x00da
  379. G$CCF3$0$0 == 0x00db
  380. _CCF3   =       0x00db
  381. G$CCF4$0$0 == 0x00dc
  382. _CCF4   =       0x00dc
  383. G$CR$0$0 == 0x00de
  384. _CR     =       0x00de
  385. G$CF$0$0 == 0x00df
  386. _CF     =       0x00df
  387. G$EX0$0$0 == 0x00a8
  388. _EX0    =       0x00a8
  389. G$ET0$0$0 == 0x00a9
  390. _ET0    =       0x00a9
  391. G$EX1$0$0 == 0x00aa
  392. _EX1    =       0x00aa
  393. G$ET1$0$0 == 0x00ab
  394. _ET1    =       0x00ab
  395. G$ES$0$0 == 0x00ac
  396. _ES     =       0x00ac
  397. G$ET2$0$0 == 0x00ad
  398. _ET2    =       0x00ad
  399. G$EC$0$0 == 0x00ae
  400. _EC     =       0x00ae
  401. G$EA$0$0 == 0x00af
  402. _EA     =       0x00af
  403. G$PX0$0$0 == 0x00b8
  404. _PX0    =       0x00b8
  405. G$PT0$0$0 == 0x00b9
  406. _PT0    =       0x00b9
  407. G$PX1$0$0 == 0x00ba
  408. _PX1    =       0x00ba
  409. G$PT1$0$0 == 0x00bb
  410. _PT1    =       0x00bb
  411. G$PS$0$0 == 0x00bc
  412. _PS     =       0x00bc
  413. G$PT2$0$0 == 0x00bd
  414. _PT2    =       0x00bd
  415. G$PPC$0$0 == 0x00be
  416. _PPC    =       0x00be
  417. G$P0_0$0$0 == 0x0080
  418. _P0_0   =       0x0080
  419. G$P0_1$0$0 == 0x0081
  420. _P0_1   =       0x0081
  421. G$P0_2$0$0 == 0x0082
  422. _P0_2   =       0x0082
  423. G$P0_3$0$0 == 0x0083
  424. _P0_3   =       0x0083
  425. G$P0_4$0$0 == 0x0084
  426. _P0_4   =       0x0084
  427. G$P0_5$0$0 == 0x0085
  428. _P0_5   =       0x0085
  429. G$P0_6$0$0 == 0x0086
  430. _P0_6   =       0x0086
  431. G$P0_7$0$0 == 0x0087
  432. _P0_7   =       0x0087
  433. G$P1_0$0$0 == 0x0090
  434. _P1_0   =       0x0090
  435. G$P1_1$0$0 == 0x0091
  436. _P1_1   =       0x0091
  437. G$P1_2$0$0 == 0x0092
  438. _P1_2   =       0x0092
  439. G$P1_3$0$0 == 0x0093
  440. _P1_3   =       0x0093
  441. G$P1_4$0$0 == 0x0094
  442. _P1_4   =       0x0094
  443. G$P1_5$0$0 == 0x0095
  444. _P1_5   =       0x0095
  445. G$P1_6$0$0 == 0x0096
  446. _P1_6   =       0x0096
  447. G$P1_7$0$0 == 0x0097
  448. _P1_7   =       0x0097
  449. G$P2_0$0$0 == 0x00a0
  450. _P2_0   =       0x00a0
  451. G$P2_1$0$0 == 0x00a1
  452. _P2_1   =       0x00a1
  453. G$P2_2$0$0 == 0x00a2
  454. _P2_2   =       0x00a2
  455. G$P2_3$0$0 == 0x00a3
  456. _P2_3   =       0x00a3
  457. G$P2_4$0$0 == 0x00a4
  458. _P2_4   =       0x00a4
  459. G$P2_5$0$0 == 0x00a5
  460. _P2_5   =       0x00a5
  461. G$P2_6$0$0 == 0x00a6
  462. _P2_6   =       0x00a6
  463. G$P2_7$0$0 == 0x00a7
  464. _P2_7   =       0x00a7
  465. G$P3_0$0$0 == 0x00b0
  466. _P3_0   =       0x00b0
  467. G$P3_1$0$0 == 0x00b1
  468. _P3_1   =       0x00b1
  469. G$P3_2$0$0 == 0x00b2
  470. _P3_2   =       0x00b2
  471. G$P3_3$0$0 == 0x00b3
  472. _P3_3   =       0x00b3
  473. G$P3_4$0$0 == 0x00b4
  474. _P3_4   =       0x00b4
  475. G$P3_5$0$0 == 0x00b5
  476. _P3_5   =       0x00b5
  477. G$P3_6$0$0 == 0x00b6
  478. _P3_6   =       0x00b6
  479. G$P3_7$0$0 == 0x00b7
  480. _P3_7   =       0x00b7
  481. G$RXD$0$0 == 0x00b0
  482. _RXD    =       0x00b0
  483. G$RXD0$0$0 == 0x00b0
  484. _RXD0   =       0x00b0
  485. G$TXD$0$0 == 0x00b1
  486. _TXD    =       0x00b1
  487. G$TXD0$0$0 == 0x00b1
  488. _TXD0   =       0x00b1
  489. G$INT0$0$0 == 0x00b2
  490. _INT0   =       0x00b2
  491. G$INT1$0$0 == 0x00b3
  492. _INT1   =       0x00b3
  493. G$T0$0$0 == 0x00b4
  494. _T0     =       0x00b4
  495. G$T1$0$0 == 0x00b5
  496. _T1     =       0x00b5
  497. G$WR$0$0 == 0x00b6
  498. _WR     =       0x00b6
  499. G$RD$0$0 == 0x00b7
  500. _RD     =       0x00b7
  501. G$P4_0$0$0 == 0x00c0
  502. _P4_0   =       0x00c0
  503. G$P4_1$0$0 == 0x00c1
  504. _P4_1   =       0x00c1
  505. G$P4_2$0$0 == 0x00c2
  506. _P4_2   =       0x00c2
  507. G$P4_3$0$0 == 0x00c3
  508. _P4_3   =       0x00c3
  509. G$P4_4$0$0 == 0x00c4
  510. _P4_4   =       0x00c4
  511. G$P4_5$0$0 == 0x00c5
  512. _P4_5   =       0x00c5
  513. G$P4_6$0$0 == 0x00c6
  514. _P4_6   =       0x00c6
  515. G$P4_7$0$0 == 0x00c7
  516. _P4_7   =       0x00c7
  517. G$P5_0$0$0 == 0x00e8
  518. _P5_0   =       0x00e8
  519. G$P5_1$0$0 == 0x00e9
  520. _P5_1   =       0x00e9
  521. G$P5_2$0$0 == 0x00ea
  522. _P5_2   =       0x00ea
  523. G$P5_3$0$0 == 0x00eb
  524. _P5_3   =       0x00eb
  525. G$P5_4$0$0 == 0x00ec
  526. _P5_4   =       0x00ec
  527. G$P5_5$0$0 == 0x00ed
  528. _P5_5   =       0x00ed
  529. G$P5_6$0$0 == 0x00ee
  530. _P5_6   =       0x00ee
  531. G$P5_7$0$0 == 0x00ef
  532. _P5_7   =       0x00ef
  533. G$P$0$0 == 0x00d0
  534. _P      =       0x00d0
  535. G$F1$0$0 == 0x00d1
  536. _F1     =       0x00d1
  537. G$OV$0$0 == 0x00d2
  538. _OV     =       0x00d2
  539. G$RS0$0$0 == 0x00d3
  540. _RS0    =       0x00d3
  541. G$RS1$0$0 == 0x00d4
  542. _RS1    =       0x00d4
  543. G$F0$0$0 == 0x00d5
  544. _F0     =       0x00d5
  545. G$AC$0$0 == 0x00d6
  546. _AC     =       0x00d6
  547. G$CY$0$0 == 0x00d7
  548. _CY     =       0x00d7
  549. G$RI$0$0 == 0x0098
  550. _RI     =       0x0098
  551. G$TI$0$0 == 0x0099
  552. _TI     =       0x0099
  553. G$RB8$0$0 == 0x009a
  554. _RB8    =       0x009a
  555. G$TB8$0$0 == 0x009b
  556. _TB8    =       0x009b
  557. G$REN$0$0 == 0x009c
  558. _REN    =       0x009c
  559. G$SM2$0$0 == 0x009d
  560. _SM2    =       0x009d
  561. G$SM1$0$0 == 0x009e
  562. _SM1    =       0x009e
  563. G$SM0$0$0 == 0x009f
  564. _SM0    =       0x009f
  565. G$CP_RL2$0$0 == 0x00c8
  566. _CP_RL2 =       0x00c8
  567. G$C_T2$0$0 == 0x00c9
  568. _C_T2   =       0x00c9
  569. G$TR2$0$0 == 0x00ca
  570. _TR2    =       0x00ca
  571. G$EXEN2$0$0 == 0x00cb
  572. _EXEN2  =       0x00cb
  573. G$TCLK$0$0 == 0x00cc
  574. _TCLK   =       0x00cc
  575. G$RCLK$0$0 == 0x00cd
  576. _RCLK   =       0x00cd
  577. G$EXF2$0$0 == 0x00ce
  578. _EXF2   =       0x00ce
  579. G$TF2$0$0 == 0x00cf
  580. _TF2    =       0x00cf
  581. G$T2CON_0$0$0 == 0x00c8
  582. _T2CON_0        =       0x00c8
  583. G$T2CON_1$0$0 == 0x00c9
  584. _T2CON_1        =       0x00c9
  585. G$T2CON_2$0$0 == 0x00ca
  586. _T2CON_2        =       0x00ca
  587. G$T2CON_3$0$0 == 0x00cb
  588. _T2CON_3        =       0x00cb
  589. G$T2CON_4$0$0 == 0x00cc
  590. _T2CON_4        =       0x00cc
  591. G$T2CON_5$0$0 == 0x00cd
  592. _T2CON_5        =       0x00cd
  593. G$T2CON_6$0$0 == 0x00ce
  594. _T2CON_6        =       0x00ce
  595. G$T2CON_7$0$0 == 0x00cf
  596. _T2CON_7        =       0x00cf
  597. G$IT0$0$0 == 0x0088
  598. _IT0    =       0x0088
  599. G$IE0$0$0 == 0x0089
  600. _IE0    =       0x0089
  601. G$IT1$0$0 == 0x008a
  602. _IT1    =       0x008a
  603. G$IE1$0$0 == 0x008b
  604. _IE1    =       0x008b
  605. G$TR0$0$0 == 0x008c
  606. _TR0    =       0x008c
  607. G$TF0$0$0 == 0x008d
  608. _TF0    =       0x008d
  609. G$TR1$0$0 == 0x008e
  610. _TR1    =       0x008e
  611. G$TF1$0$0 == 0x008f
  612. _TF1    =       0x008f
  613. ;--------------------------------------------------------
  614. ; overlayable register banks
  615. ;--------------------------------------------------------
  616.         .area REG_BANK_0        (REL,OVR,DATA)
  617.         .ds 8
  618.         .area REG_BANK_1        (REL,OVR,DATA)
  619.         .ds 8
  620.         .area REG_BANK_2        (REL,OVR,DATA)
  621.         .ds 8
  622.         .area REG_BANK_3        (REL,OVR,DATA)
  623.         .ds 8
  624. ;--------------------------------------------------------
  625. ; internal ram data
  626. ;--------------------------------------------------------
  627.         .area DSEG    (DATA)
  628. G$ready$0$0==.
  629. _ready::
  630.         .ds 1
  631. G$run$0$0==.
  632. _run::
  633.         .ds 1
  634. ;--------------------------------------------------------
  635. ; overlayable items in internal ram
  636. ;--------------------------------------------------------
  637.         .area OSEG    (OVR,DATA)
  638. ;--------------------------------------------------------
  639. ; indirectly addressable internal ram data
  640. ;--------------------------------------------------------
  641.         .area ISEG    (DATA)
  642. G$stack0$0$0==.
  643. _stack0::
  644.         .ds 41
  645. G$stack1$0$0==.
  646. _stack1::
  647.         .ds 46
  648. G$stack2$0$0==.
  649. _stack2::
  650.         .ds 46
  651. G$stack_save$0$0==.
  652. _stack_save::
  653.         .ds 3
  654. G$task_signals$0$0==.
  655. _task_signals::
  656.         .ds 3
  657. G$task_masks$0$0==.
  658. _task_masks::
  659.         .ds 3
  660. G$task_timer$0$0==.
  661. _task_timer::
  662.         .ds 3
  663. G$start_stack$0$0==.
  664. _start_stack::
  665.         .ds 3
  666. ;--------------------------------------------------------
  667. ; bit data
  668. ;--------------------------------------------------------
  669.         .area BSEG    (BIT)
  670. G$T0_interrupt_ea$0$0==.
  671. _T0_interrupt_ea::
  672.         .ds 1
  673. G$reschedule_ea$0$0==.
  674. _reschedule_ea::
  675.         .ds 1
  676. Lstart_task$EA_local$1$1==.
  677. _start_task_EA_local_1_1:
  678.         .ds 1
  679. Lend_run_task$EA_local$1$1==.
  680. _end_run_task_EA_local_1_1:
  681.         .ds 1
  682. Lwait_timed$EA_local$1$1==.
  683. _wait_timed_EA_local_1_1:
  684.         .ds 1
  685. Lsleep$EA_local$1$1==.
  686. _sleep_EA_local_1_1:
  687.         .ds 1
  688. Lclear_signal$EA_local$1$1==.
  689. _clear_signal_EA_local_1_1:
  690.         .ds 1
  691. Lsignal$EA_local$1$1==.
  692. _signal_EA_local_1_1:
  693.         .ds 1
  694. ;--------------------------------------------------------
  695. ; external ram data
  696. ;--------------------------------------------------------
  697.         .area XSEG    (XDATA)
  698. G$T0ctr$0$0==.
  699. _T0ctr::
  700.         .ds 1
  701. G$T100ms$0$0==.
  702. _T100ms::
  703.         .ds 1
  704. G$T10sec$0$0==.
  705. _T10sec::
  706.         .ds 1
  707. Lstart_task$tasknum$1$1==.
  708. _start_task_PARM_2::
  709.         .ds 1
  710. Lstart_task$f$1$1==.
  711. _start_task_f_1_1::
  712.         .ds 2
  713. Lwait_timed$ticks$1$1==.
  714. _wait_timed_PARM_2::
  715.         .ds 1
  716. Lwait_timed$signal$1$1==.
  717. _wait_timed_signal_1_1::
  718.         .ds 1
  719. Lsleep$ticks$1$1==.
  720. _sleep_ticks_1_1::
  721.         .ds 1
  722. Lclear_signal$pattern$1$1==.
  723. _clear_signal_pattern_1_1::
  724.         .ds 1
  725. Lsignal$pattern$1$1==.
  726. _signal_PARM_2::
  727.         .ds 1
  728. Lsignal$task$1$1==.
  729. _signal_task_1_1::
  730.         .ds 1
  731. ;--------------------------------------------------------
  732. ; external initialized ram data
  733. ;--------------------------------------------------------
  734.         .area XISEG   (XDATA)
  735.         .area CSEG    (CODE)
  736.         .area GSINIT0 (CODE)
  737.         .area GSINIT1 (CODE)
  738.         .area GSINIT2 (CODE)
  739.         .area GSINIT3 (CODE)
  740.         .area GSINIT4 (CODE)
  741.         .area GSINIT5 (CODE)
  742. ;--------------------------------------------------------
  743. ; global & static initialisations
  744. ;--------------------------------------------------------
  745.         .area GSINIT  (CODE)
  746.         .area GSFINAL (CODE)
  747.         .area GSINIT  (CODE)
  748.         G$rt_system_init$0$0 ==.
  749.         C$rt_task.c$80$1$1 ==.
  750. ;rt_task.c:80: const STACK_PTR_TYPE  start_stack[]={
  751. ;     genPointerSet
  752. ;     genNearPointerSet
  753.         mov     r0,#_start_stack
  754.         mov     @r0,#_stack0
  755. ;     genPointerSet
  756. ;     genNearPointerSet
  757.         mov     r0,#(_start_stack + 0x0001)
  758.         mov     @r0,#_stack1
  759. ;     genPointerSet
  760. ;     genNearPointerSet
  761.         mov     r0,#(_start_stack + 0x0002)
  762.         mov     @r0,#_stack2
  763. ;--------------------------------------------------------
  764. ; Home
  765. ;--------------------------------------------------------
  766.         .area HOME    (CODE)
  767.         .area CSEG    (CODE)
  768. ;--------------------------------------------------------
  769. ; code
  770. ;--------------------------------------------------------
  771.         .area CSEG    (CODE)
  772. ;------------------------------------------------------------
  773. ;Allocation info for local variables in function 'rt_tasks_init'
  774. ;------------------------------------------------------------
  775. ;i                         Allocated with name '_rt_tasks_init_i_1_1'
  776. ;------------------------------------------------------------
  777.         G$rt_tasks_init$0$0 ==.
  778.         C$rt_task.c$143$0$0 ==.
  779. ;rt_task.c:143: void rt_tasks_init (void)
  780. ;       -----------------------------------------
  781. ;        function rt_tasks_init
  782. ;       -----------------------------------------
  783. _rt_tasks_init:
  784.         ar2 = 0x02
  785.         ar3 = 0x03
  786.         ar4 = 0x04
  787.         ar5 = 0x05
  788.         ar6 = 0x06
  789.         ar7 = 0x07
  790.         ar0 = 0x00
  791.         ar1 = 0x01
  792.         C$rt_task.c$146$1$1 ==.
  793. ;rt_task.c:146: run   = MAIN_TASK_ID;
  794. ;     genAssign
  795.         mov     _run,#0x00
  796.         C$rt_task.c$147$1$1 ==.
  797. ;rt_task.c:147: ready = TASK_BIT(MAIN_TASK_ID);
  798. ;     genAssign
  799.         mov     _ready,#0x01
  800.         C$rt_task.c$149$1$1 ==.
  801. ;rt_task.c:149: for(i=0;i<TASKS;i++)
  802. ;     genAssign
  803.         mov     r2,#0x00
  804. 00101$:
  805. ;     genCmpLt
  806. ;     genCmp
  807.         clr     c
  808.         mov     a,r2
  809.         xrl     a,#0x80
  810.         subb    a,#0x83
  811. ;     genIfxJump
  812. ;       Peephole 108    removed ljmp by inverse jump logic
  813.         jnc     00105$
  814. 00109$:
  815.         C$rt_task.c$151$2$2 ==.
  816. ;rt_task.c:151: stack_save[i] = 0;
  817. ;     genPlus
  818. ;       Peephole 236.g  used r2 instead of ar2
  819.         mov     a,r2
  820.         add     a,#_stack_save
  821.         mov     r0,a
  822. ;     genAssign
  823.         mov     r3,#0x00
  824. ;     genPointerSet
  825. ;     genNearPointerSet
  826.         mov     @r0,ar3
  827.         C$rt_task.c$152$2$2 ==.
  828. ;rt_task.c:152: task_signals[i]=0;
  829. ;     genPlus
  830. ;       Peephole 236.g  used r2 instead of ar2
  831.         mov     a,r2
  832.         add     a,#_task_signals
  833. ;     genPointerSet
  834. ;     genNearPointerSet
  835. ;       Peephole 239    used a instead of acc
  836.         mov     r0,a
  837.         mov     @r0,#0x00
  838.         C$rt_task.c$153$2$2 ==.
  839. ;rt_task.c:153: task_masks[i]  =0;
  840. ;     genPlus
  841. ;       Peephole 236.g  used r2 instead of ar2
  842.         mov     a,r2
  843.         add     a,#_task_masks
  844. ;     genPointerSet
  845. ;     genNearPointerSet
  846. ;       Peephole 239    used a instead of acc
  847.         mov     r0,a
  848.         mov     @r0,#0x00
  849.         C$rt_task.c$154$2$2 ==.
  850. ;rt_task.c:154: task_timer[i]  =0;
  851. ;     genPlus
  852. ;       Peephole 236.g  used r2 instead of ar2
  853.         mov     a,r2
  854.         add     a,#_task_timer
  855. ;     genPointerSet
  856. ;     genNearPointerSet
  857. ;       Peephole 239    used a instead of acc
  858.         mov     r0,a
  859.         mov     @r0,#0x00
  860.         C$rt_task.c$149$1$1 ==.
  861. ;rt_task.c:149: for(i=0;i<TASKS;i++)
  862. ;     genPlus
  863. ;     genPlusIncr
  864.         inc     r2
  865. ;       Peephole 112.b  changed ljmp to sjmp
  866.         sjmp    00101$
  867. 00105$:
  868.         C$rt_task.c$157$1$1 ==.
  869.         XG$rt_tasks_init$0$0 ==.
  870.         ret
  871. ;------------------------------------------------------------
  872. ;Allocation info for local variables in function 'T0Interrupt'
  873. ;------------------------------------------------------------
  874. ;i                         Allocated with name '_T0Interrupt_i_2_2'
  875. ;------------------------------------------------------------
  876.         G$T0Interrupt$0$0 ==.
  877.         C$rt_task.c$170$1$1 ==.
  878. ;rt_task.c:170: void T0Interrupt(void) interrupt T0_INTVEC using T0_INTERRUPT_BANK
  879. ;       -----------------------------------------
  880. ;        function T0Interrupt
  881. ;       -----------------------------------------
  882. _T0Interrupt:
  883.         ar2 = 0x12
  884.         ar3 = 0x13
  885.         ar4 = 0x14
  886.         ar5 = 0x15
  887.         ar6 = 0x16
  888.         ar7 = 0x17
  889.         ar0 = 0x10
  890.         ar1 = 0x11
  891.         push    acc
  892.         push    b
  893.         push    dpl
  894.         push    dph
  895.         push    psw
  896.         mov     psw,#0x10
  897.         C$rt_task.c$173$1$1 ==.
  898. ;rt_task.c:173: T0ctr--;
  899. ;     genMinus
  900.         mov     dptr,#_T0ctr
  901. ;     genMinusDec
  902.         movx    a,@dptr
  903.         dec     a
  904. ;     genAssign
  905.         mov     dptr,#_T0ctr
  906.         movx    @dptr,a
  907.         C$rt_task.c$174$1$1 ==.
  908. ;rt_task.c:174: if(T0ctr==0)
  909. ;     genAssign
  910.         mov     dptr,#_T0ctr
  911.         movx    a,@dptr
  912.         mov     r2,a
  913. ;     genCmpEq
  914.         cjne    r2,#0x00,00135$
  915.         sjmp    00136$
  916. 00135$:
  917.         ljmp    00113$
  918. 00136$:
  919.         C$rt_task.c$177$2$2 ==.
  920. ;rt_task.c:177: T100ms++;
  921. ;     genPlus
  922.         mov     dptr,#_T100ms
  923.         movx    a,@dptr
  924.         add     a,#0x01
  925.         movx    @dptr,a
  926.         C$rt_task.c$178$2$2 ==.
  927. ;rt_task.c:178: if(T100ms & 3)
  928. ;     genAssign
  929.         mov     dptr,#_T100ms
  930.         movx    a,@dptr
  931. ;     genAnd
  932. ;       Peephole 105    removed redundant mov
  933.         mov     r2,a
  934.         anl     a,#0x03
  935. ;       Peephole 110    removed ljmp by inverse jump logic
  936.         jz      00102$
  937. 00137$:
  938.         C$rt_task.c$179$2$2 ==.
  939. ;rt_task.c:179: T0ctr= 11;/* 01,10,11  */
  940. ;     genAssign
  941.         mov     dptr,#_T0ctr
  942.         mov     a,#0x0B
  943.         movx    @dptr,a
  944. ;       Peephole 112.b  changed ljmp to sjmp
  945.         sjmp    00130$
  946. 00102$:
  947.         C$rt_task.c$181$2$2 ==.
  948. ;rt_task.c:181: T0ctr= 12;/* 00 */
  949. ;     genAssign
  950.         mov     dptr,#_T0ctr
  951.         mov     a,#0x0C
  952.         movx    @dptr,a
  953.         C$rt_task.c$183$1$1 ==.
  954. ;rt_task.c:183: for (i=0;i<TASKS;i++)
  955. 00130$:
  956. ;     genAssign
  957.         mov     r2,#0x00
  958.         mov     r3,#0x00
  959. 00118$:
  960. ;     genCmpLt
  961. ;     genCmp
  962.         clr     c
  963.         mov     a,r2
  964.         subb    a,#0x03
  965.         mov     a,r3
  966.         xrl     a,#0x80
  967.         subb    a,#0x80
  968. ;     genIfxJump
  969. ;       Peephole 108    removed ljmp by inverse jump logic
  970.         jnc     00121$
  971. 00138$:
  972.         C$rt_task.c$185$3$3 ==.
  973. ;rt_task.c:185: if (task_timer[i] != 0)
  974. ;     genPlus
  975. ;       Peephole 236.g  used r2 instead of ar2
  976.         mov     a,r2
  977.         add     a,#_task_timer
  978.         mov     r0,a
  979. ;     genPointerGet
  980. ;     genNearPointerGet
  981.         mov     ar4,@r0
  982. ;     genCmpEq
  983.         cjne    r4,#0x00,00139$
  984. ;       Peephole 112.b  changed ljmp to sjmp
  985.         sjmp    00120$
  986. 00139$:
  987.         C$rt_task.c$187$4$4 ==.
  988. ;rt_task.c:187: task_timer[i]--;
  989. ;     genPlus
  990. ;       Peephole 236.g  used r2 instead of ar2
  991.         mov     a,r2
  992.         add     a,#_task_timer
  993.         mov     r0,a
  994. ;     genPointerGet
  995. ;     genNearPointerGet
  996.         mov     ar4,@r0
  997. ;     genMinus
  998. ;     genMinusDec
  999.         mov     a,r4
  1000.         dec     a
  1001. ;     genPointerSet
  1002. ;     genNearPointerSet
  1003.         mov     @r0,acc
  1004.         C$rt_task.c$188$4$4 ==.
  1005. ;rt_task.c:188: if (task_timer[i] == 0)
  1006. ;     genPlus
  1007. ;       Peephole 236.g  used r2 instead of ar2
  1008.         mov     a,r2
  1009.         add     a,#_task_timer
  1010.         mov     r0,a
  1011. ;     genPointerGet
  1012. ;     genNearPointerGet
  1013.         mov     ar4,@r0
  1014. ;     genCmpEq
  1015. ;       Peephole 112.b  changed ljmp to sjmp
  1016. ;       Peephole 199    optimized misc jump sequence
  1017.         cjne    r4,#0x00,00120$
  1018. ;00140$:
  1019. ;       Peephole 200    removed redundant sjmp
  1020. 00141$:
  1021.         C$rt_task.c$190$5$5 ==.
  1022. ;rt_task.c:190: task_signals[i] |= TIMER_SIG;
  1023. ;     genPlus
  1024. ;       Peephole 236.g  used r2 instead of ar2
  1025.         mov     a,r2
  1026.         add     a,#_task_signals
  1027.         mov     r0,a
  1028. ;     genPlus
  1029. ;       Peephole 236.g  used r2 instead of ar2
  1030.         mov     a,r2
  1031.         add     a,#_task_signals
  1032.         mov     r1,a
  1033. ;     genPointerGet
  1034. ;     genNearPointerGet
  1035.         mov     ar4,@r1
  1036. ;     genOr
  1037.         mov     a,#0x80
  1038.         orl     a,r4
  1039. ;     genPointerSet
  1040. ;     genNearPointerSet
  1041.         mov     @r0,acc
  1042.         C$rt_task.c$191$5$5 ==.
  1043. ;rt_task.c:191: if(task_signals[i] & task_masks[i])
  1044. ;     genPlus
  1045. ;       Peephole 236.g  used r2 instead of ar2
  1046.         mov     a,r2
  1047.         add     a,#_task_signals
  1048.         mov     r0,a
  1049. ;     genPointerGet
  1050. ;     genNearPointerGet
  1051.         mov     ar4,@r0
  1052. ;     genPlus
  1053. ;       Peephole 236.g  used r2 instead of ar2
  1054.         mov     a,r2
  1055.         add     a,#_task_masks
  1056.         mov     r0,a
  1057. ;     genPointerGet
  1058. ;     genNearPointerGet
  1059.         mov     ar5,@r0
  1060. ;     genAnd
  1061.         mov     a,r5
  1062.         anl     a,r4
  1063. ;     genIfx
  1064. ;     genIfxJump
  1065. ;       Peephole 110    removed ljmp by inverse jump logic
  1066.         jz      00120$
  1067. 00142$:
  1068.         C$rt_task.c$193$6$6 ==.
  1069. ;rt_task.c:193: ready |= TASK_BIT(i); /* Mapping here */  
  1070. ;     genLeftShift
  1071.         mov     b,r2
  1072.         inc     b
  1073.         mov     r4,#0x01
  1074.         mov     r5,#0x00
  1075.         sjmp    00144$
  1076. 00143$:
  1077. ;       Peephole 254    optimized left shift
  1078.         mov     a,r4
  1079.         add     a,r4
  1080.         mov     r4,a
  1081.         mov     a,r5
  1082.         rlc     a
  1083.         mov     r5,a
  1084. 00144$:
  1085.         djnz    b,00143$
  1086. ;     genCast
  1087. ;     genOr
  1088.         mov     a,r4
  1089.         orl     _ready,a
  1090. 00120$:
  1091.         C$rt_task.c$183$2$2 ==.
  1092. ;rt_task.c:183: for (i=0;i<TASKS;i++)
  1093. ;     genPlus
  1094. ;     genPlusIncr
  1095.         inc     r2
  1096. ;       Peephole 112.b  changed ljmp to sjmp
  1097. ;       Peephole 243    avoided branch to sjmp
  1098.         cjne    r2,#0x00,00118$
  1099.         inc     r3
  1100. 00145$:
  1101.         sjmp    00118$
  1102. 00121$:
  1103.         C$rt_task.c$201$2$2 ==.
  1104. ;rt_task.c:201: if(T100ms>=MAXT100ms)
  1105. ;     genAssign
  1106.         mov     dptr,#_T100ms
  1107.         movx    a,@dptr
  1108.         mov     r2,a
  1109. ;     genCmpLt
  1110. ;     genCmp
  1111.         cjne    r2,#0x64,00146$
  1112. 00146$:
  1113. ;     genIfxJump
  1114. ;       Peephole 112.b  changed ljmp to sjmp
  1115. ;       Peephole 160    removed sjmp by inverse jump logic
  1116.         jc      00113$
  1117. 00147$:
  1118.         C$rt_task.c$203$3$7 ==.
  1119. ;rt_task.c:203: T10sec++;
  1120. ;     genPlus
  1121.         mov     dptr,#_T10sec
  1122.         movx    a,@dptr
  1123.         add     a,#0x01
  1124.         movx    @dptr,a
  1125.         C$rt_task.c$204$3$7 ==.
  1126. ;rt_task.c:204: T100ms=0;  
  1127. ;     genAssign
  1128.         mov     dptr,#_T100ms
  1129. ;       Peephole 181    changed mov to clr
  1130.         clr     a
  1131.         movx    @dptr,a
  1132. 00113$:
  1133.         C$rt_task.c$211$1$1 ==.
  1134. ;rt_task.c:211: if(!SIO1_CTS && !SIO1_TxBusy && SIO1_TxCount)
  1135. ;     genIfx
  1136. ;     genIfxJump
  1137. ;       Peephole 112.a  removed ljmp by inverse jump logic
  1138.         jb      _P1_5,00115$
  1139. 00148$:
  1140. ;     genIfx
  1141. ;     genIfxJump
  1142. ;       Peephole 112.a  removed ljmp by inverse jump logic
  1143.         jb      _SIO1_TxBusy,00115$
  1144. 00149$:
  1145. ;     genAssign
  1146.         mov     dptr,#_SIO1_TxCount
  1147.         movx    a,@dptr
  1148. ;     genIfx
  1149. ;       Peephole 105    removed redundant mov
  1150.         mov     r2,a
  1151. ;     genIfxJump
  1152. ;       Peephole 110    removed ljmp by inverse jump logic
  1153.         jz      00115$
  1154. 00150$:
  1155.         C$rt_task.c$213$2$8 ==.
  1156. ;rt_task.c:213: TI=1;
  1157. ;     genAssign
  1158.         setb    _TI
  1159. 00115$:
  1160.         C$rt_task.c$297$1$1 ==.
  1161. ;rt_task.c:297: _endasm;
  1162. ;     genInline
  1163. ; use assembler form of atomic operation for keeping ea
  1164.           jbc ea,0001$
  1165.           clr _T0_interrupt_ea
  1166.           sjmp 0002$
  1167. 0001$:
  1168.           setb _T0_interrupt_ea
  1169. 0002$:
  1170. ; These are in bank 0
  1171.           push 7
  1172.           push 6
  1173.           push 5
  1174.           push 4
  1175.           push 3
  1176.           push 2
  1177.           push 1
  1178.           push 0
  1179. ;
  1180. ;
  1181. ; Determine which task was running
  1182. ; and save the task SP
  1183. ;
  1184.           mov a,_run
  1185.           add a,#_stack_save
  1186.           mov r0,a
  1187.           mov a,sp
  1188.           mov @r0,a
  1189. ; *********** SCHEDULE CODE HERE
  1190. ;
  1191. ; look at the task ready flags
  1192.           mov a,_ready
  1193.           add a,#0x10
  1194.           anl a,#0x3F
  1195.           mov _ready,a
  1196. ;
  1197. ; get new running task ID
  1198. ;
  1199.           mov dptr,#_priotab
  1200.           movc a,@a+dptr
  1201. ;
  1202.           mov _run,a
  1203. ;
  1204.           add a,#_stack_save
  1205.           mov r0,a
  1206.           mov a,@r0
  1207.           mov sp,a
  1208. ;
  1209. ;
  1210. ; Bank 0 registers in use here
  1211. ;
  1212.           pop 0
  1213.           pop 1
  1214.           pop 2
  1215.           pop 3
  1216.           pop 4
  1217.           pop 5
  1218.           pop 6
  1219.           pop 7
  1220. ;
  1221. ; this is done in the ISR
  1222. ; pop psw
  1223. ; pop dph
  1224. ; pop dpl
  1225. ; pop b
  1226. ; pop acc
  1227. ;
  1228. ;
  1229. ;
  1230.           jnb _T0_interrupt_ea,0010$
  1231.           setb ea
  1232. 0010$:
  1233. 00122$:
  1234.         pop     psw
  1235.         pop     dph
  1236.         pop     dpl
  1237.         pop     b
  1238.         pop     acc
  1239.         C$rt_task.c$301$1$1 ==.
  1240.         XG$T0Interrupt$0$0 ==.
  1241.         reti
  1242. ;------------------------------------------------------------
  1243. ;Allocation info for local variables in function 'reschedule'
  1244. ;------------------------------------------------------------
  1245. ;------------------------------------------------------------
  1246.         G$reschedule$0$0 ==.
  1247.         C$rt_task.c$328$1$1 ==.
  1248. ;rt_task.c:328: void reschedule(void)
  1249. ;       -----------------------------------------
  1250. ;        function reschedule
  1251. ;       -----------------------------------------
  1252. _reschedule:
  1253.         ar2 = 0x02
  1254.         ar3 = 0x03
  1255.         ar4 = 0x04
  1256.         ar5 = 0x05
  1257.         ar6 = 0x06
  1258.         ar7 = 0x07
  1259.         ar0 = 0x00
  1260.         ar1 = 0x01
  1261.         C$rt_task.c$413$1$1 ==.
  1262. ;rt_task.c:413: _endasm;
  1263. ;     genInline
  1264. ; use assembler form of atomic operation for keeping ea
  1265.           jbc ea,0001$
  1266.           clr _reschedule_ea
  1267.           sjmp 0002$
  1268. 0001$:
  1269.           setb _reschedule_ea
  1270. 0002$:
  1271. ; this is done in any ISR
  1272.                 push acc
  1273.                 push b
  1274.                 push dpl
  1275.                 push dph
  1276.                 push psw
  1277. ;
  1278. ; These are in bank 0
  1279. ;
  1280.           push 7
  1281.           push 6
  1282.           push 5
  1283.           push 4
  1284.           push 3
  1285.           push 2
  1286.           push 1
  1287.           push 0
  1288. ;
  1289. ;
  1290. ;
  1291. ; Determine which task was running
  1292. ; and save the task SP
  1293. ;
  1294.           mov a,_run
  1295.           add a,#_stack_save
  1296.           mov r0,a
  1297.           mov a,sp
  1298.           mov @r0,a
  1299. ; *********** SCHEDULE CODE HERE
  1300. ;
  1301. ; look at the task ready flags
  1302.           mov a,_ready
  1303.           add a,#0x10
  1304.           anl a,#0x3F
  1305.           mov _ready,a
  1306. ;
  1307. ; get new running task ID
  1308. ;
  1309.           mov dptr,#_priotab
  1310.           movc a,@a+dptr
  1311. ;
  1312.           mov _run,a
  1313. ;
  1314.           add a,#_stack_save
  1315.           mov r0,a
  1316.           mov a,@r0
  1317.           mov sp,a
  1318. ;
  1319. ;
  1320. ; Bank 0 registers in use here
  1321. ;
  1322.           pop 0
  1323.           pop 1
  1324.           pop 2
  1325.           pop 3
  1326.           pop 4
  1327.           pop 5
  1328.           pop 6
  1329.           pop 7
  1330. ;
  1331. ; this is done in the ISR
  1332.                 pop psw
  1333.                 pop dph
  1334.                 pop dpl
  1335.                 pop b
  1336.                 pop acc
  1337. ;
  1338.           jnb _reschedule_ea,0010$
  1339.           setb ea
  1340. 0010$:
  1341. ;
  1342. 00101$:
  1343.         C$rt_task.c$415$1$1 ==.
  1344.         XG$reschedule$0$0 ==.
  1345.         ret
  1346. ;------------------------------------------------------------
  1347. ;Allocation info for local variables in function 'start_task'
  1348. ;------------------------------------------------------------
  1349. ;tasknum                   Allocated with name '_start_task_PARM_2'
  1350. ;f                         Allocated with name '_start_task_f_1_1'
  1351. ;fp                        Allocated with name '_start_task_fp_1_1'
  1352. ;csp                       Allocated to registers r0
  1353. ;------------------------------------------------------------
  1354.         G$start_task$0$0 ==.
  1355.         C$rt_task.c$424$1$1 ==.
  1356. ;rt_task.c:424: start_rc start_task(task_p f,char tasknum)
  1357. ;       -----------------------------------------
  1358. ;        function start_task
  1359. ;       -----------------------------------------
  1360. _start_task:
  1361. ;     genReceive
  1362.         mov     r2,dph
  1363.         mov     a,dpl
  1364.         mov     dptr,#_start_task_f_1_1
  1365.         movx    @dptr,a
  1366.         inc     dptr
  1367.         mov     a,r2
  1368.         movx    @dptr,a
  1369.         C$rt_task.c$429$1$1 ==.
  1370. ;rt_task.c:429: if (tasknum >= TASKS)
  1371. ;     genAssign
  1372.         mov     dptr,#_start_task_PARM_2
  1373.         movx    a,@dptr
  1374. ;     genCmpLt
  1375. ;     genCmp
  1376. ;       Peephole 106    removed redundant mov
  1377.         mov     r2,a
  1378.         clr     c
  1379.         xrl     a,#0x80
  1380.         subb    a,#0x83
  1381. ;     genIfxJump
  1382. ;       Peephole 112.b  changed ljmp to sjmp
  1383. ;       Peephole 160    removed sjmp by inverse jump logic
  1384.         jc      00102$
  1385. 00110$:
  1386.         C$rt_task.c$430$1$1 ==.
  1387. ;rt_task.c:430: return FAILED;
  1388. ;     genRet
  1389.         mov     dpl,#0x01
  1390. ;       Peephole 251.a  replaced ljmp to ret with ret
  1391.         ret
  1392. 00102$:
  1393.         C$rt_task.c$432$2$2 ==.
  1394. ;rt_task.c:432: BEGIN_CRITICAL;
  1395. ;     genIfx
  1396. ;     genIfxJump
  1397. ;       Peephole 111    removed ljmp by inverse jump logic
  1398. ;     genAssign
  1399. ;       Peephole 250.a  using atomic test and clear
  1400.         jbc     _EA,00111$
  1401.         sjmp    00104$
  1402. 00111$:
  1403. ;     genAssign
  1404.         setb    _start_task_EA_local_1_1
  1405. ;       Peephole 112.b  changed ljmp to sjmp
  1406.         sjmp    00105$
  1407. 00104$:
  1408. ;     genAssign
  1409.         clr     _start_task_EA_local_1_1
  1410. 00105$:
  1411.         C$rt_task.c$433$1$1 ==.
  1412. ;rt_task.c:433: csp = start_stack[tasknum];
  1413. ;     genPlus
  1414. ;       Peephole 236.g  used r2 instead of ar2
  1415.         mov     a,r2
  1416.         add     a,#_start_stack
  1417.         mov     r0,a
  1418. ;     genPointerGet
  1419. ;     genNearPointerGet
  1420.         mov     ar0,@r0
  1421.         C$rt_task.c$434$1$1 ==.
  1422. ;rt_task.c:434: stack_save[tasknum] = (STACK_PTR_TYPE)csp+16 ;
  1423. ;     genPlus
  1424. ;       Peephole 236.g  used r2 instead of ar2
  1425.         mov     a,r2
  1426.         add     a,#_stack_save
  1427.         mov     r1,a
  1428. ;     genPlus
  1429.         mov     a,#0x10
  1430. ;       Peephole 236.a  used r0 instead of ar0
  1431.         add     a,r0
  1432. ;     genPointerSet
  1433. ;     genNearPointerSet
  1434.         mov     @r1,acc
  1435.         C$rt_task.c$436$1$1 ==.
  1436. ;rt_task.c:436: fp =  (int)&end_run_task;
  1437. ;     genCast
  1438.         mov     r3,#_end_run_task
  1439.         mov     r4,#(_end_run_task >> 8)
  1440.         C$rt_task.c$437$1$1 ==.
  1441. ;rt_task.c:437: *csp++     = (char)(fp & 0xff);
  1442. ;     genAnd
  1443.         mov     ar5,r3
  1444.         mov     r6,#0x00
  1445. ;     genCast
  1446. ;     genPointerSet
  1447. ;     genNearPointerSet
  1448.         mov     @r0,ar5
  1449.         inc     r0
  1450.         C$rt_task.c$438$1$1 ==.
  1451. ;rt_task.c:438: *csp++     = (char)(fp >> 8) ;
  1452. ;     genRightShift
  1453. ;     genSignedRightShift
  1454. ;     genRightShiftLiteral
  1455. ;     genrshTwo
  1456.         mov     a,r4
  1457.         mov     r3,a
  1458.         rlc     a
  1459.         subb    a,acc
  1460.         mov     r4,a
  1461. ;     genCast
  1462. ;     genPointerSet
  1463. ;     genNearPointerSet
  1464.         mov     @r0,ar3
  1465.         inc     r0
  1466.         C$rt_task.c$440$1$1 ==.
  1467. ;rt_task.c:440: fp = (int)f;    
  1468. ;     genAssign
  1469.         mov     dptr,#_start_task_f_1_1
  1470.         movx    a,@dptr
  1471.         mov     r3,a
  1472.         inc     dptr
  1473.         movx    a,@dptr
  1474.         mov     r4,a
  1475. ;     genCast
  1476.         C$rt_task.c$441$1$1 ==.
  1477. ;rt_task.c:441: *csp++     = (char)(fp &0xff);
  1478. ;     genAnd
  1479.         mov     ar5,r3
  1480.         mov     r6,#0x00
  1481. ;     genCast
  1482. ;     genPointerSet
  1483. ;     genNearPointerSet
  1484.         mov     @r0,ar5
  1485.         inc     r0
  1486.         C$rt_task.c$442$1$1 ==.
  1487. ;rt_task.c:442: *csp++     = (char)(fp >> 8) ;
  1488. ;     genRightShift
  1489. ;     genSignedRightShift
  1490. ;     genRightShiftLiteral
  1491. ;     genrshTwo
  1492.         mov     a,r4
  1493.         mov     r3,a
  1494.         rlc     a
  1495.         subb    a,acc
  1496.         mov     r4,a
  1497. ;     genCast
  1498. ;     genPointerSet
  1499. ;     genNearPointerSet
  1500.         mov     @r0,ar3
  1501.         inc     r0
  1502.         C$rt_task.c$446$1$1 ==.
  1503. ;rt_task.c:446: *csp++ = 0; /* csp[4]   = acc  could pass argument here */
  1504. ;     genPointerSet
  1505. ;     genNearPointerSet
  1506.         mov     @r0,#0x00
  1507.         inc     r0
  1508.         C$rt_task.c$447$1$1 ==.
  1509. ;rt_task.c:447: *csp++ = 0; /* csp[5]   = b   */
  1510. ;     genPointerSet
  1511. ;     genNearPointerSet
  1512.         mov     @r0,#0x00
  1513.         inc     r0
  1514.         C$rt_task.c$448$1$1 ==.
  1515. ;rt_task.c:448: *csp++ = 0; /*  csp[6] = dpl    */
  1516. ;     genPointerSet
  1517. ;     genNearPointerSet
  1518.         mov     @r0,#0x00
  1519.         inc     r0
  1520.         C$rt_task.c$449$1$1 ==.
  1521. ;rt_task.c:449: *csp++ = 0; /*  csp[7] = dph    */
  1522. ;     genPointerSet
  1523. ;     genNearPointerSet
  1524.         mov     @r0,#0x00
  1525.         inc     r0
  1526.         C$rt_task.c$450$1$1 ==.
  1527. ;rt_task.c:450: *csp++ = 0; /* psw VITAL */  
  1528. ;     genPointerSet
  1529. ;     genNearPointerSet
  1530.         mov     @r0,#0x00
  1531.         inc     r0
  1532.         C$rt_task.c$451$1$1 ==.
  1533. ;rt_task.c:451: *csp++ = 0; /* csp [9] = r7 */
  1534. ;     genPointerSet
  1535. ;     genNearPointerSet
  1536.         mov     @r0,#0x00
  1537.         inc     r0
  1538.         C$rt_task.c$452$1$1 ==.
  1539. ;rt_task.c:452: *csp++ = 0; /* csp [10] = r6 */
  1540. ;     genPointerSet
  1541. ;     genNearPointerSet
  1542.         mov     @r0,#0x00
  1543.         inc     r0
  1544.         C$rt_task.c$453$1$1 ==.
  1545. ;rt_task.c:453: *csp++ = 0; /* csp [11] = r5 */
  1546. ;     genPointerSet
  1547. ;     genNearPointerSet
  1548.         mov     @r0,#0x00
  1549.         inc     r0
  1550.         C$rt_task.c$454$1$1 ==.
  1551. ;rt_task.c:454: *csp++ = 0; /* csp [12] = r4 */
  1552. ;     genPointerSet
  1553. ;     genNearPointerSet
  1554.         mov     @r0,#0x00
  1555.         inc     r0
  1556.         C$rt_task.c$455$1$1 ==.
  1557. ;rt_task.c:455: *csp++ = 0; /* csp [13] = r3 */
  1558. ;     genPointerSet
  1559. ;     genNearPointerSet
  1560.         mov     @r0,#0x00
  1561.         inc     r0
  1562.         C$rt_task.c$456$1$1 ==.
  1563. ;rt_task.c:456: *csp++ = 0; /* csp [14] = r2 */
  1564. ;     genPointerSet
  1565. ;     genNearPointerSet
  1566.         mov     @r0,#0x00
  1567.         inc     r0
  1568.         C$rt_task.c$457$1$1 ==.
  1569. ;rt_task.c:457: *csp++ = 0; /* csp [15] = r1 */
  1570. ;     genPointerSet
  1571. ;     genNearPointerSet
  1572.         mov     @r0,#0x00
  1573.         inc     r0
  1574.         C$rt_task.c$458$1$1 ==.
  1575. ;rt_task.c:458: *csp   = 0; /* csp [16] = r0 */
  1576. ;     genPointerSet
  1577. ;     genNearPointerSet
  1578.         mov     @r0,#0x00
  1579.         C$rt_task.c$462$1$1 ==.
  1580. ;rt_task.c:462: ready |= TASK_BIT(tasknum);
  1581. ;     genLeftShift
  1582.         mov     b,r2
  1583.         inc     b
  1584.         mov     a,#0x01
  1585.         sjmp    00114$
  1586. 00112$:
  1587.         add     a,acc
  1588. 00114$:
  1589.         djnz    b,00112$
  1590. ;     genOr
  1591. ;       Peephole 105    removed redundant mov
  1592.         mov     r2,a
  1593.         orl     _ready,a
  1594.         C$rt_task.c$463$2$5 ==.
  1595. ;rt_task.c:463: END_CRITICAL;
  1596. ;     genAssign
  1597.         mov     c,_start_task_EA_local_1_1
  1598.         mov     _EA,c
  1599.         C$rt_task.c$464$1$1 ==.
  1600. ;rt_task.c:464: return STARTED;
  1601. ;     genRet
  1602.         mov     dpl,#0x02
  1603. 00106$:
  1604.         C$rt_task.c$465$1$1 ==.
  1605.         XG$start_task$0$0 ==.
  1606.         ret
  1607. ;------------------------------------------------------------
  1608. ;Allocation info for local variables in function 'end_run_task'
  1609. ;------------------------------------------------------------
  1610. ;------------------------------------------------------------
  1611.         G$end_run_task$0$0 ==.
  1612.         C$rt_task.c$471$1$1 ==.
  1613. ;rt_task.c:471: void end_run_task(void)
  1614. ;       -----------------------------------------
  1615. ;        function end_run_task
  1616. ;       -----------------------------------------
  1617. _end_run_task:
  1618.         C$rt_task.c$475$2$2 ==.
  1619. ;rt_task.c:475: BEGIN_CRITICAL;
  1620. ;     genIfx
  1621. ;     genIfxJump
  1622. ;       Peephole 111    removed ljmp by inverse jump logic
  1623. ;     genAssign
  1624. ;       Peephole 250.a  using atomic test and clear
  1625.         jbc     _EA,00111$
  1626.         sjmp    00102$
  1627. 00111$:
  1628. ;     genAssign
  1629.         setb    _end_run_task_EA_local_1_1
  1630. ;       Peephole 112.b  changed ljmp to sjmp
  1631.         sjmp    00103$
  1632. 00102$:
  1633. ;     genAssign
  1634.         clr     _end_run_task_EA_local_1_1
  1635. 00103$:
  1636.         C$rt_task.c$476$1$1 ==.
  1637. ;rt_task.c:476: ready &= ~TASK_BIT(run);
  1638. ;     genLeftShift
  1639.         mov     b,_run
  1640.         inc     b
  1641.         mov     a,#0x01
  1642.         sjmp    00114$
  1643. 00112$:
  1644.         add     a,acc
  1645. 00114$:
  1646.         djnz    b,00112$
  1647. ;     genCpl
  1648. ;       Peephole 105    removed redundant mov
  1649. ;     genAnd
  1650. ;       Peephole 105    removed redundant mov
  1651. ;       Peephole 184    removed redundant mov
  1652.         cpl     a
  1653.         mov     r2,a
  1654.         anl     _ready,a
  1655.         C$rt_task.c$477$1$1 ==.
  1656. ;rt_task.c:477: task_masks[run] = 0; /* Stop any further signals making task ready to run */
  1657. ;     genPlus
  1658.         mov     a,_run
  1659.         add     a,#_task_masks
  1660. ;     genPointerSet
  1661. ;     genNearPointerSet
  1662. ;       Peephole 239    used a instead of acc
  1663.         mov     r0,a
  1664.         mov     @r0,#0x00
  1665.         C$rt_task.c$478$1$1 ==.
  1666. ;rt_task.c:478: task_timer[run] = 0;  /* kill off pending task timeout */
  1667. ;     genPlus
  1668.         mov     a,_run
  1669.         add     a,#_task_timer
  1670. ;     genPointerSet
  1671. ;     genNearPointerSet
  1672. ;       Peephole 239    used a instead of acc
  1673.         mov     r0,a
  1674.         mov     @r0,#0x00
  1675.         C$rt_task.c$479$2$5 ==.
  1676. ;rt_task.c:479: END_CRITICAL;
  1677. ;     genAssign
  1678.         mov     c,_end_run_task_EA_local_1_1
  1679.         mov     _EA,c
  1680.         C$rt_task.c$480$1$1 ==.
  1681. ;rt_task.c:480: reschedule();
  1682. ;     genCall
  1683.         lcall   _reschedule
  1684.         C$rt_task.c$482$1$1 ==.
  1685. ;rt_task.c:482: while(1);
  1686. 00105$:
  1687. ;       Peephole 112.b  changed ljmp to sjmp
  1688.         sjmp    00105$
  1689. 00107$:
  1690.         C$rt_task.c$484$1$1 ==.
  1691.         XG$end_run_task$0$0 ==.
  1692.         ret
  1693. ;------------------------------------------------------------
  1694. ;Allocation info for local variables in function 'wait_timed'
  1695. ;------------------------------------------------------------
  1696. ;ticks                     Allocated with name '_wait_timed_PARM_2'
  1697. ;signal                    Allocated with name '_wait_timed_signal_1_1'
  1698. ;------------------------------------------------------------
  1699.         G$wait_timed$0$0 ==.
  1700.         C$rt_task.c$489$1$1 ==.
  1701. ;rt_task.c:489: char wait_timed(char signal,char ticks)
  1702. ;       -----------------------------------------
  1703. ;        function wait_timed
  1704. ;       -----------------------------------------
  1705. _wait_timed:
  1706. ;     genReceive
  1707.         mov     a,dpl
  1708.         mov     dptr,#_wait_timed_signal_1_1
  1709.         movx    @dptr,a
  1710.         C$rt_task.c$492$2$2 ==.
  1711. ;rt_task.c:492: BEGIN_CRITICAL;
  1712. ;     genIfx
  1713. ;     genIfxJump
  1714. ;       Peephole 111    removed ljmp by inverse jump logic
  1715. ;     genAssign
  1716. ;       Peephole 250.a  using atomic test and clear
  1717.         jbc     _EA,00107$
  1718.         sjmp    00102$
  1719. 00107$:
  1720. ;     genAssign
  1721.         setb    _wait_timed_EA_local_1_1
  1722. ;       Peephole 112.b  changed ljmp to sjmp
  1723.         sjmp    00103$
  1724. 00102$:
  1725. ;     genAssign
  1726.         clr     _wait_timed_EA_local_1_1
  1727. 00103$:
  1728.         C$rt_task.c$493$1$1 ==.
  1729. ;rt_task.c:493: ready             &= ~TASK_BIT(run); /* this task is going to sleep */
  1730. ;     genLeftShift
  1731.         mov     b,_run
  1732.         inc     b
  1733.         mov     a,#0x01
  1734.         sjmp    00110$
  1735. 00108$:
  1736.         add     a,acc
  1737. 00110$:
  1738.         djnz    b,00108$
  1739. ;     genCpl
  1740. ;       Peephole 105    removed redundant mov
  1741. ;     genAnd
  1742. ;       Peephole 105    removed redundant mov
  1743. ;       Peephole 184    removed redundant mov
  1744.         cpl     a
  1745.         mov     r2,a
  1746.         anl     _ready,a
  1747.         C$rt_task.c$494$1$1 ==.
  1748. ;rt_task.c:494: task_timer[run]    = ticks;
  1749. ;     genPlus
  1750.         mov     a,_run
  1751.         add     a,#_task_timer
  1752.         mov     r0,a
  1753. ;     genAssign
  1754.         mov     dptr,#_wait_timed_PARM_2
  1755.         movx    a,@dptr
  1756. ;     genPointerSet
  1757. ;     genNearPointerSet
  1758. ;       Peephole 192    used a instead of ar2 as source
  1759.         mov     r2,a
  1760.         mov     @r0,a
  1761.         C$rt_task.c$495$1$1 ==.
  1762. ;rt_task.c:495: task_masks[run]    = signal;   /* accept these signals as a validto wait on */
  1763. ;     genPlus
  1764.         mov     a,_run
  1765.         add     a,#_task_masks
  1766.         mov     r0,a
  1767. ;     genAssign
  1768.         mov     dptr,#_wait_timed_signal_1_1
  1769.         movx    a,@dptr
  1770. ;     genPointerSet
  1771. ;     genNearPointerSet
  1772. ;       Peephole 192    used a instead of ar2 as source
  1773.         mov     r2,a
  1774.         mov     @r0,a
  1775.         C$rt_task.c$496$2$5 ==.
  1776. ;rt_task.c:496: END_CRITICAL;
  1777. ;     genAssign
  1778.         mov     c,_wait_timed_EA_local_1_1
  1779.         mov     _EA,c
  1780.         C$rt_task.c$497$1$1 ==.
  1781. ;rt_task.c:497: reschedule();
  1782. ;     genCall
  1783.         lcall   _reschedule
  1784.         C$rt_task.c$498$1$1 ==.
  1785. ;rt_task.c:498: return task_signals[run];
  1786. ;     genPlus
  1787.         mov     a,_run
  1788.         add     a,#_task_signals
  1789.         mov     r0,a
  1790. ;     genPointerGet
  1791. ;     genNearPointerGet
  1792.         mov     ar2,@r0
  1793. ;     genRet
  1794.         mov     dpl,r2
  1795. 00104$:
  1796.         C$rt_task.c$499$1$1 ==.
  1797.         XG$wait_timed$0$0 ==.
  1798.         ret
  1799. ;------------------------------------------------------------
  1800. ;Allocation info for local variables in function 'sleep'
  1801. ;------------------------------------------------------------
  1802. ;ticks                     Allocated with name '_sleep_ticks_1_1'
  1803. ;------------------------------------------------------------
  1804.         G$sleep$0$0 ==.
  1805.         C$rt_task.c$502$1$1 ==.
  1806. ;rt_task.c:502: void sleep(char ticks)
  1807. ;       -----------------------------------------
  1808. ;        function sleep
  1809. ;       -----------------------------------------
  1810. _sleep:
  1811. ;     genReceive
  1812.         mov     a,dpl
  1813.         mov     dptr,#_sleep_ticks_1_1
  1814.         movx    @dptr,a
  1815.         C$rt_task.c$507$1$1 ==.
  1816. ;rt_task.c:507: if (ticks)
  1817. ;     genAssign
  1818.         mov     dptr,#_sleep_ticks_1_1
  1819.         movx    a,@dptr
  1820. ;     genIfx
  1821. ;       Peephole 105    removed redundant mov
  1822.         mov     r2,a
  1823. ;     genIfxJump
  1824.         jnz     00120$
  1825.         ljmp    00111$
  1826. 00120$:
  1827.         C$rt_task.c$509$3$3 ==.
  1828. ;rt_task.c:509: BEGIN_CRITICAL;
  1829. ;     genIfx
  1830. ;     genIfxJump
  1831. ;       Peephole 111    removed ljmp by inverse jump logic
  1832. ;     genAssign
  1833. ;       Peephole 250.a  using atomic test and clear
  1834.         jbc     _EA,00121$
  1835.         sjmp    00102$
  1836. 00121$:
  1837. ;     genAssign
  1838.         setb    _sleep_EA_local_1_1
  1839. ;       Peephole 112.b  changed ljmp to sjmp
  1840.         sjmp    00103$
  1841. 00102$:
  1842. ;     genAssign
  1843.         clr     _sleep_EA_local_1_1
  1844. 00103$:
  1845.         C$rt_task.c$510$2$2 ==.
  1846. ;rt_task.c:510: ready             &= ~TASK_BIT(run); /* this task is going to sleep */
  1847. ;     genLeftShift
  1848.         mov     b,_run
  1849.         inc     b
  1850.         mov     a,#0x01
  1851.         sjmp    00124$
  1852. 00122$:
  1853.         add     a,acc
  1854. 00124$:
  1855.         djnz    b,00122$
  1856. ;     genCpl
  1857. ;       Peephole 105    removed redundant mov
  1858. ;     genAnd
  1859. ;       Peephole 105    removed redundant mov
  1860. ;       Peephole 184    removed redundant mov
  1861.         cpl     a
  1862.         mov     r2,a
  1863.         anl     _ready,a
  1864.         C$rt_task.c$511$2$2 ==.
  1865. ;rt_task.c:511: task_timer[run]    = ticks;
  1866. ;     genPlus
  1867.         mov     a,_run
  1868.         add     a,#_task_timer
  1869.         mov     r0,a
  1870. ;     genAssign
  1871.         mov     dptr,#_sleep_ticks_1_1
  1872.         movx    a,@dptr
  1873. ;     genPointerSet
  1874. ;     genNearPointerSet
  1875. ;       Peephole 192    used a instead of ar2 as source
  1876.         mov     r2,a
  1877.         mov     @r0,a
  1878.         C$rt_task.c$512$2$2 ==.
  1879. ;rt_task.c:512: task_masks[run]    = TIMER_SIG;   /* accept this signal as a valid one to wait on */
  1880. ;     genPlus
  1881.         mov     a,_run
  1882.         add     a,#_task_masks
  1883. ;     genPointerSet
  1884. ;     genNearPointerSet
  1885. ;       Peephole 239    used a instead of acc
  1886.         mov     r0,a
  1887.         mov     @r0,#0x80
  1888.         C$rt_task.c$513$2$2 ==.
  1889. ;rt_task.c:513: task_signals[run] &=~TIMER_SIG;
  1890. ;     genPlus
  1891.         mov     a,_run
  1892.         add     a,#_task_signals
  1893.         mov     r0,a
  1894. ;     genPlus
  1895.         mov     a,_run
  1896.         add     a,#_task_signals
  1897.         mov     r1,a
  1898. ;     genPointerGet
  1899. ;     genNearPointerGet
  1900.         mov     ar2,@r1
  1901. ;     genAnd
  1902.         mov     a,#0x7F
  1903.         anl     a,r2
  1904. ;     genPointerSet
  1905. ;     genNearPointerSet
  1906.         mov     @r0,acc
  1907.         C$rt_task.c$515$2$2 ==.
  1908. ;rt_task.c:515: do {
  1909. 00107$:
  1910.         C$rt_task.c$516$4$7 ==.
  1911. ;rt_task.c:516: END_CRITICAL;
  1912. ;     genAssign
  1913.         mov     c,_sleep_EA_local_1_1
  1914.         mov     _EA,c
  1915.         C$rt_task.c$517$3$6 ==.
  1916. ;rt_task.c:517: reschedule();
  1917. ;     genCall
  1918.         lcall   _reschedule
  1919.         C$rt_task.c$518$4$8 ==.
  1920. ;rt_task.c:518: BEGIN_CRITICAL;
  1921. ;     genIfx
  1922. ;     genIfxJump
  1923. ;       Peephole 111    removed ljmp by inverse jump logic
  1924. ;     genAssign
  1925. ;       Peephole 250.a  using atomic test and clear
  1926.         jbc     _EA,00125$
  1927.         sjmp    00105$
  1928. 00125$:
  1929. ;     genAssign
  1930.         setb    _sleep_EA_local_1_1
  1931. ;       Peephole 112.b  changed ljmp to sjmp
  1932.         sjmp    00108$
  1933. 00105$:
  1934. ;     genAssign
  1935.         clr     _sleep_EA_local_1_1
  1936. 00108$:
  1937.         C$rt_task.c$520$2$2 ==.
  1938. ;rt_task.c:520: while((task_signals[run] & TIMER_SIG) == 0);
  1939. ;     genPlus
  1940.         mov     a,_run
  1941.         add     a,#_task_signals
  1942.         mov     r0,a
  1943. ;     genPointerGet
  1944. ;     genNearPointerGet
  1945.         mov     ar2,@r0
  1946. ;     genAnd
  1947.         anl     ar2,#0x80
  1948. ;     genCmpEq
  1949.         cjne    r2,#0x00,00126$
  1950. ;       Peephole 112.b  changed ljmp to sjmp
  1951.         sjmp    00107$
  1952. 00126$:
  1953.         C$rt_task.c$521$2$2 ==.
  1954. ;rt_task.c:521: task_signals[run] &= ~(TIMER_SIG);
  1955. ;     genPlus
  1956.         mov     a,_run
  1957.         add     a,#_task_signals
  1958.         mov     r0,a
  1959. ;     genPlus
  1960.         mov     a,_run
  1961.         add     a,#_task_signals
  1962.         mov     r1,a
  1963. ;     genPointerGet
  1964. ;     genNearPointerGet
  1965.         mov     ar2,@r1
  1966. ;     genAnd
  1967.         mov     a,#0x7F
  1968.         anl     a,r2
  1969. ;     genPointerSet
  1970. ;     genNearPointerSet
  1971.         mov     @r0,acc
  1972.         C$rt_task.c$522$2$2 ==.
  1973. ;rt_task.c:522: task_masks[run]   &= ~TIMER_SIG;   /* accept this signal as a valid one to wait on */
  1974. ;     genPlus
  1975.         mov     a,_run
  1976.         add     a,#_task_masks
  1977.         mov     r0,a
  1978. ;     genPlus
  1979.         mov     a,_run
  1980.         add     a,#_task_masks
  1981.         mov     r1,a
  1982. ;     genPointerGet
  1983. ;     genNearPointerGet
  1984.         mov     ar2,@r1
  1985. ;     genAnd
  1986.         mov     a,#0x7F
  1987.         anl     a,r2
  1988. ;     genPointerSet
  1989. ;     genNearPointerSet
  1990.         mov     @r0,acc
  1991.         C$rt_task.c$523$3$11 ==.
  1992. ;rt_task.c:523: END_CRITICAL;
  1993. ;     genAssign
  1994.         mov     c,_sleep_EA_local_1_1
  1995.         mov     _EA,c
  1996. ;       Peephole 112.b  changed ljmp to sjmp
  1997. ;       Peephole 251.b  replaced sjmp to ret with ret
  1998.         ret
  1999. 00111$:
  2000.         C$rt_task.c$527$2$12 ==.
  2001. ;rt_task.c:527: reschedule();
  2002. ;     genCall
  2003.         C$rt_task.c$530$1$1 ==.
  2004.         XG$sleep$0$0 ==.
  2005. ;       Peephole 253.c  replaced lcall with ljmp
  2006.         ljmp    _reschedule
  2007. 00113$:
  2008.         ret
  2009. ;------------------------------------------------------------
  2010. ;Allocation info for local variables in function 'clear_signal'
  2011. ;------------------------------------------------------------
  2012. ;pattern                   Allocated with name '_clear_signal_pattern_1_1'
  2013. ;------------------------------------------------------------
  2014.         G$clear_signal$0$0 ==.
  2015.         C$rt_task.c$533$1$1 ==.
  2016. ;rt_task.c:533: void clear_signal(char pattern)
  2017. ;       -----------------------------------------
  2018. ;        function clear_signal
  2019. ;       -----------------------------------------
  2020. _clear_signal:
  2021. ;     genReceive
  2022.         mov     a,dpl
  2023.         mov     dptr,#_clear_signal_pattern_1_1
  2024.         movx    @dptr,a
  2025.         C$rt_task.c$536$2$2 ==.
  2026. ;rt_task.c:536: BEGIN_CRITICAL;
  2027. ;     genIfx
  2028. ;     genIfxJump
  2029. ;       Peephole 111    removed ljmp by inverse jump logic
  2030. ;     genAssign
  2031. ;       Peephole 250.a  using atomic test and clear
  2032.         jbc     _EA,00107$
  2033.         sjmp    00102$
  2034. 00107$:
  2035. ;     genAssign
  2036.         setb    _clear_signal_EA_local_1_1
  2037. ;       Peephole 112.b  changed ljmp to sjmp
  2038.         sjmp    00103$
  2039. 00102$:
  2040. ;     genAssign
  2041.         clr     _clear_signal_EA_local_1_1
  2042. 00103$:
  2043.         C$rt_task.c$537$1$1 ==.
  2044. ;rt_task.c:537: task_signals[run] &= ~(pattern);
  2045. ;     genPlus
  2046.         mov     a,_run
  2047.         add     a,#_task_signals
  2048.         mov     r0,a
  2049. ;     genPlus
  2050.         mov     a,_run
  2051.         add     a,#_task_signals
  2052.         mov     r1,a
  2053. ;     genPointerGet
  2054. ;     genNearPointerGet
  2055.         mov     ar2,@r1
  2056. ;     genAssign
  2057.         mov     dptr,#_clear_signal_pattern_1_1
  2058.         movx    a,@dptr
  2059. ;     genCpl
  2060. ;       Peephole 105    removed redundant mov
  2061. ;     genAnd
  2062. ;       Peephole 105    removed redundant mov
  2063. ;       Peephole 184    removed redundant mov
  2064.         cpl     a
  2065.         mov     r3,a
  2066.         anl     a,r2
  2067. ;     genPointerSet
  2068. ;     genNearPointerSet
  2069.         mov     @r0,acc
  2070.         C$rt_task.c$538$2$5 ==.
  2071. ;rt_task.c:538: END_CRITICAL;
  2072. ;     genAssign
  2073.         mov     c,_clear_signal_EA_local_1_1
  2074.         mov     _EA,c
  2075. 00104$:
  2076.         C$rt_task.c$539$2$5 ==.
  2077.         XG$clear_signal$0$0 ==.
  2078.         ret
  2079. ;------------------------------------------------------------
  2080. ;Allocation info for local variables in function 'signal'
  2081. ;------------------------------------------------------------
  2082. ;pattern                   Allocated with name '_signal_PARM_2'
  2083. ;task                      Allocated with name '_signal_task_1_1'
  2084. ;------------------------------------------------------------
  2085.         G$signal$0$0 ==.
  2086.         C$rt_task.c$544$2$5 ==.
  2087. ;rt_task.c:544: void signal(char task,char pattern)
  2088. ;       -----------------------------------------
  2089. ;        function signal
  2090. ;       -----------------------------------------
  2091. _signal:
  2092. ;     genReceive
  2093.         mov     a,dpl
  2094.         mov     dptr,#_signal_task_1_1
  2095.         movx    @dptr,a
  2096.         C$rt_task.c$547$2$2 ==.
  2097. ;rt_task.c:547: BEGIN_CRITICAL;
  2098. ;     genIfx
  2099. ;     genIfxJump
  2100. ;       Peephole 111    removed ljmp by inverse jump logic
  2101. ;     genAssign
  2102. ;       Peephole 250.a  using atomic test and clear
  2103.         jbc     _EA,00110$
  2104.         sjmp    00102$
  2105. 00110$:
  2106. ;     genAssign
  2107.         setb    _signal_EA_local_1_1
  2108. ;       Peephole 112.b  changed ljmp to sjmp
  2109.         sjmp    00103$
  2110. 00102$:
  2111. ;     genAssign
  2112.         clr     _signal_EA_local_1_1
  2113. 00103$:
  2114.         C$rt_task.c$549$1$1 ==.
  2115. ;rt_task.c:549: INT_SIGNAL(task,pattern);
  2116. ;     genAssign
  2117.         mov     dptr,#_signal_task_1_1
  2118.         movx    a,@dptr
  2119. ;     genPlus
  2120. ;       Peephole 177.b  removed redundant mov
  2121.         mov     r2,a
  2122.         add     a,#_task_signals
  2123.         mov     r0,a
  2124. ;     genPlus
  2125. ;       Peephole 236.g  used r2 instead of ar2
  2126.         mov     a,r2
  2127.         add     a,#_task_signals
  2128.         mov     r1,a
  2129. ;     genPointerGet
  2130. ;     genNearPointerGet
  2131.         mov     ar3,@r1
  2132. ;     genAssign
  2133.         mov     dptr,#_signal_PARM_2
  2134.         movx    a,@dptr
  2135. ;     genOr
  2136. ;       Peephole 105    removed redundant mov
  2137.         mov     r4,a
  2138.         orl     a,r3
  2139. ;     genPointerSet
  2140. ;     genNearPointerSet
  2141.         mov     @r0,acc
  2142. ;     genPlus
  2143. ;       Peephole 236.g  used r2 instead of ar2
  2144.         mov     a,r2
  2145.         add     a,#_task_signals
  2146.         mov     r0,a
  2147. ;     genPointerGet
  2148. ;     genNearPointerGet
  2149.         mov     ar3,@r0
  2150. ;     genPlus
  2151. ;       Peephole 236.g  used r2 instead of ar2
  2152.         mov     a,r2
  2153.         add     a,#_task_masks
  2154.         mov     r0,a
  2155. ;     genPointerGet
  2156. ;     genNearPointerGet
  2157.         mov     ar4,@r0
  2158. ;     genAnd
  2159.         mov     a,r4
  2160.         anl     a,r3
  2161. ;     genIfx
  2162. ;     genIfxJump
  2163. ;       Peephole 110    removed ljmp by inverse jump logic
  2164.         jz      00105$
  2165. 00111$:
  2166. ;     genLeftShift
  2167.         mov     b,r2
  2168.         inc     b
  2169.         mov     a,#0x01
  2170.         sjmp    00114$
  2171. 00112$:
  2172.         add     a,acc
  2173. 00114$:
  2174.         djnz    b,00112$
  2175. ;     genOr
  2176. ;       Peephole 105    removed redundant mov
  2177.         mov     r2,a
  2178.         orl     _ready,a
  2179. 00105$:
  2180.         C$rt_task.c$551$2$6 ==.
  2181. ;rt_task.c:551: END_CRITICAL;
  2182. ;     genAssign
  2183.         mov     c,_signal_EA_local_1_1
  2184.         mov     _EA,c
  2185. 00106$:
  2186.         C$rt_task.c$552$2$6 ==.
  2187.         XG$signal$0$0 ==.
  2188.         ret
  2189. ;------------------------------------------------------------
  2190. ;Allocation info for local variables in function 'rt_system_init'
  2191. ;------------------------------------------------------------
  2192. ;------------------------------------------------------------
  2193.         G$rt_system_init$0$0 ==.
  2194.         C$rt_task.c$559$2$6 ==.
  2195. ;rt_task.c:559: void rt_system_init(void)
  2196. ;       -----------------------------------------
  2197. ;        function rt_system_init
  2198. ;       -----------------------------------------
  2199. _rt_system_init:
  2200.         C$rt_task.c$562$1$1 ==.
  2201. ;rt_task.c:562: AUXR  = M0 |XRS1 | XRS0  ;
  2202. ;     genAssign
  2203.         mov     _AUXR,#0x2C
  2204.         C$rt_task.c$563$1$1 ==.
  2205. ;rt_task.c:563: CKCON = WdX2 | PcaX2 | SiX2 | T2X2 | T0X2 | X2; /* T1X2 bit is '0' to double UART speed */
  2206. ;     genAssign
  2207.         mov     _CKCON,#0x7B
  2208.         C$rt_task.c$565$1$1 ==.
  2209. ;rt_task.c:565: TMOD  = 0x20; /* timer1 mode2 timer0 mode0 */
  2210. ;     genAssign
  2211.         mov     _TMOD,#0x20
  2212.         C$rt_task.c$567$1$1 ==.
  2213. ;rt_task.c:567: EA = 0;
  2214. ;     genAssign
  2215.         clr     _EA
  2216. 00101$:
  2217.         C$rt_task.c$570$1$1 ==.
  2218.         XG$rt_system_init$0$0 ==.
  2219.         ret
  2220.         .area CSEG    (CODE)
  2221. G$priotab$0$0 == .
  2222. _priotab:
  2223.         .db #0x00
  2224.         .db #0x00
  2225.         .db #0x01
  2226.         .db #0x01
  2227.         .db #0x02
  2228.         .db #0x02
  2229.         .db #0x02
  2230.         .db #0x02
  2231.         .db #0x03
  2232.         .db #0x03
  2233.         .db #0x03
  2234.         .db #0x03
  2235.         .db #0x03
  2236.         .db #0x03
  2237.         .db #0x03
  2238.         .db #0x03
  2239.         .db #0x00
  2240.         .db #0x00
  2241.         .db #0x01
  2242.         .db #0x00
  2243.         .db #0x02
  2244.         .db #0x00
  2245.         .db #0x01
  2246.         .db #0x01
  2247.         .db #0x03
  2248.         .db #0x00
  2249.         .db #0x01
  2250.         .db #0x01
  2251.         .db #0x02
  2252.         .db #0x02
  2253.         .db #0x02
  2254.         .db #0x02
  2255.         .db #0x00
  2256.         .db #0x00
  2257.         .db #0x01
  2258.         .db #0x01
  2259.         .db #0x02
  2260.         .db #0x02
  2261.         .db #0x02
  2262.         .db #0x00
  2263.         .db #0x03
  2264.         .db #0x03
  2265.         .db #0x03
  2266.         .db #0x00
  2267.         .db #0x03
  2268.         .db #0x00
  2269.         .db #0x01
  2270.         .db #0x01
  2271.         .db #0x00
  2272.         .db #0x00
  2273.         .db #0x01
  2274.         .db #0x00
  2275.         .db #0x02
  2276.         .db #0x00
  2277.         .db #0x01
  2278.         .db #0x02
  2279.         .db #0x03
  2280.         .db #0x00
  2281.         .db #0x01
  2282.         .db #0x03
  2283.         .db #0x02
  2284.         .db #0x03
  2285.         .db #0x03
  2286.         .db #0x00
  2287.         .area XINIT   (CODE)
  2288.