                              1 ; /*-------------------------------------------------------------------------
                              2 ;
                              3 ;   crtxclear.asm :- C run-time: clear XSEG
                              4 ;
                              5 ;    This library is free software; you can redistribute it and/or modify it
                              6 ;    under the terms of the GNU Library General Public License as published by the
                              7 ;    Free Software Foundation; either version 2, or (at your option) any
                              8 ;    later version.
                              9 ;
                             10 ;    This library is distributed in the hope that it will be useful,
                             11 ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
                             12 ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             13 ;    GNU Library General Public License for more details.
                             14 ;
                             15 ;    You should have received a copy of the GNU Library General Public License
                             16 ;    along with this program; if not, write to the Free Software
                             17 ;    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
                             18 ;
                             19 ;    In other words, you are welcome to use, share and improve this program.
                             20 ;    You are forbidden to forbid anyone else to use, share and improve
                             21 ;    what you give them.   Help stamp out software-hoarding!
                             22 ; -------------------------------------------------------------------------*/
                             23 
                             24 	.area CSEG    (CODE)
                             25 	.area GSINIT0 (CODE)
                             26 	.area GSINIT1 (CODE)
                             27 	.area GSINIT2 (CODE)
                             28 	.area GSINIT3 (CODE)
                             29 	.area GSINIT4 (CODE)
                             30 	.area GSINIT5 (CODE)
                             31 	.area GSINIT  (CODE)
                             32 	.area GSFINAL (CODE)
                             33 
                             34 	.area GSINIT4 (CODE)
                             35 
   0000                      36 __mcs51_genXRAMCLEAR::
   0000 78r00                37 	mov	r0,#l_PSEG
   0002 E8                   38 	mov	a,r0
   0003 44s00                39 	orl	a,#(l_PSEG >> 8)
   0005 60 0A                40 	jz	00006$
   0007 79r00                41 	mov	r1,#s_PSEG
   0009 75*00s00             42 	mov	__XPAGE,#(s_PSEG >> 8)
   000C E4                   43 	clr     a
   000D F3                   44 00005$:	movx	@r1,a
   000E 09                   45 	inc	r1
   000F D8 FC                46 	djnz	r0,00005$
                             47 
   0011                      48 00006$:
   0011 78r00                49 	mov	r0,#l_XSEG
   0013 E8                   50 	mov	a,r0
   0014 44s00                51 	orl	a,#(l_XSEG >> 8)
   0016 60 0C                52 	jz	00008$
   0018 79s00                53 	mov	r1,#((l_XSEG + 255) >> 8)
   001A 90s00r00             54 	mov	dptr,#s_XSEG
   001D E4                   55 	clr     a
   001E F0                   56 00007$:	movx	@dptr,a
   001F A3                   57 	inc	dptr
   0020 D8 FC                58 	djnz	r0,00007$
   0022 D9 FA                59 	djnz	r1,00007$
   0024                      60 00008$:
                             61 
