⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libgcc.s

📁 linux下的gcc编译器
💻 S
📖 第 1 页 / 共 2 页
字号:
        brcs	__udivmodhi4_ep	; remainder < divisor        sub	r_remL,r_arg2L	; restore remainder        sbc	r_remH,r_arg2H__udivmodhi4_ep:        rol	r_arg1L		; shift dividend (with CARRY)        rol	r_arg1H        dec	r_cnt		; decrement loop counter        brne	__udivmodhi4_loop	com	r_arg1L	com	r_arg1H; div/mod results to return registers, as for the div() function	mov_l	r_arg2L, r_arg1L	; quotient	mov_h	r_arg2H, r_arg1H	mov_l	r_arg1L, r_remL		; remainder	mov_h	r_arg1H, r_remH	ret	.endfunc#endif /* defined (L_udivmodhi4) */#if defined (L_divmodhi4)	.global	__divmodhi4	.func	__divmodhi4__divmodhi4:	.global	_div_div:        bst     r_arg1H,7	; store sign of dividend        mov     __tmp_reg__,r_arg1H        eor     __tmp_reg__,r_arg2H   ; r0.7 is sign of result	rcall	__divmodhi4_neg1 ; dividend negative : negate	sbrc	r_arg2H,7	rcall	__divmodhi4_neg2 ; divisor negative : negate	rcall	__udivmodhi4	; do the unsigned div/mod	rcall	__divmodhi4_neg1 ; correct remainder sign	tst	__tmp_reg__	brpl	__divmodhi4_exit__divmodhi4_neg2:	com	r_arg2H	neg	r_arg2L		; correct divisor/result sign	sbci	r_arg2H,0xff__divmodhi4_exit:	ret__divmodhi4_neg1:	brtc	__divmodhi4_exit	com	r_arg1H	neg	r_arg1L		; correct dividend/remainder sign	sbci	r_arg1H,0xff	ret	.endfunc#endif /* defined (L_divmodhi4) */#undef r_remH  #undef r_remL               #undef r_arg1H #undef r_arg1L              #undef r_arg2H #undef r_arg2L              	#undef r_cnt   		/*******************************************************       Division 32 / 32 => (result + remainder)*******************************************************/#define	r_remHH	r31	/* remainder High */#define	r_remHL	r30#define	r_remH	r27#define	r_remL	r26	/* remainder Low *//* return: remainder */#define	r_arg1HH r25	/* dividend High */#define	r_arg1HL r24#define	r_arg1H  r23#define	r_arg1L  r22	/* dividend Low *//* return: quotient */#define	r_arg2HH r21	/* divisor High */#define	r_arg2HL r20#define	r_arg2H  r19#define	r_arg2L  r18	/* divisor Low */	#define	r_cnt __zero_reg__  /* loop count (0 after the loop!) */#if defined (L_udivmodsi4)	.global	__udivmodsi4	.func	__udivmodsi4__udivmodsi4:	ldi	r_remL, 33	; init loop counter	mov	r_cnt, r_remL	sub	r_remL,r_remL	sub	r_remH,r_remH	; clear remainder and carry	mov_l	r_remHL, r_remL	mov_h	r_remHH, r_remH	rjmp	__udivmodsi4_ep	; jump to entry point__udivmodsi4_loop:        rol	r_remL		; shift dividend into remainder	rol	r_remH	rol	r_remHL	rol	r_remHH        cp	r_remL,r_arg2L	; compare remainder & divisor	cpc	r_remH,r_arg2H	cpc	r_remHL,r_arg2HL	cpc	r_remHH,r_arg2HH	brcs	__udivmodsi4_ep	; remainder <= divisor        sub	r_remL,r_arg2L	; restore remainder        sbc	r_remH,r_arg2H        sbc	r_remHL,r_arg2HL        sbc	r_remHH,r_arg2HH__udivmodsi4_ep:        rol	r_arg1L		; shift dividend (with CARRY)        rol	r_arg1H        rol	r_arg1HL        rol	r_arg1HH        dec	r_cnt		; decrement loop counter        brne	__udivmodsi4_loop				; __zero_reg__ now restored (r_cnt == 0)	com	r_arg1L	com	r_arg1H	com	r_arg1HL	com	r_arg1HH; div/mod results to return registers, as for the ldiv() function	mov_l	r_arg2L,  r_arg1L	; quotient	mov_h	r_arg2H,  r_arg1H	mov_l	r_arg2HL, r_arg1HL	mov_h	r_arg2HH, r_arg1HH	mov_l	r_arg1L,  r_remL	; remainder	mov_h	r_arg1H,  r_remH	mov_l	r_arg1HL, r_remHL	mov_h	r_arg1HH, r_remHH	ret	.endfunc#endif /* defined (L_udivmodsi4) */#if defined (L_divmodsi4)	.global	__divmodsi4	.func	__divmodsi4__divmodsi4:        bst     r_arg1HH,7	; store sign of dividend        mov     __tmp_reg__,r_arg1HH        eor     __tmp_reg__,r_arg2HH   ; r0.7 is sign of result	rcall	__divmodsi4_neg1 ; dividend negative : negate	sbrc	r_arg2HH,7	rcall	__divmodsi4_neg2 ; divisor negative : negate	rcall	__udivmodsi4	; do the unsigned div/mod	rcall	__divmodsi4_neg1 ; correct remainder sign	rol	__tmp_reg__	brcc	__divmodsi4_exit__divmodsi4_neg2:	com	r_arg2HH	com	r_arg2HL	com	r_arg2H	neg	r_arg2L		; correct divisor/quotient sign	sbci	r_arg2H,0xff	sbci	r_arg2HL,0xff	sbci	r_arg2HH,0xff__divmodsi4_exit:	ret__divmodsi4_neg1:	brtc	__divmodsi4_exit	com	r_arg1HH	com	r_arg1HL	com	r_arg1H	neg	r_arg1L		; correct dividend/remainder sign	sbci	r_arg1H, 0xff	sbci	r_arg1HL,0xff	sbci	r_arg1HH,0xff	ret	.endfunc#endif /* defined (L_divmodsi4) *//********************************** * This is a prologue subroutine **********************************/#if defined (L_prologue)	.global	__prologue_saves__	.func	__prologue_saves____prologue_saves__:	push r2	push r3	push r4	push r5	push r6	push r7	push r8	push r9	push r10	push r11	push r12	push r13	push r14	push r15	push r16	push r17	push r28	push r29	in	r28,__SP_L__	in	r29,__SP_H__	sub	r28,r26	sbc	r29,r27	in	__tmp_reg__,__SREG__	cli	out	__SP_H__,r29	out	__SREG__,__tmp_reg__	out	__SP_L__,r28	ijmp.endfunc#endif /* defined (L_prologue) *//* * This is an epilogue subroutine */#if defined (L_epilogue)	.global	__epilogue_restores__	.func	__epilogue_restores____epilogue_restores__:	ldd	r2,Y+18	ldd	r3,Y+17	ldd	r4,Y+16	ldd	r5,Y+15	ldd	r6,Y+14	ldd	r7,Y+13	ldd	r8,Y+12	ldd	r9,Y+11	ldd	r10,Y+10	ldd	r11,Y+9	ldd	r12,Y+8	ldd	r13,Y+7	ldd	r14,Y+6	ldd	r15,Y+5	ldd	r16,Y+4	ldd	r17,Y+3	ldd	r26,Y+2	ldd	r27,Y+1	add	r28,r30	adc	r29,__zero_reg__	in	__tmp_reg__,__SREG__	cli	out	__SP_H__,r29	out	__SREG__,__tmp_reg__	out	__SP_L__,r28	mov_l	r28, r26	mov_h	r29, r27	ret.endfunc#endif /* defined (L_epilogue) */#ifdef L_exit	.section .fini9,"ax",@progbits	.global _exit	.func	_exit_exit:	.weak	exitexit:	/* Code from .fini8 ... .fini1 sections inserted by ld script.  */	.section .fini0,"ax",@progbits__stop_program:	rjmp	__stop_program	.endfunc#endif /* defined (L_exit) */#ifdef L_cleanup	.weak	_cleanup	.func	_cleanup_cleanup:	ret.endfunc#endif /* defined (L_cleanup) */#ifdef L_tablejump	.global __tablejump2__	.func	__tablejump2____tablejump2__:	lsl	r30	rol	r31	.global __tablejump____tablejump__:#if defined (__AVR_ENHANCED__)	lpm	__tmp_reg__, Z+	lpm	r31, Z	mov	r30, __tmp_reg__	ijmp#else	lpm	adiw	r30, 1	push	r0	lpm	push	r0	ret#endif	.endfunc#endif /* defined (L_tablejump) *//* __do_copy_data is only necessary if there is anything in .data section.   Does not use RAMPZ - crt*.o provides a replacement for >64K devices.  */#ifdef L_copy_data	.section .init4,"ax",@progbits	.global __do_copy_data__do_copy_data:	ldi	r17, hi8(__data_end)	ldi	r26, lo8(__data_start)	ldi	r27, hi8(__data_start)	ldi	r30, lo8(__data_load_start)	ldi	r31, hi8(__data_load_start)	rjmp	.do_copy_data_start.do_copy_data_loop:#if defined (__AVR_ENHANCED__)	lpm	r0, Z+#else	lpm	adiw	r30, 1#endif	st	X+, r0.do_copy_data_start:	cpi	r26, lo8(__data_end)	cpc	r27, r17	brne	.do_copy_data_loop#endif /* L_copy_data *//* __do_clear_bss is only necessary if there is anything in .bss section.  */#ifdef L_clear_bss	.section .init4,"ax",@progbits	.global __do_clear_bss__do_clear_bss:	ldi	r17, hi8(__bss_end)	ldi	r26, lo8(__bss_start)	ldi	r27, hi8(__bss_start)	rjmp	.do_clear_bss_start.do_clear_bss_loop:	st	X+, __zero_reg__.do_clear_bss_start:	cpi	r26, lo8(__bss_end)	cpc	r27, r17	brne	.do_clear_bss_loop#endif /* L_clear_bss *//* __do_global_ctors and __do_global_dtors are only necessary   if there are any constructors/destructors.  */#if defined (__AVR_MEGA__)#define XCALL call#else#define XCALL rcall#endif#ifdef L_ctors	.section .init6,"ax",@progbits	.global	__do_global_ctors__do_global_ctors:	ldi	r17, hi8(__ctors_start)	ldi	r28, lo8(__ctors_end)	ldi	r29, hi8(__ctors_end)	rjmp	.do_global_ctors_start.do_global_ctors_loop:	sbiw	r28, 2	mov_h	r31, r29	mov_l	r30, r28	XCALL	__tablejump__.do_global_ctors_start:	cpi	r28, lo8(__ctors_start)	cpc	r29, r17	brne	.do_global_ctors_loop#endif /* L_ctors */#ifdef L_dtors	.section .fini6,"ax",@progbits	.global	__do_global_dtors__do_global_dtors:	ldi	r17, hi8(__dtors_end)	ldi	r28, lo8(__dtors_start)	ldi	r29, hi8(__dtors_start)	rjmp	.do_global_dtors_start.do_global_dtors_loop:	mov_h	r31, r29	mov_l	r30, r28	XCALL	__tablejump__	adiw	r28, 2.do_global_dtors_start:	cpi	r28, lo8(__dtors_end)	cpc	r29, r17	brne	.do_global_dtors_loop#endif /* L_dtors */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -