#include <pcx51.inc>
#include <Rc51Regs.inc>
C0Seg     segment code
CodeSeg   segment code
XDataSeg  segment xdata

; --- external and public functions ---
public            _main

; --- external and public variables ---

                                        ; #line 1 // ------------- READS51 generated header -------------- 
                                        ; #line 2 // module  : C:\Rigel\Reads51\Work\Output\Output.c
                                        ; #line 3 // created : 12:33:17, Friday, November 09, 2001
                                        ; #line 4 // ----------------------------------------------------- 
                                        ; #line 5 
                                        ; #line 6 
                                        ; #line 7 /*"#C:\Rigel\Reads51\Include\sfr51.h"*/
                                        ; #line 8 // --- 8051 registers ---
                                        ; #line 9 sfr ACC (0xE0),
                                        ; #line 10     B   (0xF0),
                                        ; #line 11     DPH (0x83),
                                        ; #line 12     DPL (0x82),
                                        ; #line 13     IE  (0xA8),
                                        ; #line 14     IP  (0xB8),
                                        ; #line 15     P0  (0x80),
                                        ; #line 16     P1  (0x90),
                                        ; #line 17     P2  (0xA0),
                                        ; #line 18     P3  (0xB0),
                                        ; #line 19     PCON(0x87),
                                        ; #line 20     PSW (0xD0),
                                        ; #line 21     SBUF(0x99),
                                        ; #line 22     SCON(0x98),
                                        ; #line 23     SP  (0x81),
                                        ; #line 24     TCON(0x88),
                                        ; #line 25     TH0 (0x8C),
                                        ; #line 26     TH1 (0x8D),
                                        ; #line 27     TL0 (0x8A),
                                        ; #line 28     TL1 (0x8B),
                                        ; #line 29     TMOD(0x89);
                                        ; #line 30 
                                        ; #line 31 // --- 8051 register bit fields ---
                                        ; #line 32 // IE
                                        ; #line 33 sfrbit EA  (0xAF),
                                        ; #line 34        ES  (0xAC),
                                        ; #line 35        ET1 (0xAB),
                                        ; #line 36        EX1 (0xAA),
                                        ; #line 37        ET0 (0xA9),
                                        ; #line 38        EX0 (0xA8),
                                        ; #line 39 // IP 
                                        ; #line 40        PS  (0xBC),
                                        ; #line 41        PT1 (0xBB),
                                        ; #line 42        PX1 (0xBA),
                                        ; #line 43        PT0 (0xB9),
                                        ; #line 44        PX0 (0xB8),
                                        ; #line 45 // P0
                                        ; #line 46        P0_0(0x80),
                                        ; #line 47        P0_1(0x81),
                                        ; #line 48        P0_2(0x82),
                                        ; #line 49        P0_3(0x83),
                                        ; #line 50        P0_4(0x84),
                                        ; #line 51        P0_5(0x85),
                                        ; #line 52        P0_6(0x86),
                                        ; #line 53        P0_7(0x87),
                                        ; #line 54 // P1
                                        ; #line 55        P1_0(0x90),
                                        ; #line 56        P1_1(0x91),
                                        ; #line 57        P1_2(0x92),
                                        ; #line 58        P1_3(0x93),
                                        ; #line 59        P1_4(0x94),
                                        ; #line 60        P1_5(0x95),
                                        ; #line 61        P1_6(0x96),
                                        ; #line 62        P1_7(0x97),
                                        ; #line 63 // P2
                                        ; #line 64        P2_0(0xA0),
                                        ; #line 65        P2_1(0xA1),
                                        ; #line 66        P2_2(0xA2),
                                        ; #line 67        P2_3(0xA3),
                                        ; #line 68        P2_4(0xA4),
                                        ; #line 69        P2_5(0xA5),
                                        ; #line 70        P2_6(0xA6),
                                        ; #line 71        P2_7(0xA7),
                                        ; #line 72 // P3
                                        ; #line 73        P3_0(0xB0),
                                        ; #line 74        P3_1(0xB1),
                                        ; #line 75        P3_2(0xB2),
                                        ; #line 76        P3_3(0xB3),
                                        ; #line 77        P3_4(0xB4),
                                        ; #line 78        P3_5(0xB5),
                                        ; #line 79        P3_6(0xB6),
                                        ; #line 80        P3_7(0xB7),
                                        ; #line 81 // P3 alternate function pin names
                                        ; #line 82        RD  (0xB7),
                                        ; #line 83        WR  (0xB6),
                                        ; #line 84        T1  (0xB5),
                                        ; #line 85        T0  (0xB4),
                                        ; #line 86        INT1(0xB3),
                                        ; #line 87        INT0(0xB2),
                                        ; #line 88        TXD (0xB1),
                                        ; #line 89        RXD (0xB0),
                                        ; #line 90 // PSW
                                        ; #line 91        CY  (0xD7),
                                        ; #line 92        AC  (0xD6),
                                        ; #line 93        F0  (0xD5),
                                        ; #line 94        RS1 (0xD4),
                                        ; #line 95        RS0 (0xD3),
                                        ; #line 96        OV  (0xD2),
                                        ; #line 97        P   (0xD0),
                                        ; #line 98 // TCON
                                        ; #line 99        TF1 (0x8F),
                                        ; #line 100        TR1 (0x8E),
                                        ; #line 101        TF0 (0x8D),
                                        ; #line 102        TR0 (0x8C),
                                        ; #line 103        IE1 (0x8B),
                                        ; #line 104        IT1 (0x8A),
                                        ; #line 105        IE0 (0x89),
                                        ; #line 106        IT0 (0x88),
                                        ; #line 107 // SCON
                                        ; #line 108        SM0 (0x9F),
                                        ; #line 109        SM1 (0x9E),
                                        ; #line 110        SM2 (0x9D),
                                        ; #line 111        REN (0x9C),
                                        ; #line 112        TB8 (0x9B),
                                        ; #line 113        RB8 (0x9A),
                                        ; #line 114        TI  (0x99),
                                        ; #line 115        RI  (0x98);
                                        ; #line 116 
                                        ; #line 117  
                                        ; #line 118 main(){
                                        ; -----------------------------------------------
          rseg    CodeSeg               ; CHGSEG(2)
