;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 2.9.0 #5416 (Aug 15 2009) (UNIX)
; This file was generated Thu Mar 25 11:06:52 2010
;--------------------------------------------------------
; PIC port for the 14-bit core
;--------------------------------------------------------
;	.file	"module.c"
	list	p=12f683
	radix dec
	include "p12f683.inc"
;--------------------------------------------------------
; external declarations
;--------------------------------------------------------
	extern	__divsint
	extern	_ADCON0_bits
	extern	_ANSEL_bits
	extern	_CCP1CON_bits
	extern	_CMCON0_bits
	extern	_CMCON1_bits
	extern	_EECON1_bits
	extern	_GPIO_bits
	extern	_INTCON_bits
	extern	_IOC_bits
	extern	_IOCA_bits
	extern	_OPTION_REG_bits
	extern	_OSCCON_bits
	extern	_OSCTUNE_bits
	extern	_PCON_bits
	extern	_PIE1_bits
	extern	_PIR1_bits
	extern	_STATUS_bits
	extern	_T1CON_bits
	extern	_T2CON_bits
	extern	_VRCON_bits
	extern	_WDTCON_bits
	extern	_INDF
	extern	_TMR0
	extern	_PCL
	extern	_STATUS
	extern	_FSR
	extern	_GPIO
	extern	_PCLATH
	extern	_INTCON
	extern	_PIR1
	extern	_TMR1L
	extern	_TMR1H
	extern	_T1CON
	extern	_TMR2
	extern	_T2CON
	extern	_CCPR1L
	extern	_CCPR1H
	extern	_CCP1CON
	extern	_WDTCON
	extern	_CMCON0
	extern	_CMCON1
	extern	_ADRESH
	extern	_ADCON0
	extern	_OPTION_REG
	extern	_TRISIO
	extern	_PIE1
	extern	_PCON
	extern	_OSCCON
	extern	_OSCTUNE
	extern	_PR2
	extern	_WPU
	extern	_WPUA
	extern	_IOC
	extern	_IOCA
	extern	_VRCON
	extern	_EEDATA
	extern	_EEDAT
	extern	_EEADR
	extern	_EECON1
	extern	_EECON2
	extern	_ADRESL
	extern	_ANSEL
	extern	__sdcc_gsinit_startup
;--------------------------------------------------------
; global declarations
;--------------------------------------------------------
	global	_main

	global PSAVE
	global SSAVE
	global WSAVE
	global STK12
	global STK11
	global STK10
	global STK09
	global STK08
	global STK07
	global STK06
	global STK05
	global STK04
	global STK03
	global STK02
	global STK01
	global STK00

sharebank udata_ovr 0x0070
PSAVE	res 1
SSAVE	res 1
WSAVE	res 1
STK12	res 1
STK11	res 1
STK10	res 1
STK09	res 1
STK08	res 1
STK07	res 1
STK06	res 1
STK05	res 1
STK04	res 1
STK03	res 1
STK02	res 1
STK01	res 1
STK00	res 1

;--------------------------------------------------------
; global definitions
;--------------------------------------------------------
;--------------------------------------------------------
; absolute symbol definitions
;--------------------------------------------------------
;--------------------------------------------------------
; compiler-defined variables
;--------------------------------------------------------
UDL_module_0	udata
r0x1005	res	1
r0x1004	res	1
r0x1006	res	1
r0x1001	res	1
r0x1000	res	1
r0x1002	res	1
;--------------------------------------------------------
; initialized data
;--------------------------------------------------------
;--------------------------------------------------------
; overlayable items in internal ram 
;--------------------------------------------------------
;	udata_ovr
;--------------------------------------------------------
; reset vector 
;--------------------------------------------------------
STARTUP	code 0x0000
	nop
	pagesel __sdcc_gsinit_startup
	goto	__sdcc_gsinit_startup
;--------------------------------------------------------
; code
;--------------------------------------------------------
code_module	code
;***
;  pBlock Stats: dbName = M
;***
;entry:  _main	;Function start
; 2 exit points
;has an exit
;functions called:
;   _test_sub
;   _test_sub
;3 compiler assigned registers:
;   STK02
;   STK01
;   STK00
;; Starting pCode block
_main	;Function start
; 2 exit points
;	.line	13; "module.c"	a = test_sub (1,2) ;
	MOVLW	0x02
	MOVWF	STK02
	MOVLW	0x00
	MOVWF	STK01
	MOVLW	0x01
	MOVWF	STK00
	MOVLW	0x00
	CALL	_test_sub
;	.line	14; "module.c"	return (0);
	MOVLW	0x00
	MOVWF	STK00
	MOVLW	0x00
	RETURN	
; exit point of _main

;***
;  pBlock Stats: dbName = C
;***
;entry:  _test2	;Function start
; 2 exit points
;has an exit
;functions called:
;   __divsint
;   __divsint
;7 compiler assigned registers:
;   r0x1000
;   STK00
;   r0x1001
;   STK01
;   r0x1002
;   STK02
;   r0x1003
;; Starting pCode block
_test2	;Function start
; 2 exit points
;	.line	23; "module.c"	test2 (int a, int b) {
	BANKSEL	r0x1000
	MOVWF	r0x1000
	MOVF	STK00,W
	MOVWF	r0x1001
	MOVF	STK01,W
	MOVWF	r0x1002
	MOVF	STK02,W
;;1	MOVWF	r0x1003
;	.line	24; "module.c"	return (a/b);
	MOVWF	STK02
	MOVF	r0x1002,W
	MOVWF	STK01
	MOVF	r0x1001,W
	MOVWF	STK00
	MOVF	r0x1000,W
	PAGESEL	__divsint
	CALL	__divsint
	PAGESEL	$
	BANKSEL	r0x1000
	MOVWF	r0x1000
	MOVF	STK00,W
	MOVWF	r0x1001
	MOVWF	STK00
	MOVF	r0x1000,W
	RETURN	
; exit point of _test2

;***
;  pBlock Stats: dbName = C
;***
;entry:  _test_sub	;Function start
; 2 exit points
;has an exit
;functions called:
;   _test2
;   _test2
;7 compiler assigned registers:
;   r0x1004
;   STK00
;   r0x1005
;   STK01
;   r0x1006
;   STK02
;   r0x1007
;; Starting pCode block
_test_sub	;Function start
; 2 exit points
;	.line	18; "module.c"	test_sub (int a, int b) {
	BANKSEL	r0x1004
	MOVWF	r0x1004
	MOVF	STK00,W
	MOVWF	r0x1005
	MOVF	STK01,W
	MOVWF	r0x1006
	MOVF	STK02,W
;;1	MOVWF	r0x1007
;	.line	19; "module.c"	return (test2 (a,b));
	MOVWF	STK02
	MOVF	r0x1006,W
	MOVWF	STK01
	MOVF	r0x1005,W
	MOVWF	STK00
	MOVF	r0x1004,W
	CALL	_test2
	BANKSEL	r0x1004
	MOVWF	r0x1004
	MOVF	STK00,W
	MOVWF	r0x1005
	MOVWF	STK00
	MOVF	r0x1004,W
	RETURN	
; exit point of _test_sub


;	code size estimation:
;	   50+    6 =    56 instructions (  124 byte)

	end
