Menu

#69 Correct QLIB GetNextInQueue offset

3.0b8
pending-fixed
None
5
2014-08-24
2014-08-24
No

Report from Geoff Body:

I think the following change for GETNEXTINQUEUE in I.QLIB.S will halve the
processing time when there are more than two handles in the queue.

LDY #8
LDA [QHANDLE],Y
PHA
LDY #6 - start at MSB of 2 Handle
]L1 LDA [QPTR],Y
TAX
DEY
DEY
LDA [QPTR],Y
PHA
DEY
DEY
TXA
STA [QPTR],Y
DEY
DEY
PLA
STA [QPTR],Y
TYA
CLC

Modify the following line from ADC #8 to ADC #10 (not a hex number).
Following this code by hand indicates that the queue gets duplicated half handle moves, starts at offset 6 -> 2, 4->0, which moves handle 2 to handle 1, adds 8 for new offset and would go 8->4, 6->2 at which point LSB of handle 3 and MSB of handle 2 gets moved.
At end of loop Y points to LSB of current moved Handle and needs to point to MSB of the Next Handle to be moved, which is + 4 to the LSB of the old moved Handle, +4 to the LSB of the next Handle to be moved, +2 to the MSB of next Handle to be moved.

ADC #10
TAY
CMP 1,S
BCC ]L1

Discussion

  • Andrew Roughan

    Andrew Roughan - 2014-08-24

    (Internal note: Code changes have been made to Sweet16:NewDev2:Testbuild
    Built in 3.0b8)

     
  • Andrew Roughan

    Andrew Roughan - 2014-08-24
    • status: open --> pending-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB