delay.asm

来自「5509a FLASH 的读写操作程序,测试过没任何问题」· 汇编 代码 · 共 46 行

ASM
46
字号
;this funciton use the ar5 as input parametre fo the delay
;the delay unit is ms. for example, when ar5 is 1000, it means
;delay 1000ms	
;input=ar5
	.text
	.def delay_,delay_us
	;;push(ac2)
delay_:
	;brc0=ar5
	;.align 4
test_circle2_delay_sub:	
	
	;inner circle
	ac2=#3fffh
test_circle_delay_sub:
	ac2-=#1
	nop
	if (ac2!=#0) goto test_circle_delay_sub
	
	;outer circle
	ar5-=#1 ;decrement the ar5
	if(ar5!=#0) goto test_circle2_delay_sub
	
	;ac2=pop()
	return
delay_us:

	pshboth(ac2)
	push(ar5)
test_circle2_delay_us_sub:	
	
	;inner circle
	ac2=#0fh
test_circle_delay_us_sub:
	ac2-=#1
	nop
	if (ac2!=#0) goto test_circle_delay_us_sub
	
	;outer circle
	ar5-=#1 ;decrement the ar5
	if(ar5!=#0) goto test_circle2_delay_us_sub
	ar5=pop()
	ac2=popboth()
	return
	.end
	

⌨️ 快捷键说明

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