;--------------------------------------------------------
; File Created by SDCC : FreeWare ANSI-C Compiler
; Version 2.4.0 Tue Oct 12 01:21:23 2004

;--------------------------------------------------------
	.module _divslong
	
	.area CSEG
	.area GSINIT
	.area GSFINAL
	.area XINIT
	.area DSEG
	.area OSEG    (OVR)
	.area BSEG
	.area XSEG
	.area XISEG
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl __divslong_PARM_2
	.globl __divslong_PARM_1
	.globl __divslong
;--------------------------------------------------------
;  ram data
;--------------------------------------------------------
	.area DSEG
__divslong_sloc0_1_0::
	.ds 4
__divslong_sloc1_1_0::
	.ds 4
;--------------------------------------------------------
; overlayable items in  ram 
;--------------------------------------------------------
	.area OSEG    (OVR)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
	.area XISEG
;--------------------------------------------------------
; extended address mode data
;--------------------------------------------------------
	.area XSEG
__divslong_PARM_1::
	.ds 4
__divslong_PARM_2::
	.ds 4
__divslong_r_1_1::
	.ds 4
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area GSINIT
	.area GSFINAL
	.area GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area HOME
	.area CSEG
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area CSEG
;------------------------------------------------------------
;Allocation info for local variables in function '_divslong'
;------------------------------------------------------------
;sloc0                     Allocated with name '__divslong_sloc0_1_0'
;sloc1                     Allocated with name '__divslong_sloc1_1_0'
;a                         Allocated with name '__divslong_PARM_1'
;b                         Allocated with name '__divslong_PARM_2'
;r                         Allocated with name '__divslong_r_1_1'
;------------------------------------------------------------
;_divslong.c:257: _divslong (long a, long b)
;	-----------------------------------------
;	 function _divslong
;	-----------------------------------------
__divslong:
;_divslong.c:261: r = _divulong((a < 0 ? -a : a),
;     genCmpLt
;     genCmp
;     loadRegFromAop (a, EXT(__divslong_PARM_1), 3)
	lda	__divslong_PARM_1
	rola
;     genIfxJump
; Peephole 2a	- eliminated jmp
	bcc	00106$
00113$:
;     genUminus
	clra
	sub	(__divslong_PARM_1 + 3)
;     storeRegToAop (a, DIR(__divslong_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(__divslong_sloc0_1_0 + 3)
	clra
	sbc	(__divslong_PARM_1 + 2)
;     storeRegToAop (a, DIR(__divslong_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*(__divslong_sloc0_1_0 + 2)
	clra
	sbc	(__divslong_PARM_1 + 1)
;     storeRegToAop (a, DIR(__divslong_sloc0_1_0), 2), stacked=0, isaddr=0
	sta	*(__divslong_sloc0_1_0 + 1)
	clra
	sbc	__divslong_PARM_1
;     storeRegToAop (a, DIR(__divslong_sloc0_1_0), 3), stacked=0, isaddr=0
	sta	*__divslong_sloc0_1_0
; Peephole 3	- shortened jmp to bra
	bra	00107$
00106$:
;     genAssign
;     loadRegFromAop (a, EXT(__divslong_PARM_1), 0)
	lda	(__divslong_PARM_1 + 3)
;     storeRegToAop (a, DIR(__divslong_sloc0_1_0), 0), stacked=0, isaddr=0
	sta	*(__divslong_sloc0_1_0 + 3)
;     loadRegFromAop (a, EXT(__divslong_PARM_1), 1)
	lda	(__divslong_PARM_1 + 2)
;     storeRegToAop (a, DIR(__divslong_sloc0_1_0), 1), stacked=0, isaddr=0
	sta	*(__divslong_sloc0_1_0 + 2)
;     loadRegFromAop (a, EXT(__divslong_PARM_1), 2)
	lda	(__divslong_PARM_1 + 1)
;     storeRegToAop (a, DIR(__divslong_sloc0_1_0), 2), stacked=0, isaddr=0
	sta	*(__divslong_sloc0_1_0 + 1)
;     loadRegFromAop (a, EXT(__divslong_PARM_1), 3)
	lda	__divslong_PARM_1
;     storeRegToAop (a, DIR(__divslong_sloc0_1_0), 3), stacked=0, isaddr=0
	sta	*__divslong_sloc0_1_0
00107$:
;     genAssign
;_divslong.c:262: (b < 0 ? -b : b));
;     genCmpLt
;     genCmp
;     loadRegFromAop (a, EXT(__divslong_PARM_2), 3)
	lda	__divslong_PARM_2
	rola
;     genIfxJump
; Peephole 2a	- eliminated jmp
	bcc	00108$
00114$:
;     genUminus
	clra
	sub	(__divslong_PARM_2 + 3)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 3)
	clra
	sbc	(__divslong_PARM_2 + 2)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 2)
	clra
	sbc	(__divslong_PARM_2 + 1)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 2), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 1)
	clra
	sbc	__divslong_PARM_2
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 3), stacked=0, isaddr=0
	sta	*__divslong_sloc1_1_0
