SDFM_CONROL_TEAST_EFC/EFC_PlatformC28x/F2838xD_TestAndSetBit.asm
2024-10-11 09:35:38 +03:00

36 lines
678 B
NASM

;//###########################################################################
;//
;// FILE: F2838xD_TestAndSet.asm
;//
;// Titov L.A.
;//
;//
;//###########################################################################
;D
.text
.global _test_and_set_bit
.global _test_and_set_bit_1
;Input: volatile uint16_t * - AR4 (on low 16 bit address space)
;Output: uint16_t - AL (return value)
_test_and_set_bit:
TSET *AR4,#0 ;Test and set specified bit, read-modify-write operation.
MOVB AL,#0
MOVB AL,#1,TC
LRETR
_test_and_set_bit_1:
TSET *AR4,#1 ;Test and set specified bit, read-modify-write operation.
MOVB AL,#0
MOVB AL,#1,TC
LRETR
;//
;// End of file.
;//