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

📄 app.asm

📁 应用松翰母体开发的航模飞机的源代码!有舵机控制功能
💻 ASM
字号:
mnapp:
;	call	complete
;	call	wing
;	call	empennage
;	call	screw
;	call	swing
;	call	output
	
mnapp90:
	ret	
;*********************************************
complete:
	mov	a,empennagebuf1
	cmprs	a,#01fh
	jmp	complete10
	jmp	complete80
complete10:
	cmprs	a,#020h
	jmp	complete20
	jmp	complete80
complete20:
	cmprs	a,#021h
	jmp	complete800
	jmp	complete80
complete800:
	bclr	csxenbflag
	jmp	complete90
complete80:
	bset	csxenbflag
	jmp	complete90	
complete90:
	ret
;**********************************************		
/*wing:
	bts1	t5msflag1
	jmp	wing90
	bclr	t5msflag1
	incms	timerwing
	nop
	mov	a,timerwing
	sub	a,#200
	bts0	fc
	clr	timerwing
	
	b0mov	y,#outtable$m
	b0mov	z,#outtable$l
	mov	a,wingbuf
	add	z,a
	mov	a,#0
	adc	y,a
	movc
	mov	r1,a
	mov	a,timerwing
	sub	a,r1
	bts1	fc
	jmp	wing10
	bclr	winghighflag
	jmp	wing90	
wing10:
	bset	winghighflag	
	jmp	wing90
wing90:
	ret	

;*********************************************
empennage:
	bts1	t5msflag2
	jmp	empennage90
	bclr	t5msflag2
	incms	timerempennage
	nop
	mov	a,timerempennage
	sub	a,#200
	bts0	fc
	clr	timerempennage
	
	b0mov	y,#outtable$m
	b0mov	z,#outtable$l
	mov	a,empennagebuf
	add	z,a
	mov	a,#0
	adc	y,a
	movc
	mov	r1,a
	mov	a,timerempennage
	sub	a,r1
	bts1	fc
	jmp	empennage10
	bclr	empennagehighflag
	jmp	empennage90	
empennage10:
	bset	empennagehighflag	
	jmp	empennage90
empennage90:
	ret	
;*********************************************
screw:
	bts1	t5msflag3
	jmp	screw90
	bclr	t5msflag3
	incms	timerscrew
	nop
	mov	a,timerscrew
	sub	a,#200
	bts0	fc
	clr	timerscrew
	
	b0mov	y,#outtable$m
	b0mov	z,#outtable$l
	mov	a,screwbuf
	add	z,a
	mov	a,#0
	adc	y,a
	movc
	mov	r1,a
	mov	a,timerscrew
	sub	a,r1
	bts1	fc
	jmp	screw10
	bclr	screwhighflag
	jmp	screw90	
screw10:
	bset	screwhighflag	
	jmp	screw90
screw90:
	ret
;*********************************************
swing:
	bts1	t5msflag4
	jmp	swing90
	bclr	t5msflag4
	incms	timerswing
	nop
	mov	a,timerswing
	sub	a,#200
	bts0	fc
	clr	timerswing
	
	b0mov	y,#outtable$m
	b0mov	z,#outtable$l
	mov	a,swingbuf
	add	z,a
	mov	a,#0
	adc	y,a
	movc
	mov	r1,a
	mov	a,timerswing
	sub	a,r1
	bts1	fc
	jmp	swing10
	bclr	swinghighflag
	jmp	swing90	
swing10:
	bset	swinghighflag	
	jmp	swing90
swing90:
	ret	
	
;***************************************************
output:				;给步进电机发送信号
	bts1	winghighflag
	jmp	output80
	bts1	ptwing
	jmp	outputwing
	bts1	t1800usflag
	jmp	outputwing
	bclr	t1800usflag
	bclr	ptwing
	jmp	output90
outputwing:
	bts1	t18msflag
	jmp	output90
	bclr	t18msflag
	bset	ptwing
	jmp	output90
outputempennage:
	bts1	empennagehighflag
	jmp	outputempennage10
	bset	ptempennage
	jmp	outputscrew
outputempennage10:
	bclr	ptempennage
	jmp	outputscrew
outputscrew:
	bts1	screwhighflag
	jmp	outputscrew10
	bset	ptscrew
	jmp	outputswing
outputscrew10:
	bclr	ptscrew
	jmp	outputswing
outputswing:
	bts1	swinghighflag
	jmp	outputswing10
	bset	ptswing
	jmp	output90
outputswing10:
	bclr	ptswing
	jmp	output90
output80:
	bclr	ptwing
	bclr	ptempennage
	bclr	ptscrew
	bclr	ptswing
output90:
	ret

;***************************************************
outtable:
	dw	058h;4h
	dw	05fh
	dw	06ah
	dw	075h
	dw	080h
	dw	08bh
	dw	096h
	dw	0a1h
	dw	0ach
	dw	0b8h
*/	
            
;***************************************************

⌨️ 快捷键说明

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