;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.1.8Ia Tue Jul 27 21:49:47 1999

;--------------------------------------------------------
	.module vprintf
;--------------------------------------------------------
; publics variables in this module
;--------------------------------------------------------
	.globl _vprintf_PARM_2
	.globl _vprintf_PARM_1
	.globl _vsprintf_PARM_3
	.globl _vsprintf_PARM_2
	.globl _vsprintf_PARM_1
	.globl _radix
	.globl _output_ptr
	.globl _lsd
	.globl _lower_case
	.globl _output_to_string
	.globl _value
	.globl _vsprintf
	.globl _vprintf
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; special function bits 
;--------------------------------------------------------
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
	.area	DSEG    (DATA)
_value:
	.ds	0x0005
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
	.area	OSEG	(OVR,DATA)
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
	.area	ISEG    (DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
	.area	BSEG    (BIT)
_output_to_string:
	.ds	0x0001
_lower_case:
	.ds	0x0001
_lsd:
	.ds	0x0001
_vsprintf_left_justify_1_1:
	.ds	0x0001
_vsprintf_zero_padding_1_1:
	.ds	0x0001
_vsprintf_prefix_sign_1_1:
	.ds	0x0001
_vsprintf_prefix_space_1_1:
	.ds	0x0001
_vsprintf_signed_argument_1_1:
	.ds	0x0001
_vsprintf_char_argument_1_1:
	.ds	0x0001
_vsprintf_long_argument_1_1:
	.ds	0x0001
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
	.area	XSEG    (XDATA)
_output_ptr:
	.ds	0x0003
_radix:
	.ds	0x0001
_vsprintf_PARM_1:
	.ds	0x0003
_vsprintf_PARM_2:
	.ds	0x0003
_vsprintf_PARM_3:
	.ds	0x0001
_vprintf_PARM_1:
	.ds	0x0003
_vprintf_PARM_2:
	.ds	0x0001
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area GSINIT (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG (CODE)
;  vprintf.c 63
;  -----------------------------------------
;   function output_char
;  -----------------------------------------
_output_char:
	ar2 = 0x02
	ar3 = 0x03
	ar4 = 0x04
	ar5 = 0x05
	ar6 = 0x06
	ar7 = 0x07
	ar0 = 0x00
	ar1 = 0x01
	push  _bp
	mov  _bp,sp
;  vprintf.c 65
; Peephole 111
	jnb  _output_to_string,00102$
00107$:
;  vprintf.c 67
	mov  dptr,#_output_ptr
	movx  a,@dptr
	mov  r2,a
	inc  dptr
	movx  a,@dptr
	mov  r3,a
	inc  dptr
	movx  a,@dptr
	mov  r4,a
	mov  dptr,#_output_ptr
	mov  a,#0x01
	add  a,r2
	movx  @dptr,a
; Peephole 180
	clr  a
	addc  a,r3
	inc  dptr
	movx  @dptr,a
	inc  dptr
	mov  a,r4
	movx  @dptr,a
	mov  dpl,r2
	mov  dph,r3
	mov  b,r4
	mov  a,_bp
	add  a,#0xfd
	mov  r0,a
	mov  a,@r0
	lcall  __gptrput
; Peephole 132
	sjmp 00104$
00102$:
;  vprintf.c 71
	mov  a,_bp
	add  a,#0xfd
	mov  r0,a
	mov  dptr,#_putchar_PARM_1
	mov  a,@r0
	movx  @dptr,a
	lcall  _putchar
00104$:
	mov  sp,_bp
	pop  _bp
	ret  
;  vprintf.c 77
;  -----------------------------------------
;   function output_digit
;  -----------------------------------------
_output_digit:
	push  _bp
	mov  _bp,sp
;  vprintf.c 79
	mov  a,_bp
	add  a,#0xfd
	mov  r0,a
	clr  c
	mov  a,#0x09
	subb  a,@r0
	clr  a
	rlc  a
; Peephole 105
	mov  r2,a
	cjne  a,#0x01,00109$
00109$:
	clr  a
	rlc  a
; Peephole 105
	mov  r2,a
; Peephole 110
	jz  00103$
00110$:
	mov  a,_bp
	add  a,#0xfd
	mov  r0,a
	mov  a,#0x30
	add  a,@r0
	mov  r2,a
; Peephole 132
	sjmp 00104$
00103$:
; Peephole 111
	jnb  _lower_case,00105$
00111$:
	mov  a,_bp
	add  a,#0xfd
	mov  r0,a
	mov  a,#0x57
	add  a,@r0
	mov  r3,a
; Peephole 132
	sjmp 00106$
00105$:
	mov  a,_bp
	add  a,#0xfd
	mov  r0,a
	mov  a,#0x37
	add  a,@r0
	mov  r3,a
00106$:
	mov  ar2,r3
00104$:
	push  ar2
	lcall  _output_char
	dec  sp
00101$:
	mov  sp,_bp
	pop  _bp
	ret  
;  vprintf.c 84
;  -----------------------------------------
;   function output_2digits
;  -----------------------------------------
_output_2digits:
	push  _bp
	mov  _bp,sp
;  vprintf.c 86
	mov  a,_bp
	add  a,#0xfd
	mov  r0,a
	mov  a,@r0
	swap  a
	anl  a,#0x0f
	mov  r2,a
	push  ar2
	lcall  _output_digit
	dec  sp
;  vprintf.c 87
	mov  a,_bp
	add  a,#0xfd
	mov  r0,a
	mov  a,#0x0f
	anl  a,@r0
	mov  r2,a
	push  ar2
	lcall  _output_digit
	dec  sp
00101$:
	mov  sp,_bp
	pop  _bp
	ret  
;  vprintf.c 92
;  -----------------------------------------
;   function calculate_digit
;  -----------------------------------------
_calculate_digit:
;  vprintf.c 96
	mov  r2,#0x20
00103$:
	cjne  r2,#0x00,00112$
; Peephole 132
	sjmp 00107$
00112$:
;  vprintf.c 115
	  clr  c  
	  mov  a,_value+0  
	  rlc  a  
	  mov  _value+0,a  
	  mov  a,_value+1  
	  rlc  a  
	  mov  _value+1,a  
	  mov  a,_value+2  
	  rlc  a  
	  mov  _value+2,a  
	  mov  a,_value+3  
	  rlc  a  
	  mov  _value+3,a  
	  mov  a,_value+4  
	  rlc  a  
	  mov  _value+4,a  
;  vprintf.c 117
	mov  dptr,#_radix
	movx  a,@dptr
	mov  r3,a
	clr  c
	mov  a,0x0004 + _value
	subb  a,r3
; Peephole 132
; Peephole 160
	jc   00105$
00113$:
;  vprintf.c 119
	clr  c
	mov  a,0x0004 + _value
	subb  a,r3
	mov  0x0004 + _value,a
;  vprintf.c 120
	mov  a,#0x01
	add  a,_value
	mov  _value,a
00105$:
;  vprintf.c 96
	dec  r2
; Peephole 132
	sjmp 00103$
00107$:
	ret  
;  vprintf.c 127
;  -----------------------------------------
;   function vsprintf
;  -----------------------------------------
_vsprintf:
;  vprintf.c 141
	mov  dptr,#_vsprintf_PARM_1
	movx  a,@dptr
	mov  r2,a
	inc  dptr
	movx  a,@dptr
	mov  r3,a
	inc  dptr
	movx  a,@dptr
	mov  r4,a
	mov  dptr,#_output_ptr
	mov  a,r2
	movx  @dptr,a
	inc  dptr
	mov  a,r3
	movx  @dptr,a
	inc  dptr
	mov  a,r4
	movx  @dptr,a
;  vprintf.c 142
	mov  a,r2
	orl  a,r3
	orl  a,r4
; Peephole 109
	jnz  00102$
00259$:
;  vprintf.c 144
	clr  _output_to_string
; Peephole 132
	sjmp 00235$
00102$:
;  vprintf.c 148
	setb  _output_to_string
;  vprintf.c 151
00235$:
00193$:
	mov  dptr,#_vsprintf_PARM_2
	movx  a,@dptr
	mov  r2,a
	inc  dptr
	movx  a,@dptr
	mov  r3,a
	inc  dptr
	movx  a,@dptr
	mov  r4,a
	mov  a,#0x01
	add  a,r2
	mov  r5,a
; Peephole 180
	clr  a
	addc  a,r3
	mov  r6,a
	mov  ar7,r4
	mov  dptr,#_vsprintf_PARM_2
	mov  a,r5
	movx  @dptr,a
	inc  dptr
	mov  a,r6
	movx  @dptr,a
	inc  dptr
	mov  a,r7
	movx  @dptr,a
	mov  dpl,r2
	mov  dph,r3
	mov  b,r4
	lcall  __gptrget
; Peephole 105
	mov  r2,a
	jnz  00260$
	ljmp  00196$
00260$:
;  vprintf.c 153
	cjne  r2,#0x25,00261$
	sjmp  00262$
00261$:
	ljmp  00191$
00262$:
;  vprintf.c 155
	clr  _vsprintf_left_justify_1_1
;  vprintf.c 156
	clr  _vsprintf_zero_padding_1_1
;  vprintf.c 157
	clr  _vsprintf_prefix_sign_1_1
;  vprintf.c 158
	clr  _vsprintf_prefix_space_1_1
;  vprintf.c 159
	clr  _vsprintf_signed_argument_1_1
;  vprintf.c 160
	mov  dptr,#_radix
; Peephole 180
	clr  a
	movx  @dptr,a
;  vprintf.c 161
	clr  _vsprintf_char_argument_1_1
;  vprintf.c 162
	clr  _vsprintf_long_argument_1_1
;  vprintf.c 163
	mov  r1,#0x00
;  vprintf.c 167
00104$:
	mov  ar4,r5
	mov  ar3,r6
	mov  ar0,r7
	inc  r5
	cjne  r5,#0x00,00263$
	inc  r6
00263$:
	mov  dptr,#_vsprintf_PARM_2
	mov  a,r5
	movx  @dptr,a
	inc  dptr
	mov  a,r6
	movx  @dptr,a
	inc  dptr
	mov  a,r7
	movx  @dptr,a
	mov  dpl,r4
	mov  dph,r3
	mov  b,r0
	lcall  __gptrget
	mov  r3,a
	mov  ar4,r3
;  vprintf.c 169
	mov  dptr,#_isdigit_PARM_1
	mov  a,r3
	movx  @dptr,a
	push  ar2
	push  ar3
	push  ar4
	push  ar5
	push  ar6
	push  ar7
	push  ar1
	lcall  _isdigit
	mov  r0,dpl
	pop  ar1
	pop  ar7
	pop  ar6
	pop  ar5
	pop  ar4
	pop  ar3
	pop  ar2
	mov  a,r0
; Peephole 110
	jz  00108$
00264$:
;  vprintf.c 171
	push  ar2
	mov  ar0,r1
	mov  b,#0x0a
	mov  a,r0
	mul  ab
	mov  r0,a
	mov  a,r3
	add  a,#0xd0
; Peephole 105
	mov  r2,a
	add  a,r0
	mov  r0,a
	mov  ar1,r0
;  vprintf.c 173
	pop  ar2
	cjne  r0,#0x00,00265$
	sjmp  00266$
00265$:
	ljmp  00104$
00266$:
;  vprintf.c 176
	setb  _vsprintf_zero_padding_1_1
;  vprintf.c 178
	ljmp  00104$
00108$:
;  vprintf.c 181
	mov  dptr,#_islower_PARM_1
	mov  a,r3
	movx  @dptr,a
	push  ar2
	push  ar3
	push  ar4
	push  ar5
	push  ar6
	push  ar7
	push  ar1
	lcall  _islower
	mov  a,dpl
	cjne  a,#0x01,00267$
00267$:
	cpl  c
	mov  _lower_case,c
	pop  ar1
	pop  ar7
	pop  ar6
	pop  ar5
	pop  ar4
	pop  ar3
	pop  ar2
;  vprintf.c 182
; Peephole 111
	jnb  _lower_case,00110$
00268$:
;  vprintf.c 184
	mov  a,#0xdf
	anl  a,r3
	mov  r4,a
00110$:
;  vprintf.c 187
	mov  ar3,r4
	cjne  r3,#0x20,00269$
; Peephole 132
	sjmp 00113$
00269$:
	cjne  r3,#0x2b,00270$
; Peephole 132
	sjmp 00112$
00270$:
	cjne  r3,#0x2d,00271$
; Peephole 132
	sjmp 00111$
00271$:
	cjne  r3,#0x42,00272$
; Peephole 132
	sjmp 00114$
00272$:
	cjne  r3,#0x43,00273$
; Peephole 132
	sjmp 00116$
00273$:
	cjne  r3,#0x44,00274$
	ljmp  00137$
00274$:
	cjne  r3,#0x49,00275$
	ljmp  00137$
00275$:
	cjne  r3,#0x4c,00276$
; Peephole 132
	sjmp 00115$
00276$:
	cjne  r3,#0x4f,00277$
	ljmp  00139$
00277$:
	cjne  r3,#0x50,00278$
	ljmp  00133$
00278$:
	cjne  r3,#0x53,00279$
; Peephole 132
	sjmp 00117$
00279$:
	cjne  r3,#0x55,00280$
	ljmp  00140$
00280$:
	cjne  r3,#0x58,00281$
	ljmp  00141$
00281$:
	ljmp  00142$
;  vprintf.c 190
00111$:
	setb  _vsprintf_left_justify_1_1
;  vprintf.c 191
	ljmp  00104$
;  vprintf.c 193
00112$:
	setb  _vsprintf_prefix_sign_1_1
;  vprintf.c 194
	ljmp  00104$
;  vprintf.c 196
00113$:
	setb  _vsprintf_prefix_space_1_1
;  vprintf.c 197
	ljmp  00104$
;  vprintf.c 199
00114$:
	setb  _vsprintf_char_argument_1_1
;  vprintf.c 200
	ljmp  00104$
;  vprintf.c 202
00115$:
	setb  _vsprintf_long_argument_1_1
;  vprintf.c 203
	ljmp  00104$
;  vprintf.c 206
00116$:
	mov  dptr,#_vsprintf_PARM_3
	movx  a,@dptr
; Peephole 105
	mov  r4,a
	add  a,#0xff
; Peephole 100
	mov  r0,a
	mov  dptr,#_vsprintf_PARM_3
	movx @dptr,a
	mov  ar4,@r0
	push  ar2
	push  ar3
	push  ar1
	push  ar4
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar3
	pop  ar2
;  vprintf.c 207
	ljmp  00143$
;  vprintf.c 210
00117$:
	mov  dptr,#_vsprintf_PARM_3
	movx  a,@dptr
; Peephole 105
	mov  r4,a
	add  a,#0xfd
; Peephole 100
	mov  r0,a
	mov  dptr,#_vsprintf_PARM_3
	movx @dptr,a
	mov  ar4,@r0
	inc  r0
	mov  ar5,@r0
	inc  r0
	mov  ar6,@r0
	dec  r0
	dec  r0
	mov  _value,r4
	mov  (_value + 1),r5
	mov  (_value + 2),r6
;  vprintf.c 212
	mov  dptr,#_strlen_PARM_1
	mov  a,_value
	movx  @dptr,a
	inc  dptr
	mov  a,(_value + 1)
	movx  @dptr,a
	inc  dptr
	mov  a,(_value + 2)
	movx  @dptr,a
	push  ar2
	push  ar3
	push  ar1
	lcall  _strlen
	mov  r4,dpl
	mov  r5,dph
	pop  ar1
	pop  ar3
	pop  ar2
;  vprintf.c 213
; Peephole 112
	jb   _vsprintf_left_justify_1_1,00124$
00282$:
	mov  ar5,r1
	clr  c
	mov  a,r4
	subb  a,r5
; Peephole 108
	jnc  00124$
00283$:
;  vprintf.c 215
	clr  c
	mov  a,r5
	subb  a,r4
	mov  r5,a
;  vprintf.c 216
00118$:
	mov  ar6,r5
	dec  r5
	mov  ar1,r5
	cjne  r6,#0x00,00284$
; Peephole 132
	sjmp 00124$
00284$:
;  vprintf.c 218
	push  ar2
	push  ar3
	push  ar4
	push  ar5
	push  ar1
	mov  a,#0x20
	push  acc
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar5
	pop  ar4
	pop  ar3
	pop  ar2
;  vprintf.c 222
; Peephole 132
	sjmp 00118$
00124$:
	mov  r5,_value
	mov  r6,(_value + 1)
	mov  r7,(_value + 2)
	mov  dpl,r5
	mov  dph,r6
	mov  b,r7
	lcall  __gptrget
; Peephole 105
	mov  r0,a
; Peephole 110
	jz  00126$
00285$:
;  vprintf.c 223
	push  ar4
	push  ar2
	mov  a,#0x01
	add  a,r5
	mov  r0,a
; Peephole 180
	clr  a
	addc  a,r6
	mov  r2,a
	mov  ar4,r7
	mov  _value,r0
	mov  (_value + 1),r2
	mov  (_value + 2),r4
	mov  dpl,r5
	mov  dph,r6
	mov  b,r7
	lcall  __gptrget
	mov  r5,a
	push  ar2
	push  ar3
	push  ar4
	push  ar1
	push  ar5
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar4
	pop  ar3
	pop  ar2
	pop  ar2
	pop  ar4
; Peephole 132
	sjmp 00124$
00126$:
;  vprintf.c 225
	jb  _vsprintf_left_justify_1_1,00286$
	ljmp  00143$
00286$:
	mov  ar5,r1
	clr  c
	mov  a,r4
	subb  a,r5
	jc  00287$
	ljmp  00143$
00287$:
;  vprintf.c 227
	clr  c
	mov  a,r5
	subb  a,r4
	mov  r4,a
;  vprintf.c 228
00127$:
	mov  ar5,r4
	dec  r4
	mov  ar1,r4
	cjne  r5,#0x00,00288$
	ljmp  00143$
00288$:
;  vprintf.c 230
	push  ar2
	push  ar3
	push  ar4
	push  ar1
	mov  a,#0x20
	push  acc
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar4
	pop  ar3
	pop  ar2
;  vprintf.c 236
; Peephole 132
	sjmp 00127$
00133$:
	mov  dptr,#_vsprintf_PARM_3
	movx  a,@dptr
; Peephole 105
	mov  r4,a
	add  a,#0xfd
; Peephole 100
	mov  r0,a
	mov  dptr,#_vsprintf_PARM_3
	movx @dptr,a
	mov  ar4,@r0
	inc  r0
	mov  ar5,@r0
	inc  r0
	mov  ar0,@r0
	dec  r0
	dec  r0
	mov  _value,r4
	mov  (_value + 1),r5
	mov  (_value + 2),r0
;  vprintf.c 238
	clr  c
	mov  a,#0x03
	subb  a,0x0002 + _value
; Peephole 108
	jnc  00198$
00289$:
	mov  r4,#0x04
; Peephole 132
	sjmp 00199$
00198$:
	mov  r4,0x0002 + _value
00199$:
	mov  a,r4
; Peephole 180
; Peephole 186
	mov  dptr,#_memory_id
	movc a,@a+dptr
	mov  r4,a
	push  ar2
	push  ar3
	push  ar1
	push  ar4
	lcall  _output_char
	dec  sp
;  vprintf.c 239
; Peephole 1
; Peephole 1
; Peephole 1
	mov  a,#0x3a
	push  acc
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar3
	pop  ar2
;  vprintf.c 240
	mov  a,0x0002 + _value
; Peephole 110
	jz  00135$
00290$:
	mov  a,0x0002 + _value
	cjne  a,#0x03,00291$
; Peephole 132
	sjmp 00135$
00291$:
;  vprintf.c 241
	push  ar2
	push  ar3
	push  ar1
	push  0x0001 + _value
	lcall  _output_2digits
	dec  sp
	pop  ar1
	pop  ar3
	pop  ar2
00135$:
;  vprintf.c 242
	push  ar2
	push  ar3
	push  ar1
	push  _value
	lcall  _output_2digits
	dec  sp
	pop  ar1
	pop  ar3
	pop  ar2
;  vprintf.c 243
;  vprintf.c 247
; Peephole 132
	sjmp 00143$
00137$:
	setb  _vsprintf_signed_argument_1_1
;  vprintf.c 248
	mov  dptr,#_radix
	mov  a,#0x0a
	movx  @dptr,a
;  vprintf.c 249
;  vprintf.c 252
; Peephole 132
	sjmp 00143$
00139$:
	mov  dptr,#_radix
	mov  a,#0x08
	movx  @dptr,a
;  vprintf.c 253
;  vprintf.c 256
; Peephole 132
	sjmp 00143$
00140$:
	mov  dptr,#_radix
	mov  a,#0x0a
	movx  @dptr,a
;  vprintf.c 257
;  vprintf.c 260
; Peephole 132
	sjmp 00143$
00141$:
	mov  dptr,#_radix
	mov  a,#0x10
	movx  @dptr,a
;  vprintf.c 261
;  vprintf.c 265
; Peephole 132
	sjmp 00143$
00142$:
	push  ar2
	push  ar1
	push  ar3
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar2
;  vprintf.c 267
00143$:
;  vprintf.c 269
	mov  dptr,#_radix
	movx  a,@dptr
	mov  r3,a
	cjne  r3,#0x00,00292$
	ljmp  00193$
00292$:
;  vprintf.c 275
; Peephole 111
	jnb  _vsprintf_char_argument_1_1,00152$
00293$:
;  vprintf.c 277
	mov  dptr,#_vsprintf_PARM_3
	movx  a,@dptr
; Peephole 105
	mov  r3,a
	add  a,#0xff
; Peephole 100
	mov  r0,a
	mov  dptr,#_vsprintf_PARM_3
	movx @dptr,a
	mov  ar3,@r0
	mov  a,r3
	rlc  a
	subb  a,acc
	mov  r4,a
	mov  r5,a
	mov  r0,a
	mov  _value,r3
	mov  (_value + 1),r4
	mov  (_value + 2),r5
	mov  (_value + 3),r0
;  vprintf.c 278
	jnb  _vsprintf_signed_argument_1_1,00294$
	ljmp  00153$
00294$:
;  vprintf.c 280
	mov  0x0001 + _value,#0x00
;  vprintf.c 281
	mov  0x0002 + _value,#0x00
;  vprintf.c 282
	mov  0x0003 + _value,#0x00
	ljmp  00153$
00152$:
;  vprintf.c 285
; Peephole 111
	jnb  _vsprintf_long_argument_1_1,00149$
00295$:
;  vprintf.c 287
	mov  dptr,#_vsprintf_PARM_3
	movx  a,@dptr
; Peephole 105
	mov  r3,a
	add  a,#0xfc
; Peephole 100
	mov  r0,a
	mov  dptr,#_vsprintf_PARM_3
	movx @dptr,a
	mov  ar3,@r0
	inc  r0
	mov  ar4,@r0
	inc  r0
	mov  ar5,@r0
	inc  r0
	mov  ar0,@r0
	dec  r0
	dec  r0
	dec  r0
	mov  _value,r3
	mov  (_value + 1),r4
	mov  (_value + 2),r5
	mov  (_value + 3),r0
; Peephole 132
	sjmp 00153$
00149$:
;  vprintf.c 291
	mov  dptr,#_vsprintf_PARM_3
	movx  a,@dptr
; Peephole 105
	mov  r3,a
	add  a,#0xfe
; Peephole 100
	mov  r0,a
	mov  dptr,#_vsprintf_PARM_3
	movx @dptr,a
	mov  ar3,@r0
	inc  r0
	mov  ar4,@r0
	dec  r0
	mov  a,r4
	rlc  a
	subb  a,acc
	mov  r5,a
	mov  r0,a
	mov  _value,r3
	mov  (_value + 1),r4
	mov  (_value + 2),r5
	mov  (_value + 3),r0
;  vprintf.c 292
; Peephole 112
	jb   _vsprintf_signed_argument_1_1,00153$
00296$:
;  vprintf.c 294
	mov  0x0002 + _value,#0x00
;  vprintf.c 295
	mov  0x0003 + _value,#0x00
00153$:
;  vprintf.c 299
; Peephole 111
	jnb  _vsprintf_signed_argument_1_1,00158$
00297$:
;  vprintf.c 301
	mov  a,(_value + 3)
; Peephole 111
	jnb  acc.7,00155$
00298$:
;  vprintf.c 302
	clr  c
	clr  a
	subb  a,_value
	mov  r3,a
	clr  a
	subb  a,(_value + 1)
	mov  r4,a
	clr  a
	subb  a,(_value + 2)
	mov  r5,a
	clr  a
	subb  a,(_value + 3)
	mov  r0,a
	mov  _value,r3
	mov  (_value + 1),r4
	mov  (_value + 2),r5
	mov  (_value + 3),r0
; Peephole 132
	sjmp 00158$
00155$:
;  vprintf.c 304
	clr  _vsprintf_signed_argument_1_1
00158$:
;  vprintf.c 307
	mov  r3,#0x00
;  vprintf.c 308
	setb  _lsd
;  vprintf.c 309
	mov  r4,#0x00
00162$:
	mov  a,_value
; Peephole 162
	jz   00300$
00299$:
; Peephole 132
	sjmp 00163$
00300$:
	mov  a,0x0001 + _value
; Peephole 162
	jz   00302$
00301$:
; Peephole 132
	sjmp 00163$
00302$:
;  vprintf.c 310
	mov  a,0x0002 + _value
; Peephole 162
	jz   00304$
00303$:
; Peephole 132
	sjmp 00163$
00304$:
	mov  ar3,r4
	mov  a,0x0003 + _value
; Peephole 110
	jz  00164$
00305$:
00163$:
;  vprintf.c 312
	mov  0x0004 + _value,#0x00
;  vprintf.c 313
	push  ar2
	push  ar3
	push  ar4
	push  ar1
	lcall  _calculate_digit
	pop  ar1
	pop  ar4
	pop  ar3
	pop  ar2
;  vprintf.c 327
	  jb   _lsd,1$  
	  pop  b                ; b = <lsd>  
	  mov  a,_value+4       ; a = <msd>  
	  swap a  
	  orl  b,a              ; b = <msd><lsd>  
	  push b  
	  sjmp 2$  
	1$:  
	  mov  a,_value+4       ; a = <lsd>  
	  push acc  
	2$:  
;  vprintf.c 329
	inc  r4
;  vprintf.c 330
; Peephole 167
	cpl  _lsd 
; Peephole 132
	sjmp 00162$
00164$:
;  vprintf.c 333
	mov  ar5,r1
; Peephole 132
; Peephole 199
	cjne r5,#0x00,00166$
; Peephole 201
00306$:
00307$:
;  vprintf.c 338
	mov  r1,#0x01
00166$:
;  vprintf.c 342
; Peephole 112
	jb   _vsprintf_zero_padding_1_1,00171$
00308$:
;  vprintf.c 344
	inc  r4
	mov  ar5,r1
00167$:
	mov  ar1,r5
	clr  c
	mov  a,r4
	subb  a,r5
; Peephole 108
	jnc  00171$
00309$:
;  vprintf.c 346
	push  ar2
	push  ar3
	push  ar5
	push  ar1
	mov  a,#0x20
	push  acc
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar5
	pop  ar3
	pop  ar2
;  vprintf.c 347
	dec  r5
; Peephole 132
	sjmp 00167$
00171$:
;  vprintf.c 351
; Peephole 111
	jnb  _vsprintf_signed_argument_1_1,00180$
00310$:
;  vprintf.c 353
	push  ar2
	push  ar3
	push  ar1
	mov  a,#0x2d
	push  acc
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar3
	pop  ar2
;  vprintf.c 355
	mov  ar4,r1
	mov  a,r4
	add  a,#0xff
	mov  r1,a
; Peephole 132
	sjmp 00256$
00180$:
;  vprintf.c 357
	mov  ar4,r3
	cjne  r4,#0x00,00311$
; Peephole 132
	sjmp 00256$
00311$:
;  vprintf.c 360
; Peephole 111
	jnb  _vsprintf_prefix_sign_1_1,00175$
00312$:
;  vprintf.c 362
	push  ar2
	push  ar3
	push  ar1
	mov  a,#0x2b
	push  acc
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar3
	pop  ar2
;  vprintf.c 364
	mov  ar4,r1
	mov  a,r4
	add  a,#0xff
	mov  r1,a
; Peephole 132
	sjmp 00256$
00175$:
;  vprintf.c 366
; Peephole 111
	jnb  _vsprintf_prefix_space_1_1,00256$
00313$:
;  vprintf.c 368
	push  ar2
	push  ar3
	push  ar1
	mov  a,#0x20
	push  acc
	lcall  _output_char
	dec  sp
	pop  ar1
	pop  ar3
	pop  ar2
;  vprintf.c 370
	mov  ar4,r1
	mov  a,r4
	add  a,#0xff
	mov  r1,a
;  vprintf.c 375
00256$:
	mov  ar4,r1
00182$:
	mov  ar5,r4
	dec  r4
	clr  c
	mov  a,r3
	subb  a,r5
; Peephole 108
	jnc  00258$
00314$:
;  vprintf.c 377
; Peephole 111
	jnb  _vsprintf_zero_padding_1_1,00200$
00315$:
	mov  r5,#0x30
; Peephole 132
	sjmp 00201$
00200$:
	mov  r5,#0x20
00201$:
	push  ar2
	push  ar3
	push  ar4
	push  ar5
	lcall  _output_char
	dec  sp
	pop  ar4
	pop  ar3
	pop  ar2
;  vprintf.c 381
; Peephole 132
	sjmp 00182$
00258$:
00185$:
	mov  ar4,r3
	dec  r3
	mov  a,r4
	jnz  00316$
	ljmp  00193$
00316$:
;  vprintf.c 383
; Peephole 167
	cpl  _lsd 
;  vprintf.c 398
	  jb   _lsd,3$  
	  pop  acc              ; a = <msd><lsd>  
	  nop                   ; to disable the "optimizer"  
	  push acc  
	  swap a  
	  anl  a,#0x0F          ; a = <msd>  
	  sjmp 4$  
	3$:  
	  pop  acc  
	  anl  a,#0x0F          ; a = <lsd>  
	4$:  
	  mov  _value+4,a  
;  vprintf.c 400
	push  ar2
	push  ar3
	push  0x0004 + _value
	lcall  _output_digit
	dec  sp
	pop  ar3
	pop  ar2
; Peephole 132
	sjmp 00185$
00191$:
;  vprintf.c 407
	push  ar2
	lcall  _output_char
	dec  sp
	ljmp  00193$
00196$:
	ret  
;  vprintf.c 414
;  -----------------------------------------
;   function vprintf
;  -----------------------------------------
_vprintf:
;  vprintf.c 416
	mov  dptr,#_vsprintf_PARM_1
	clr  a
	inc  dptr
	inc  dptr
	movx  @dptr,a
	lcall  __decdptr
	movx  @dptr,a
	lcall  __decdptr
	movx  @dptr,a
	mov  dptr,#_vprintf_PARM_1
	movx  a,@dptr
	mov  r2,a
	inc  dptr
	movx  a,@dptr
	mov  r3,a
	inc  dptr
	movx  a,@dptr
	mov  r4,a
	mov  dptr,#_vsprintf_PARM_2
	mov  a,r2
	movx  @dptr,a
	inc  dptr
	mov  a,r3
	movx  @dptr,a
	inc  dptr
	mov  a,r4
	movx  @dptr,a
	mov  dptr,#_vprintf_PARM_2
	movx  a,@dptr
; Peephole 100
	mov  r2,a
	mov  dptr,#_vsprintf_PARM_3
	movx @dptr,a
	lcall  _vsprintf
00101$:
	ret  
	.area	CSEG    (CODE)
_memory_id:
	.ascii /IXCP-/
	.byte	0
	.byte 0