; Peephole 3	- shortened jmp to bra
	bra	00109$
00108$:
;     genAssign
;     loadRegFromAop (a, EXT(__divslong_PARM_2), 0)
	lda	(__divslong_PARM_2 + 3)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 3)
;     loadRegFromAop (a, EXT(__divslong_PARM_2), 1)
	lda	(__divslong_PARM_2 + 2)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 2)
;     loadRegFromAop (a, EXT(__divslong_PARM_2), 2)
	lda	(__divslong_PARM_2 + 1)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 2), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 1)
;     loadRegFromAop (a, EXT(__divslong_PARM_2), 3)
	lda	__divslong_PARM_2
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 3), stacked=0, isaddr=0
	sta	*__divslong_sloc1_1_0
00109$:
;     genAssign
;     loadRegFromAop (a, DIR(__divslong_sloc0_1_0), 0)
	lda	*(__divslong_sloc0_1_0 + 3)
;     storeRegToAop (a, EXT(__divulong_PARM_1), 0), stacked=0, isaddr=1
	sta	(__divulong_PARM_1 + 3)
;     loadRegFromAop (a, DIR(__divslong_sloc0_1_0), 1)
	lda	*(__divslong_sloc0_1_0 + 2)
;     storeRegToAop (a, EXT(__divulong_PARM_1), 1), stacked=0, isaddr=1
	sta	(__divulong_PARM_1 + 2)
;     loadRegFromAop (a, DIR(__divslong_sloc0_1_0), 2)
	lda	*(__divslong_sloc0_1_0 + 1)
;     storeRegToAop (a, EXT(__divulong_PARM_1), 2), stacked=0, isaddr=1
	sta	(__divulong_PARM_1 + 1)
;     loadRegFromAop (a, DIR(__divslong_sloc0_1_0), 3)
	lda	*__divslong_sloc0_1_0
;     storeRegToAop (a, EXT(__divulong_PARM_1), 3), stacked=0, isaddr=1
	sta	__divulong_PARM_1
;     genAssign
;     loadRegFromAop (a, DIR(__divslong_sloc1_1_0), 0)
	lda	*(__divslong_sloc1_1_0 + 3)
;     storeRegToAop (a, EXT(__divulong_PARM_2), 0), stacked=0, isaddr=1
	sta	(__divulong_PARM_2 + 3)
;     loadRegFromAop (a, DIR(__divslong_sloc1_1_0), 1)
	lda	*(__divslong_sloc1_1_0 + 2)
;     storeRegToAop (a, EXT(__divulong_PARM_2), 1), stacked=0, isaddr=1
	sta	(__divulong_PARM_2 + 2)
;     loadRegFromAop (a, DIR(__divslong_sloc1_1_0), 2)
	lda	*(__divslong_sloc1_1_0 + 1)
;     storeRegToAop (a, EXT(__divulong_PARM_2), 2), stacked=0, isaddr=1
	sta	(__divulong_PARM_2 + 1)
;     loadRegFromAop (a, DIR(__divslong_sloc1_1_0), 3)
	lda	*__divslong_sloc1_1_0
;     storeRegToAop (a, EXT(__divulong_PARM_2), 3), stacked=0, isaddr=1
	sta	__divulong_PARM_2
;     genCall
	jsr	__divulong
