;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.6.1 #4330 (Oct 18 2006)
; This file generated Wed Oct 18 23:31:23 2006
;--------------------------------------------------------
	.module vprintf
	.optsdcc -mhc08
	
	.area HOME (CODE)
	.area GSINIT0 (CODE)
	.area GSINIT (CODE)
	.area GSFINAL (CODE)
	.area CSEG (CODE)
	.area XINIT
	.area CONST   (CODE)
	.area DSEG
	.area OSEG    (OVR)
	.area BSEG
	.area XSEG
	.area XISEG
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _vprintf_PARM_2
	.globl _vprintf
	.globl _printf
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
_vprintf_sloc0_1_0:
	.ds 2
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area OSEG    (OVR)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
_vprintf_PARM_2:
	.ds 2
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area HOME (CODE)
	.area GSINIT (CODE)
	.area GSFINAL (CODE)
	.area GSINIT (CODE)
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area HOME (CODE)
	.area CSEG (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG (CODE)
;------------------------------------------------------------
;Allocation info for local variables in function 'put_char_to_stdout'
;------------------------------------------------------------
;p                         Allocated to stack - offset 2
;c                         Allocated to registers 
;------------------------------------------------------------
;vprintf.c:29: static void put_char_to_stdout( char c, void* p ) _REENTRANT
;	-----------------------------------------
;	 function put_char_to_stdout
;	-----------------------------------------
_put_char_to_stdout:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
;vprintf.c:32: putchar( c );
; forgot to free a
;     genCall
;     loadRegFromAop (a, REG(-,-,x,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	_putchar
00101$:
	rts
;------------------------------------------------------------
;Allocation info for local variables in function 'vprintf'
;------------------------------------------------------------
;sloc0                     Allocated with name '_vprintf_sloc0_1_0'
;ap                        Allocated with name '_vprintf_PARM_2'
;format                    Allocated to registers 
;------------------------------------------------------------
;vprintf.c:35: int vprintf (const char *format, va_list ap)
;	-----------------------------------------
;	 function vprintf
;	-----------------------------------------
_vprintf:
;     genReceive
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(__print_format_PARM_3), 0), stacked=0, isaddr=1
	sta	(__print_format_PARM_3 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(__print_format_PARM_3), 1), stacked=0, isaddr=1
	stx	__print_format_PARM_3
;vprintf.c:37: return _print_format( put_char_to_stdout, NULL, format, ap );
;     genAssign
;     loadRegFromAop (a, LIT(#0x00), 1)
;     storeRegToAop (a, EXT(__print_format_PARM_2), 1), stacked=0, isaddr=1
;     loadRegFromAop (a, LIT(#0x00), 0)
;     storeRegToAop (a, EXT(__print_format_PARM_2), 0), stacked=0, isaddr=1
; Peephole 5c   - eliminated redundant clra
	clra
	sta	__print_format_PARM_2
	sta	(__print_format_PARM_2 + 1)
;     genAssign
;     loadRegFromAop (a, EXT(_vprintf_PARM_2), 1)
	lda	_vprintf_PARM_2
;     storeRegToAop (a, EXT(__print_format_PARM_4), 1), stacked=0, isaddr=1
	sta	__print_format_PARM_4
;     loadRegFromAop (a, EXT(_vprintf_PARM_2), 0)
	lda	(_vprintf_PARM_2 + 1)
;     storeRegToAop (a, EXT(__print_format_PARM_4), 0), stacked=0, isaddr=1
	sta	(__print_format_PARM_4 + 1)
;     genCall
;     loadRegFromAop (x, IMMD(_put_char_to_stdout), 1)
	ldx	#>_put_char_to_stdout
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, IMMD(_put_char_to_stdout), 0)
	lda	#_put_char_to_stdout
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	__print_format
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, DIR(_vprintf_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(_vprintf_sloc0_1_0 + 1)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, DIR(_vprintf_sloc0_1_0), 1), stacked=0, isaddr=0
	stx	*_vprintf_sloc0_1_0
;     genRet
;     loadRegFromAop (x, DIR(_vprintf_sloc0_1_0), 1)
	ldx	*_vprintf_sloc0_1_0
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, DIR(_vprintf_sloc0_1_0), 0)
	lda	*(_vprintf_sloc0_1_0 + 1)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00101$:
	rts
;------------------------------------------------------------
;Allocation info for local variables in function 'printf'
;------------------------------------------------------------
;format                    Allocated to stack - offset 2
;arg                       Allocated to registers 
;i                         Allocated to stack - offset -2
;sloc0                     Allocated to stack - offset -4
;------------------------------------------------------------
;vprintf.c:40: int printf (const char *format, ...)
;	-----------------------------------------
;	 function printf
;	-----------------------------------------
_printf:
	ais	#-4
;vprintf.c:45: va_start (arg, format);
;     genAddrOf
	tsx
	aix	#6
;     storeRegToAop (hx, SOF(iTemp1), 0), stacked=0, isaddr=0
; transferRegReg(h,a)
	pshh
	pula
;     storeRegToAop (a, SOF(iTemp1), 1), stacked=0, isaddr=0
	sta	1,s
;     storeRegToAop (x, SOF(iTemp1), 0), stacked=0, isaddr=0
	stx	2,s
; checking lic
; checking IS_ITEMP
;     genPlus
; IS_AOP_HX = 0
; icount = 2, sameRegs=0
;  left size = 2
;  right size = 1
;  result size = 2
;     loadRegFromAop (a, SOF(iTemp1), 0)
	lda	2,s
	add	#0x02
;     storeRegToAop (a, EXT(__print_format_PARM_4), 0), stacked=0, isaddr=1
	sta	(__print_format_PARM_4 + 1)
;     loadRegFromAop (a, SOF(iTemp1), 1)
	lda	1,s
	adc	#0x00
;     storeRegToAop (a, EXT(__print_format_PARM_4), 1), stacked=0, isaddr=1
	sta	__print_format_PARM_4
;vprintf.c:46: i = _print_format( put_char_to_stdout, NULL, format, arg );
;     genAssign
;     loadRegFromAop (a, LIT(#0x00), 1)
;     storeRegToAop (a, EXT(__print_format_PARM_2), 1), stacked=0, isaddr=1
;     loadRegFromAop (a, LIT(#0x00), 0)
;     storeRegToAop (a, EXT(__print_format_PARM_2), 0), stacked=0, isaddr=1
; Peephole 5c   - eliminated redundant clra
	clra
	sta	__print_format_PARM_2
	sta	(__print_format_PARM_2 + 1)
;     genAssign
;     loadRegFromAop (a, SOF(format), 1)
	lda	7,s
;     storeRegToAop (a, EXT(__print_format_PARM_3), 1), stacked=0, isaddr=1
	sta	__print_format_PARM_3
;     loadRegFromAop (a, SOF(format), 0)
	lda	8,s
;     storeRegToAop (a, EXT(__print_format_PARM_3), 0), stacked=0, isaddr=1
	sta	(__print_format_PARM_3 + 1)
;     genCall
;     loadRegFromAop (x, IMMD(_put_char_to_stdout), 1)
	ldx	#>_put_char_to_stdout
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, IMMD(_put_char_to_stdout), 0)
	lda	#_put_char_to_stdout
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
	jsr	__print_format
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, SOF(iTemp6), 0), stacked=0, isaddr=0
	sta	4,s
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, SOF(iTemp6), 1), stacked=0, isaddr=0
	stx	3,s
;     genAssign
;vprintf.c:49: return i;
;     genRet
;     loadRegFromAop (x, SOF(iTemp4), 1)
	ldx	3,s
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, SOF(iTemp4), 0)
	lda	4,s
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00101$:
	ais	#4
	rts
	.area CSEG (CODE)
	.area CONST   (CODE)
	.area XINIT
