C51 COMPILER V8.04   C_ROOT                                                                05/20/2006 16:10:31 PAGE 1   


C51 COMPILER V8.04, COMPILATION OF MODULE C_ROOT
OBJECT MODULE PLACED IN C_root.OBJ
COMPILER INVOKED BY: C:\keil\C51\BIN\C51.EXE C_root.c OMF2 BROWSE MOD517(NOAU) VARBANKING(1) DEBUG CODE

line level    source

   1          /*------------------------------------------------------------------------------
   2          C_ROOT.C
   3          
   4          Copyright 1995-2005 Keil Software, Inc.
   5          ------------------------------------------------------------------------------*/
   6          
   7          #include <stdio.h>
   8          #include <reg51.h>
   9          #include <string.h>
  10          
  11          extern void func0(void);
  12          extern void func1(void);
  13          
  14          unsigned int xdata  xarr[100];   // array in standard xdata memory
  15          unsigned int far    farr[100];   // array in xdata bank 1
  16          unsigned char xdata xstr[100];   // xdata string
  17          
  18          
  19          void main(void) {
  20   1      
  21   1        unsigned int i;
  22   1      
  23   1      /* INITIALIZE SERIAL INTERFACE TO 2400 BAUD @12MHz */
  24   1        SCON = 0x52;    /* SCON */
  25   1        TMOD = 0x20;    /* TMOD */
  26   1        TCON = 0x69;    /* TCON */
  27   1        TH1 =  0xf3;    /* TH1 */
  28   1      
  29   1        strcpy (xstr, "Test of multiple DPTR support");
  30   1      
  31   1        for (i = 0; i < 100; i++)  {  // initialize arrays 
  32   2          xarr[i] = i | 0x100;
  33   2          farr[i] = i | 0x200;
  34   2        }
  35   1      
  36   1        printf("MAIN PROGRAM CALLS A FUNCTION IN BANK 0 \n");
  37   1        func0();
  38   1        printf("MAIN PROGRAM CALLS A FUNCTION IN BANK 1 \n");
  39   1        func1();
  40   1      
  41   1        while(1);
  42   1      }
C51 COMPILER V8.04   C_ROOT                                                                05/20/2006 16:10:31 PAGE 2   

ASSEMBLY LISTING OF GENERATED OBJECT CODE


             ; FUNCTION main (BEGIN)
                                           ; SOURCE LINE # 19
                                           ; SOURCE LINE # 24
0000 759852            MOV     SCON,#052H
                                           ; SOURCE LINE # 25
0003 758920            MOV     TMOD,#020H
                                           ; SOURCE LINE # 26
0006 758869            MOV     TCON,#069H
                                           ; SOURCE LINE # 27
0009 758DF3            MOV     TH1,#0F3H
                                           ; SOURCE LINE # 29
000C 7800        R     MOV     R0,#LOW xstr
000E 7C00        R     MOV     R4,#HIGH xstr
0010 7D01              MOV     R5,#01H
0012 7BFF              MOV     R3,#0FFH
0014 7A00        R     MOV     R2,#HIGH ?SC_0
0016 7900        R     MOV     R1,#LOW ?SC_0
0018 120000      E     LCALL   ?C?STRCPY517
                                           ; SOURCE LINE # 31
001B E4                CLR     A
001C F500        R     MOV     i,A
001E F500        R     MOV     i+01H,A
0020         ?C0001:
                                           ; SOURCE LINE # 32
0020 E500        R     MOV     A,i
0022 4401              ORL     A,#01H
0024 FC                MOV     R4,A
0025 E500        R     MOV     A,i+01H
0027 25E0              ADD     A,ACC
0029 FF                MOV     R7,A
002A E500        R     MOV     A,i
002C 33                RLC     A
002D FE                MOV     R6,A
002E 7400        R     MOV     A,#LOW xarr
0030 2F                ADD     A,R7
0031 F582              MOV     DPL,A
0033 7400        R     MOV     A,#HIGH xarr
0035 3E                ADDC    A,R6
0036 F583              MOV     DPH,A
0038 EC                MOV     A,R4
0039 F0                MOVX    @DPTR,A
003A A3                INC     DPTR
003B E500        R     MOV     A,i+01H
003D F0                MOVX    @DPTR,A
                                           ; SOURCE LINE # 33
003E E500        R     MOV     A,i
0040 4402              ORL     A,#02H
0042 FA                MOV     R2,A
0043 E500        R     MOV     A,i+01H
0045 25E0              ADD     A,ACC
0047 FF                MOV     R7,A
0048 E500        R     MOV     A,i
004A 33                RLC     A
004B FE                MOV     R6,A
004C 7400        R     MOV     A,#LOW farr
004E 2F                ADD     A,R7
004F F9                MOV     R1,A
0050 7400        R     MOV     A,#HIGH farr
0052 3E                ADDC    A,R6
C51 COMPILER V8.04   C_ROOT                                                                05/20/2006 16:10:31 PAGE 3   

0053 7B00        R     MOV     R3,#MBYTE farr
0055 CA                XCH     A,R2
0056 8500F0      R     MOV     B,i+01H
0059 120000      E     LCALL   ?C?ISTPTR
                                           ; SOURCE LINE # 34
005C 0500        R     INC     i+01H
005E E500        R     MOV     A,i+01H
0060 7002              JNZ     ?C0007
0062 0500        R     INC     i
0064         ?C0007:
0064 6464              XRL     A,#064H
0066 4500        R     ORL     A,i
0068 70B6              JNZ     ?C0001
006A         ?C0002:
                                           ; SOURCE LINE # 36
006A 7BFF              MOV     R3,#0FFH
006C 7A00        R     MOV     R2,#HIGH ?SC_30
006E 7900        R     MOV     R1,#LOW ?SC_30
0070 120000      E     LCALL   _printf
                                           ; SOURCE LINE # 37
0073 120000      E     LCALL   func0
                                           ; SOURCE LINE # 38
0076 7BFF              MOV     R3,#0FFH
0078 7A00        R     MOV     R2,#HIGH ?SC_72
007A 7900        R     MOV     R1,#LOW ?SC_72
007C 120000      E     LCALL   _printf
                                           ; SOURCE LINE # 39
007F 120000      E     LCALL   func1
0082         ?C0004:
                                           ; SOURCE LINE # 41
0082 80FE              SJMP    ?C0004
             ; FUNCTION main (END)



MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    132    ----
   CONSTANT SIZE    =    114    ----
   XDATA SIZE       =    300    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       2
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
   EDATA SIZE       =   ----    ----
   HDATA SIZE       =    200    ----
   XDATA CONST SIZE =   ----    ----
   FAR CONST SIZE   =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
