Ensure fdset macro works with D3
This commit is contained in:
parent
1645cf9ad4
commit
bd74050e06
|
@ -30,18 +30,19 @@ LeaFdset MACRO
|
||||||
; LeaFdsetForBit fd_set reg,target address,target bit in address
|
; LeaFdsetForBit fd_set reg,target address,target bit in address
|
||||||
LeaFdsetForBit MACRO
|
LeaFdsetForBit MACRO
|
||||||
LeaFdset \1,\2 ; get fdset base address in \2
|
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
|
MOVE.L \3,D3 ; Put target bit into D3
|
||||||
ROR.L #5,D3 ; lop off the first 5 bits
|
ROR.L #5,D3 ; lop off the first 5 bits
|
||||||
AND.L #$7,D3 ; only keep the top three
|
AND.L #$7,D3 ; only keep the top three
|
||||||
ROL.L #2,D3 ; multiply by 4
|
ROL.L #2,D3 ; multiply by 4
|
||||||
ADD.L D3,\2 ; add that value to the fdset address
|
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
|
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 D3,\3 ; put that in the target
|
||||||
MOVE.L (SP)+,D3
|
MOVE.L (SP)+,D3-D4
|
||||||
|
|
||||||
ENDM
|
ENDM
|
||||||
|
|
Loading…
Reference in New Issue