danwinslow Posted June 14, 2016 Share Posted June 14, 2016 Messing around with burst mode CIO on a iccom 7 GET. The last issue I'm having is that CIO wants to drop the value in A, which it thinks is the byte it just read, into the buffer at the first location. For reasons involving banking, I can't easily get that byte in the current code location, so I'm looking for a way to convince CIO that it doesn't need to do that. Is there a special value of A or Y that tells it to not do that? Other than flagging an error with a BMI Y I mean. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted June 15, 2016 Share Posted June 15, 2016 You just let it drop the byte at the buffer address, but manipulate the buffer address (in the ZP CIOB) so it points to the last byte of your burst buffer. At least this is how I did it in the U1MB XEX loader's FMS. OK adw ZIOCB[0].Address ZIOCB[0].Len mwa #1 ZIOCB[0].Len ; this must be 1 so CIO only calls us once dew ZIOCB[0].Address ; make sure buffer address points at the last byte read ldy #0 lda (ZIOCB[0].Address),y ; CIO will store this final byte at the buffer address ldy #1 ; say OK rts Sorry about the structs and whatnot. I've just read a buffer full of data at ZIOCB[0].Address. So I add the buffer length-1 to the address and then set the buffer length to 1. I then grab the last byte in the buffer and leave it in A, which the CIO then stores back in the exact same place. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted June 15, 2016 Author Share Posted June 15, 2016 (edited) duh....yeah. Thanks Jon. *edit* Er wait, no, actually the problem is I don't actually HAVE the last byte, it just thinks it does. The last byte was transferred with a bank copy routine, and I don't have access to it at the moment. Oh well, still a good idea. Ok, second edit - I can have the ring buffer read pass back the last byte in A or something, but that's kind of a kludge....maybe I can just mess with the ICBALZ and point it at a dummy byte or something. Edited June 15, 2016 by danwinslow Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted June 15, 2016 Share Posted June 15, 2016 There may be alternative ways of tackling this Dan, but I didn't find any. Even as it stands it seems kludgy to me, so passing the last byte back in A somehow doesn't detract from its elegance too much. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted June 15, 2016 Author Share Posted June 15, 2016 Hah yeah, good point. I'm going to try the 'ICBAL/HZ' misdirection technique. The byte I point at will have to be in main bank, whilst the code that is running the CIO handler is in an expanded bank. I can probably just point it at the 'unused byte' in the ZIOCB itself, now THAT'S crafty. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted June 15, 2016 Author Share Posted June 15, 2016 That seemed to work perfectly. Dropped $2F into $24 and it stored the byte and went on about its business. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.