; DEC 6 BBBBBBBBBBBBBBBBBBBBBBBB ; new code for link grabbing. To be checked thoroughly ; before use. (Pissed & emotional...?) ; Shurely shome mistake? - Ed. ; ; ********** IS MAX.LINES CHECKED ??????????? linkgr Lda ctrlbl Sta intzp0 Lda ctrlbl+1 Sta intzp1 LdyIM 1 LdaIY intzp0 Sec SbcIM (26+1) Pha ;\\\\\\\\\\\\\\\\\ No. of rows remaining, now on stack Clc Lda intzp0 AdcIM :LSB: (pagehe+(40+pageju)*26) STA intzp0 LDA intzp1 ADCIM :MSB: (pagehe+(40+pageju)*26) Sta intzp1 ; sear02 Pla ; Nothing on stack at this point EorIM 0 Bmi sear01 ; Ought to be in branch range. SEC SBCIM 1 ; DECREMENT LOOP COUNT Pha ; Re-balance stack LdyIM 0 LdaIY intzp0 CmpIM 27 Bne sear00 ; No. of lines on stack LdyIM pageju LdaIY intzp0 ;| KNOWING NO BETTER< THE FOOLISH BEARS>>> Tay LdaAY hamtab Bmi sear00 AndIM &0F CmpIM 4 Bcs sear00 ; Now have row pointed to by intzp0, ; designation code (0..3) in A Jsr COPYLI ; Subroutine to allow branches in this section sear00 Lda intzp0 Clc AdcIM (pageju+40) Sta intzp0 Lda intzp1 AdcIM 0 Sta intzp1 Jmp sear02 ; times6 = 10 = 70 = 130 = 190 ; sear01 RTS ; CALLED AS A SUBROUTINE FROM INTERRUPT CODE ; ;########################## ;## ## ;## fixAY the use of X ## ;## in the following ## ;## code. ## ;## ## ;########################## COPYLI Tay LdaAY times6 Tay ; Y points to slot in ctrlbl LdxIM pageju+1 ; +1, to skip designation code zopyli LdaAY ctrlbl+specia RolA Bmi copyst LdaAY ctrlbl+inuse RolA Bpl copyst LdaAY ctrlbl+hold RolA Bmi copyst Txa Pha Tya Pha ; ; DO THE COPY HERE JMP Copyac copyre ; Pla Tay Pla Tax copyst Tya Clc AdcIM 10 Tay Txa Clc AdcIM 6 Tax CpxIM ((6*6)+pageju+1) ; Slot after last one in group of 6 Bne zopyli Rts ; ; Subroutine to copy like data into ctrlbl. ; Copyac ; ; Recover pointers from stack, but replace on stack. ; ; Pointers go into X and Y here in opposite form ; fromAI above code, to allow (intzp0)NDEX - as X is not ; allowed as an indirect index. Savvy? ; Pla Tax Pla Tay Pha Txa Pha ; Unpleasant code following, but fairly straightforward... ; LdaIM 0 Sta ints00 ; INTSCR1 is 'CBs same' flag... ; INTSCR0 USED BY HAMMING - SO DO NOT CALL HAMMING WHEN ACTIVE LdaIY intzp0 Jsr spec00 ; Returns value 0..15 - ignores errors ; preserves X :AND: Y STA intscr LDAAX ctrlbl+4 ANDIM &F CMP intscr BEQ wally1 INC ints00 ; FLAG SET IF CBS DIFFERENT !!!!!!!!!!!!!!!! wally1 LDAAX ctrlbl+4 ANDIM 240 ORA intscr StaAX ctrlbl+4 ; Page 1s INY LdaIY intzp0 Jsr spec00 STA intscr LDAAX ctrlbl+3 ANDIM &F CMP intscr BEQ wally2 INC ints00 wally2 LDAAX ctrlbl+3 ANDIM 240 ORA intscr StaAX ctrlbl+3 ; Page 10s INY LdaIY intzp0 Jsr spec00 STA intscr LDAAX ctrlbl+8 ANDIM &F CMP intscr BEQ wally3 INC ints00 wally3 LDAAX ctrlbl+8 ANDIM 240 ORA intscr StaAX ctrlbl+8 ; Sub 1s INY LdaIY intzp0 ; Extract C4 Jsr spec00 PHA ANDIM 7 STA intscr LDAAX ctrlbl+7 ANDIM &7 CMP intscr BEQ wally4 INC ints00 wally4 LDAAX ctrlbl+7 ANDIM 248 ORA intscr StaAX ctrlbl+7 ; Sub 10s PLA LSRA LSRA LSRA PHA ; STA ints00 CAREFUL!!!!!!!!!! INY LdaIY intzp0 Jsr spec00 STA intscr LDAAX ctrlbl+6 ANDIM &F CMP intscr BEQ wally5 INC ints00 wally5 LDAAX ctrlbl+6 ANDIM 240 ORA intscr StaAX ctrlbl+6 ; Sub 100s INY LdaIY intzp0 ; Extract C6, C5 Jsr spec00 PHA ANDIM 3 STA intscr LDAAX ctrlbl+5 ANDIM &3 CMP intscr BEQ wally6 INC ints00 wally6 LDAAX ctrlbl+5 ANDIM 252 ORA intscr StaAX ctrlbl+5 ; Sub 1000s PLA LSRA ANDIM 6 ; STA intscr PLA ORA intscr EOR ctrlbl+2 ANDIM 7 STA intscr LDAAX ctrlbl+2 ANDIM &7 CMP intscr BEQ wally7 INC ints00 wally7 LDAAX ctrlbl+2 ANDIM 248 ORA intscr STAAX ctrlbl+2 ; Ex-or C6,C5,C4 withAX Mag no, Store at ctrlbl+2 Lda ints00 Beq wallym ; CONTROL BLOCKS DIDN'T MATCH - FLAGS ARE INVALID !!!!!!!!! LDAAX ctrlbl+4 ANDIM &F STAAX ctrlbl+4 LDAAX ctrlbl+3 ANDIM &F STAAX ctrlbl+3 LDAAX ctrlbl+8 ANDIM &F STAAX ctrlbl+8 LDAAX ctrlbl+7 ANDIM &7 STAAX ctrlbl+7 LDAAX ctrlbl+6 ANDIM &F STAAX ctrlbl+6 LDAAX ctrlbl+5 ANDIM &3 STAAX ctrlbl+5 LDAAX ctrlbl+2 ANDIM &7 STAAX ctrlbl+2 ; wallym Jmp copyre ; spec00 Sty intscr Tay LdaAY hamtab Ldy intscr AndIM &0F Rts ; LNK DEC7