_main:                                  ; DECLPUBm(main)
          mov     SPH, #0x40            ; ENTERMAIN(16384)
          mov     SPL, #0x00
          mov     BPH, SPH
          mov     BPL, SPL
                                        ; #line 119 unsigned char n;
                                        ; #line 120 // endless loop
                                        ; #line 121  while(1)
                                        ; -----------------------------------------------
          mov     a, #0x01              ; ADDSP(1)
          mov     b, #0x00
          lcall   __addsp
_1:                                     ; LABm(_1:)
          mov     PRL, #0x01            ; GETw1n(1)
          mov     PRH, #0x00
                                        ; #line 122   {   
                                        ; #line 123    for(n=0; n<256; n++)
                                        ; -----------------------------------------------
          mov     SRL, BPL              ; POINT2s(0)
          mov     SRH, BPH
          mov     PRL, #0x00            ; GETw1n(0)
          mov     PRH, #0x00
          mov     dpl, SRL              ; PUTbp1
          mov     dph, SRH
          mov     a, PRL
          movx    @dptr, a
                                        ; -----------------------------------------------
_5:                                     ; LABm(_5:)
          mov     dpl, BPL              ; GETb2su(0)
          mov     dph, BPH
          movx    a, @dptr
          mov     SRL, a
          mov     SRH, #0
          mov     PRL, #0x00            ; GETw1n(256)
          mov     PRH, #0x01
          lcall   __swap12              ; SWAP12
          lcall   __ult12               ; LT12u
          mov     a, PRL                ; EQ10(_4)
          orl     a, PRH
          jnz     $+5
          ljmp    _4
                                        ; -----------------------------------------------
          ljmp    _6                    ; JMPn(_6)
_3:                                     ; LABm(_3:)
          mov     SRL, BPL              ; POINT2s(0)
          mov     SRH, BPH
          mov     dpl, SRL              ; GETb1pu(0)
          mov     dph, SRH
          movx    a, @dptr
          mov     PRL, a
          mov     PRH, #0
          mov     dpl, SRL              ; INCbp
          mov     dph, SRH
          movx    a, @dptr
          add     a, #1
          movx    @dptr, a
          inc     dptr
          jb      acc.7, $+7
          clr     a
          movx    @dptr, a
          sjmp    $+5
          mov     a, #0xFF
          movx    @dptr, a
                                        ; -----------------------------------------------
          ljmp    _5                    ; JMPn(_5)
_6:                                     ; LABm(_6:)
                                        ; #line 124     {
                                        ; #line 125      P1=n;     
                                        ; -----------------------------------------------
          mov     dpl, BPL              ; GETb1su(0)
          mov     dph, BPH
          movx    a, @dptr
          mov     PRL, a
          mov     PRH, #0
          mov     0x90, PRL             ; PUTsfr1(144)
                                        ; #line 126     }
                                        ; #line 127    }
                                        ; -----------------------------------------------
          ljmp    _3                    ; JMPn(_3)
_4:                                     ; LABm(_4:)
                                        ; #line 128 }
                                        ; -----------------------------------------------
          ljmp    _1                    ; JMPn(_1)
_2:                                     ; LABm(_2:)
          mov     a, #0xFF              ; ADDSP(-1)
          mov     b, #0xFF
          lcall   __addsp
                                        ; -----------------------------------------------
          ljmp    _main                 ; RETMAIN
                                        ; #line 129 
                                        ; -----------------------------------------------
          end                           ; ENDSEG(2)
