timer.a96

来自「intel 196nt 例程」· A96 代码 · 共 66 行

A96
66
字号
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 + =
减小字号Ctrl + -
显示快捷键?