;     loadRegFromAop (a, REG(-,-,-,a), 0)
; transferRegReg(a,a)
;     storeRegToAop (a, EXT(__divslong_r_1_1), 0), stacked=0, isaddr=0
	sta	(__divslong_r_1_1 + 3)
;     loadRegFromAop (x, REG(-,-,-,x), 0)
; transferRegReg(x,x)
;     storeRegToAop (x, EXT(__divslong_r_1_1), 1), stacked=0, isaddr=0
	stx	(__divslong_r_1_1 + 2)
;     loadRegFromAop (a, DIR(__ret2), 0)
	lda	*__ret2
;     storeRegToAop (a, EXT(__divslong_r_1_1), 2), stacked=0, isaddr=0
	sta	(__divslong_r_1_1 + 1)
;     loadRegFromAop (a, DIR(__ret3), 0)
	lda	*__ret3
;     storeRegToAop (a, EXT(__divslong_r_1_1), 3), stacked=0, isaddr=0
	sta	__divslong_r_1_1
;_divslong.c:263: if ( (a < 0) ^ (b < 0))
;     genCmpLt
;     genCmp
;     loadRegFromAop (a, EXT(__divslong_PARM_1), 3)
	lda	__divslong_PARM_1
	rola
	clra
	rola
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*__divslong_sloc1_1_0
;     genCmpLt
;     genCmp
;     loadRegFromAop (a, EXT(__divslong_PARM_2), 3)
	lda	__divslong_PARM_2
	rola
	clra
	rola
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
;     genXor
;     loadRegFromAop (a, REG(-,-,x,a), 0)
; transferRegReg(a,a)
	eor	*__divslong_sloc1_1_0
;     storeRegToAop (a, REG(-,-,x,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
;     genIfx
	tsta
;     genIfxJump
; Peephole 2d	- eliminated jmp
	beq	00102$
00115$:
; forgot to free a
;_divslong.c:264: return -r;
;     genUminus
	clra
	sub	(__divslong_r_1_1 + 3)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 0), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 3)
	clra
	sbc	(__divslong_r_1_1 + 2)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 1), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 2)
	clra
	sbc	(__divslong_r_1_1 + 1)
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 2), stacked=0, isaddr=0
	sta	*(__divslong_sloc1_1_0 + 1)
	clra
	sbc	__divslong_r_1_1
;     storeRegToAop (a, DIR(__divslong_sloc1_1_0), 3), stacked=0, isaddr=0
	sta	*__divslong_sloc1_1_0
;     genRet
	mov	*__divslong_sloc1_1_0,*__ret3
	mov	*(__divslong_sloc1_1_0 + 1),*__ret2
;     loadRegFromAop (x, DIR(__divslong_sloc1_1_0), 1)
	ldx	*(__divslong_sloc1_1_0 + 2)
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, DIR(__divslong_sloc1_1_0), 0)
	lda	*(__divslong_sloc1_1_0 + 3)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
; Peephole 3	- shortened jmp to bra
	bra	00104$
00102$:
;_divslong.c:266: return r;
;     genRet
;     loadRegFromAop (a, EXT(__divslong_r_1_1), 3)
	lda	__divslong_r_1_1
;     storeRegToAop (a, DIR(__ret3), 0), stacked=0, isaddr=0
	sta	*__ret3
;     loadRegFromAop (a, EXT(__divslong_r_1_1), 2)
	lda	(__divslong_r_1_1 + 1)
;     storeRegToAop (a, DIR(__ret2), 0), stacked=0, isaddr=0
	sta	*__ret2
;     loadRegFromAop (x, EXT(__divslong_r_1_1), 1)
	ldx	(__divslong_r_1_1 + 2)
;     storeRegToAop (x, REG(-,-,-,x), 0), stacked=0, isaddr=0
; transferRegReg(x,x)
;     loadRegFromAop (a, EXT(__divslong_r_1_1), 0)
	lda	(__divslong_r_1_1 + 3)
;     storeRegToAop (a, REG(-,-,-,a), 0), stacked=0, isaddr=0
; transferRegReg(a,a)
00104$:
	rts
	.area CSEG
	.area XINIT
