Ensure fdset macro works with D3

This commit is contained in:
John Bintz 2024-04-17 19:40:38 -04:00
parent 1645cf9ad4
commit bd74050e06

View File

@ -30,18 +30,19 @@ LeaFdset MACRO
; LeaFdsetForBit fd_set reg,target address,target bit in address
LeaFdsetForBit MACRO
LeaFdset \1,\2 ; get fdset base address in \2
MOVE.L D3,-(SP)
MOVE.L D3-D4,-(SP)
MOVE.L \3,D3 ; Put target bit into D3
ROR.L #5,D3 ; lop off the first 5 bits
AND.L #$7,D3 ; only keep the top three
ROL.L #2,D3 ; multiply by 4
ADD.L D3,\2 ; add that value to the fdset address
AND.L #$1F,\3 ; only keep 0-31 in \3
MOVE.L \3,D4
AND.L #$1F,D4 ; only keep 0-31 in \3
MOVEQ #1,D3
ROL.L \3,D3 ; shift that bit left as many as target
ROL.L D4,D3 ; shift that bit left as many as target
MOVE.L D3,\3 ; put that in the target
MOVE.L (SP)+,D3
MOVE.L (SP)+,D3-D4
ENDM