From bd74050e06cd65406955e1200d88af0d2db1d0ac Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 17 Apr 2024 19:40:38 -0400 Subject: [PATCH] Ensure fdset macro works with D3 --- src/fd_set.s | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fd_set.s b/src/fd_set.s index 29f765b..3d3d08d 100644 --- a/src/fd_set.s +++ b/src/fd_set.s @@ -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