eepwbf.s

来自「cxstm8 编译器」· S 代码 · 共 30 行

S
30
字号
;	WRITE A BITFIELD IN EEPROM
;	Copyright (c) 2008 by COSMIC Software
;	- eeprom address in X extension
;	- value in X
;	- mask in A
;
	xdef	c_eewbf, c_eewbb
	xref	c_eewrc
	xref.b	c_x, c_y
	.dcall	"5,0,c_eewbf"
	.dcall	"4,0,c_eewbb"
;
c_eewbf:
	push	a		; save mask
	cpl	a		; invert it
	ldw	c_y,x		; copy value
	and	a,c_y+1		; prepare new value
	ld	c_y,a		; and keep it
	pop	a		; get mask
	and	a,[c_x.w]	; and with bitfield
	or	a,c_y		; insert value
c_eewbb:
	ldw	x,c_x		; restore address
	call	c_eewrc		; program byte and return
	incw	x		; prepare
	ldw	c_x,x		; byte
	ret			; and return
;
	end

⌨️ 快捷键说明

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