tschak909 Posted December 11, 2016 Share Posted December 11, 2016 Hello everybody, am trying to figure out the best way to do SDX system calls from C via cc65? For example, there is a routine that can be called to get the current date and time: void timedate(TimeDate* td) { struct regs r; assert(td!=NULL); r.pc = 0x703; // KERNEL r.y = 100; // GETTD *(byte*) 0x0761 = 0x10; // DEVICE _sys(&r); // Do Kernel Call. td->day = *(byte*) 0x77B; td->month = *(byte*) 0x77C; td->year = *(byte*) 0x77D; td->hours = *(byte*) 0x77E; td->minutes = *(byte*) 0x77F; td->seconds = *(byte*) 0x780; return; } Is it possible to use a similar mechanism to get access to the other SpartaDOS X functions? For example, I need to be able to set errno, when one module of my program goes byebye, so that I can call the next program module to load (and to cut down on footprint. I do not want to write a whole overlay system when I can use the OS to do it reliably). What I _want_ to do is have an overreaching TSR program (which I'd LIKE to be able to write in C), which will provide serial routines that I can call (open, close, read, write) from the other system modules (LOGIN.COM, BULLETIN, MSGBOARD, FILBOARD, BYE, etc.) and thus not only keep the memory footprint down, but to maximize modularity/flexibility. -Thom 1 Quote Link to comment Share on other sites More sharing options...
mono Posted December 11, 2016 Share Posted December 11, 2016 (edited) You could use JFSYMBOL function accessible at $7eb. Look at http://sdx.atari8.info/sdx_files/4.48/SDX448_Programming_Guide_EN.pdfchapter 16.1 "Looking up the symbols (S_LOOKUP)". A number of information is accessible by COMTAB structure addressed by DOSVEC vector. Edit: Main trouble is CC65 is not supporting relocatable SDX format, so making TSRs will be hard. Edited December 11, 2016 by mono Quote Link to comment Share on other sites More sharing options...
tschak909 Posted December 13, 2016 Author Share Posted December 13, 2016 Is there a source code example (in whatever assembler variant, don't care) of SDX TSR's ? -Thom Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted December 13, 2016 Share Posted December 13, 2016 Have a look at the MADS assembler examples (in the EXAMPLES folder). Writing native relocatable SDX binaries in straight assembler may be a bit of a learning curve, but it's worth it. 1 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted December 13, 2016 Author Share Posted December 13, 2016 are there any other high-level languages that can support SDX's reloc binaries? Just curious on all the options. mads syntax is a wee bit bonkers. -Thom Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted December 13, 2016 Share Posted December 13, 2016 (edited) No, but you don't have to use MADS' idiosyncratic features (just the directives pertaining to symbols and fixups, which would need to be catered for regardless of the language being used). Edited December 13, 2016 by flashjazzcat 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.