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

📄 timer.a96

📁 intel 196nt 例程
💻 A96
字号:
TIMER	MODULE
$include(_SFR_INC_)

	rseg
	extrn	PLMREG
	;; Define a few registers for our own purpose
	;; Note that these are not the same as the TMPREG0
	;; used for C programs.
Tmp0:	dsw	1
Tmp0L	equ	Tmp0:BYTE
Tmp2:	dsw	1


	cseg far
	;;
	;; unsigned char get_t1control(void);
	;; 
	public	get_t1control
get_t1control:
	ldb	PLMREG,t1control
	ret

	;;
	;; unsigned char set_t1control(unsigned char ctl);
	;; 
	public	set_t1control
set_t1control:
	ldb	Tmp0L,4[sp]			       ; 4 => offset of first parameter
	stb	Tmp0L,t1control
	ret

	;;
	;; unsigned int get_timer1(void);
	;; 
	public	get_timer1
get_timer1:
	ld	PLMREG,timer1
	ret

	;;
	;; unsigned char get_t2control(void);
	;; 
	public	get_t2control
get_t2control:
	ldb	PLMREG,t2control
	ret

	;;
	;; unsigned char set_t2control(unsigned char ctl);
	;; 
	public	set_t2control
set_t2control:
	ldb	Tmp0L,4[sp]			       ; 4 => offset of first parameter
	stb	Tmp0L,t2control
	ret

	;;
	;; unsigned int get_timer2(void);
	;; 
	public	get_timer2
get_timer2:
	ld	PLMREG,timer2
	ret

	END

⌨️ 快捷键说明

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