24 lines
777 B
Plaintext
24 lines
777 B
Plaintext
.ifndef INCLUDE_UTILITY
|
|
INCLUDE_UTILITY = 1
|
|
|
|
.macpack longbranch ; jeq, jge...
|
|
|
|
;********************************************************************************
|
|
; @macro Update a byte in memory using a mask
|
|
; @param orignal Address of the byte to update
|
|
; @param new New value
|
|
; @param mask Mask of the bits to affect by the new value
|
|
; @details
|
|
; xor new with original -> only bits that need to flip are 1
|
|
; and result with mask -> only selected bits that need to flip stay 1
|
|
; xor result with original -> flips selected bits
|
|
;********************************************************************************
|
|
.macro UT_update_with_mask original,new,mask
|
|
lda #new
|
|
eor original
|
|
and #mask
|
|
eor original
|
|
sta original
|
|
.endmacro
|
|
.endif
|