Harry Potter Posted October 19, 2021 Share Posted October 19, 2021 Hi! I am thinking about using the Atari XL's CIOV vector from a cc65 program and will soon need to call it. Does it reside in ROM? If so, how do I enable ROM to call it then disable ROM before returning? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted October 19, 2021 Share Posted October 19, 2021 Please explain why you are disabling the ROM CIOV vector is in ROM at $E456 Quote Link to comment Share on other sites More sharing options...
+DjayBee Posted October 19, 2021 Share Posted October 19, 2021 https://archive.org/details/ataribooks-de-re-atari/page/n105/mode/2up?q=ciov Quote Link to comment Share on other sites More sharing options...
ivop Posted October 19, 2021 Share Posted October 19, 2021 Answer to the same question you asked before: Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 19, 2021 Author Share Posted October 19, 2021 Thank you, and sorry for the repeated question. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 19, 2021 Author Share Posted October 19, 2021 tgb1718: I am disabling ROM because cc65 disables ROM on the AtariXL target. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 19, 2021 Author Share Posted October 19, 2021 ivop: It didn't help. It didn't answer my question on how to enable ROM, call the CIOV and then disable ROM just before exit. Quote Link to comment Share on other sites More sharing options...
ivop Posted October 19, 2021 Share Posted October 19, 2021 CC65 does not disable the ROM on the atarixl target. How do you think stdio works? It calls ROM. 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted October 19, 2021 Share Posted October 19, 2021 29 minutes ago, Harry Potter said: tgb1718: I am disabling ROM because cc65 disables ROM on the AtariXL target. As @ivop says, none of the 8 bits disable the ROM, unless your code is using the RAM under the OS which means your code will be disabling the ROM to do this, so you're in control, so you will know when you can call OS routines Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 19, 2021 Author Share Posted October 19, 2021 The cc65 AtariXL configs mention RAM under the OS, so I assumed that it would disable the ROMs so it could access the RAM. I also recall it being mentioned in the cc65 docs. If not, how do I use this extra RAM? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted October 19, 2021 Share Posted October 19, 2021 No, that is incorrect, PORTB in XL/XE machines is used to switch the OS in and out (in XE, also the banked RAM) I believe bit 0 controls the OS/RAM switch in and out, bit 1 switches BASIC in and out Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 19, 2021 Author Share Posted October 19, 2021 Okay, so how does cc65 access the high memory? BTW, I have some docs on the Atari's extra memory, but they only work on the 1200XL system. How do I do it on an Atari 150XL computer? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted October 19, 2021 Share Posted October 19, 2021 34 minutes ago, Harry Potter said: Okay, so how does cc65 access the high memory? Same as any other language, cc65 does not use the memory under the OS, you need to switch it ROM out. But it's not as simple as that, you will have to turn all interrupts off otherwise if an interrupt occurs while the OS is switched out it will crash the machine. something like this. char *portb=0xD301; // PORT B char *NMIEN=0xD40E; char *IRQEN=0xD20E; char *POKMSK=0x10; char temp; *NMIEN=0; // turn off interrupts *IRQEN=0; // ditto *POKMSK=0; // ditto temp=*portb; temp=temp & 0xFE; // mask out ROM *portb=temp; // do your stuff here temp=temp | 1; *portb=temp; // OS back in *POKMSK=0xc0; // turn interrupts back on *IRQEN=0xc0; // ditto *NMIEN=0x40; // ditto 1 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 19, 2021 Author Share Posted October 19, 2021 Thank you for the info. I'm just wondering...if cc65 doesn't support ROM-switching, how does it access the RAM behind the ROMs? Quote Link to comment Share on other sites More sharing options...
danwinslow Posted October 19, 2021 Share Posted October 19, 2021 Harry - Again, this is all probably too hard for you. Try something smaller and easier. TGB *just* explained exactly how it works. Read the code he wrote above. Look up each location in Mapping The Atari. Read as much as you can until you understand what the code is doing. Then you will know how any code in any language accesses the RAM under the ROM. 1 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 19, 2021 Author Share Posted October 19, 2021 I can do it. I can convert the code given here to assembler and use it to access Hidden RAM from a MemXAtari program. Like I do with Hidden64 for the C64. BTW, my floppy drive broke, and I have much of my code on floppies. I'm waiting for my mother to bring to me a replacement floppy drive. Unfortunately, it's being used on another laptop, so I will need to get more from eBay. Quote Link to comment Share on other sites More sharing options...
sanny Posted October 19, 2021 Share Posted October 19, 2021 (edited) 4 hours ago, ivop said: CC65 does not disable the ROM on the atarixl target. How do you think stdio works? It calls ROM. You'e wrong, It _does_. That's in fact the difference between the "atari" and "atarixl" targets. For assembler programs the include file "atari.inc" defines a CIOV label which points to code to enable the ROM, call real CIOV, disable the ROM again. Since currently there is no such provision for C you'll need to write a small assembler stub which can be called by C and calls the CIOV label. Edited October 19, 2021 by sanny Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 19, 2021 Author Share Posted October 19, 2021 Thank you, sanny! Quote Link to comment Share on other sites More sharing options...
ilmenit Posted October 20, 2021 Share Posted October 20, 2021 Here is a tutorial how to temporarily switch on OS for making the system calls, read also the forum threads like this one. I agree with the others though - looking at the questions you ask it's beyond your current knowledge and skills. You are constantly asking for a code examples how to solve problems for you instead of trying to understand how stuff works. Try to finish something simpler first, read and understand a few books https://www.atariarchives.org/ like "De Re Atari" or "Mapping The Atari - Revised Edition". 1 Quote Link to comment Share on other sites More sharing options...
ivop Posted October 20, 2021 Share Posted October 20, 2021 16 hours ago, sanny said: You'e wrong, It _does_. That's in fact the difference between the "atari" and "atarixl" targets. I see. Wasn't aware of that fact. Thanks! Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 26, 2021 Author Share Posted October 26, 2021 IIRC, the AtariXL version of the cc65 libraries disables the ROMs but keeps interrupts working. Can I simply remove the code to disable the interrupts from the given? Quote Link to comment Share on other sites More sharing options...
ilmenit Posted October 28, 2021 Share Posted October 28, 2021 On 10/26/2021 at 10:13 PM, Harry Potter said: IIRC, the AtariXL version of the cc65 libraries disables the ROMs but keeps interrupts working. Can I simply remove the code to disable the interrupts from the given? what about stop seeking attention and doing for a change what a programmers do, therefore first reading the documentation, source code, trying it yourself and debugging to find out what's and why not working? 3 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.