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

📄 com.s

📁 ARM入门的好帮手.包含了从简单到相对较复杂的程序.
💻 S
字号:
	.file	"c:/at91/software/projects/bench/source/com.c"
	.option	svr4
	.option	thumb_code
	.option	inter
	.ident	"hc4.5a -O7 \n"
	.option	noswst
	.seg	".text",text
	.option	code16,inter
.L00TEXT:
;-------------| at91_open_com |-------------------
	.global	at91_open_com
at91_open_com:
	.cfa_bf	at91_open_com
	push	{%r7,%lr}
	.cfa_push	{%r7,%lr}
	mov	%r7,%r0
	ldr	%r0,[%r7, #0]
	mov	%r3,#0
	bl	at91_usart_open
	mov	%r2,#1
	neg	%r2,%r2
	ldr	%r3,[%r7, #0]
	ldr	%r3,[%r3, #0]
	str	%r2,[%r3, #12]
	mov	%r3,#1
	str	%r3,[%r7, #4]
	.cfa_remember_state
	pop	{%r7}
	.cfa_pop	{%r7}
	pop	{%r3}
	.cfa_pop	{%r3}
	bx	%r3
	.cfa_restore_state
	.cfa_ef
	.type at91_open_com, @function
	.size at91_open_com, . - at91_open_com
;-------------| at91_close_com |-------------------
	.global	at91_close_com
at91_close_com:
	.cfa_bf	at91_close_com
	push	{%r7,%lr}
	.cfa_push	{%r7,%lr}
	mov	%r7,%r0
	ldr	%r0,[%r7, #0]
	bl	at91_usart_close
	mov	%r3,#1
	str	%r3,[%r7, #4]
	.cfa_remember_state
	pop	{%r7}
	.cfa_pop	{%r7}
	pop	{%r3}
	.cfa_pop	{%r3}
	bx	%r3
	.cfa_restore_state
	.cfa_ef
	.type at91_close_com, @function
	.size at91_close_com, . - at91_close_com
;-------------| at91_print |-------------------
	.global	at91_print
at91_print:
	.cfa_bf	at91_print
	push	{%r4-%r7,%lr}
	.cfa_push	{%r4-%r7,%lr}
	sub	%sp,#4
	.cfa_push	4
	mov	%r5,%r0
	mov	%r6,%r1
	mov	%r4,#0
	ldrb	%r3,[%r6, %r4]
	cmp	%r3,#0
	beq	.L01157
	mov	%r7,#2
.L01154:
	ldr	%r0,[%r5, #0]
	bl	at91_usart_get_status
	tst	%r0,%r7
	bne	.L01156
.L01155:
	ldr	%r0,[%r5, #0]
	bl	at91_usart_get_status
	tst	%r0,%r7
	beq	.L01155
.L01156:
	ldr	%r0,[%r5, #0]
	ldrb	%r1,[%r6, %r4]
	bl	at91_usart_write
	add	%r4,#1
	ldrb	%r3,[%r6, %r4]
	cmp	%r3,#0
	bne	.L01154
.L01157:
	.cfa_remember_state
	add	%sp,#4
	.cfa_pop	4
	pop	{%r4-%r7}
	.cfa_pop	{%r4-%r7}
	pop	{%r3}
	.cfa_pop	{%r3}
	bx	%r3
	.cfa_restore_state
	.cfa_ef
	.type at91_print, @function
	.size at91_print, . - at91_print
;-------------| at91_print_frame |-------------------
	.global	at91_print_frame
at91_print_frame:
	.cfa_bf	at91_print_frame
	push	{%r4-%r7,%lr}
	.cfa_push	{%r4-%r7,%lr}
	sub	%sp,#4
	.cfa_push	4
	mov	%r7,%r0
	mov	%r4,%r1
	mov	%r5,%r2
	ldr	%r0,[%r7, #0]
	ldr	%r2,[%r0, #0]
	ldr	%r3,[%r2, #60]
	cmp	%r3,#0
	beq	.L01165
.L01164:
	ldr	%r3,[%r2, #60]
	cmp	%r3,#0
	bne	.L01164
.L01165:
	bl	at91_usart_get_status
	mov	%r6,#2
	tst	%r0,%r6
	bne	.L01167
.L01166:
	ldr	%r0,[%r7, #0]
	bl	at91_usart_get_status
	tst	%r0,%r6
	beq	.L01166
.L01167:
	ldr	%r3,[%r7, #0]
	ldr	%r3,[%r3, #0]
	str	%r4,[%r3, #56]
	str	%r5,[%r3, #60]
	.cfa_remember_state
	add	%sp,#4
	.cfa_pop	4
	pop	{%r4-%r7}
	.cfa_pop	{%r4-%r7}
	pop	{%r3}
	.cfa_pop	{%r3}
	bx	%r3
	.cfa_restore_state
	.cfa_ef
	.type at91_print_frame, @function
	.size at91_print_frame, . - at91_print_frame
;-------------| at91_print_crlf |-------------------
	.global	at91_print_crlf
at91_print_crlf:
	.cfa_bf	at91_print_crlf
	push	{%r7,%lr}
	.cfa_push	{%r7,%lr}
	sub	%sp,#8
	.cfa_push	8
	mov	%r3,#10
	add	%r1,%sp,#4
	strb	%r3,[%r1, #0]
	mov	%r3,#13
	strb	%r3,[%r1, #1]
	mov	%r3,#0
	strb	%r3,[%r1, #2]
	bl	at91_print
	.cfa_remember_state
	add	%sp,#8
	.cfa_pop	8
	pop	{%r7}
	.cfa_pop	{%r7}
	pop	{%r3}
	.cfa_pop	{%r3}
	bx	%r3
	.cfa_restore_state
	.cfa_ef
	.type at91_print_crlf, @function
	.size at91_print_crlf, . - at91_print_crlf
;-------------| at91_getch |-------------------
	.global	at91_getch
at91_getch:
	.cfa_bf	at91_getch
	push	{%r4,%r5,%r7,%lr}
	.cfa_push	{%r4,%r5,%r7,%lr}
	mov	%r5,%r0
	mov	%r7,%r1
	ldr	%r0,[%r5, #0]
	bl	at91_usart_get_status
	mov	%r3,#1
	and	%r0,%r3
	neg	%r4,%r0
	and	%r4,%r0
	sub	%r4,#1
	lsr	%r4,#31
	bne	.L01185
	ldr	%r0,[%r5, #0]
	mov	%r1,%r7
	bl	at91_usart_read
.L01185:
	mov	%r0,%r4
	.cfa_remember_state
	pop	{%r4,%r5,%r7}
	.cfa_pop	{%r4,%r5,%r7}
	pop	{%r3}
	.cfa_pop	{%r3}
	bx	%r3
	.cfa_restore_state
	.cfa_ef
	.type at91_getch, @function
	.size at91_getch, . - at91_getch
;-------------| at91_send_byte |-------------------
	.global	at91_send_byte
at91_send_byte:
	.cfa_bf	at91_send_byte
	push	{%r4,%r5,%r7,%lr}
	.cfa_push	{%r4,%r5,%r7,%lr}
	mov	%r5,%r0
	mov	%r7,%r1
	ldr	%r0,[%r5, #0]
	ldr	%r2,[%r0, #0]
	ldr	%r3,[%r2, #60]
	cmp	%r3,#0
	beq	.L01215
.L01214:
	ldr	%r3,[%r2, #60]
	cmp	%r3,#0
	bne	.L01214
.L01215:
	bl	at91_usart_get_status
	mov	%r4,#2
	tst	%r0,%r4
	bne	.L01217
.L01216:
	ldr	%r0,[%r5, #0]
	bl	at91_usart_get_status
	tst	%r0,%r4
	beq	.L01216
.L01217:
	ldr	%r0,[%r5, #0]
	mov	%r1,%r7
	bl	at91_usart_write
	.cfa_remember_state
	pop	{%r4,%r5,%r7}
	.cfa_pop	{%r4,%r5,%r7}
	pop	{%r3}
	.cfa_pop	{%r3}
	bx	%r3
	.cfa_restore_state
	.cfa_ef
	.type at91_send_byte, @function
	.size at91_send_byte, . - at91_send_byte
	.end

⌨️ 快捷键说明

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