analmux Posted September 27, 2003 Share Posted September 27, 2003 Suppose I'd want to locate my code from $c000 to $ffff. You can't just type: org $c000 etc.etc. because the ORGs are loaded with the Resident Disk Handler routine in the OS-ROM. How do I solve this problem?? ----- mux [/code] Quote Link to comment Share on other sites More sharing options...
Sheddy Posted September 27, 2003 Share Posted September 27, 2003 If I understand your question correctly, which on reflection, I didn't and so have just edited the post, to say I don't know how to do that on XASM! I think you're going to need to create two sets of equates though - one for area of memory where they're coming from (for the benefit of the loader), and one for where they're going to (for when they are called) As to the easiest way to do this in XASM - I don't know. In ATasm, it is awkward! This lot under here from before my edit - I assume you know already then!: you're going to have to load into another area of RAM and then copy back into this area - for the following reasons: As you know - this area back can be turned into ram on XL/XE with bit 0 of PORTB (54017) - but since this in effect loses the OS as well (only hardware registers remain mapped), you need to provide your own interrupt handler if you leave VBI and DLI etc. running. If you want to load into this area using the disk handler routines, you will need to load into another area of memory first. You could, for example load a disk sector into normal RAM, switch off the OS ROM, copy back into this area, then enable the OS again for the next sector. Or if you have enough RAM - just copy the whole thing at once from another area. Mapping the Atari has quite a good guide about PORTB and memory switching (appendix 12 XL/XE) BTW - just tried your scrolling MCS demo - Me Like! Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 27, 2003 Share Posted September 27, 2003 maybe u can use the "/p" option of xboot. then your code will be loaded with the professional loader which disables all unneccessary os and rom... ? hve Quote Link to comment Share on other sites More sharing options...
analmux Posted September 29, 2003 Author Share Posted September 29, 2003 Heaven, is there some (non Polish ) documentation about XASM that I can download??? ----- mux Quote Link to comment Share on other sites More sharing options...
Bryan Posted September 29, 2003 Share Posted September 29, 2003 I'm lost. Are you trying to put a loadable header on your program? -Bry Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 29, 2003 Share Posted September 29, 2003 ana xasm.atari.org Quote Link to comment Share on other sites More sharing options...
analmux Posted September 29, 2003 Author Share Posted September 29, 2003 @ Heaven Xboot professional mode and the Xasm site docu didn't help me much further. But I think there is a simple solution. just type all the code you want to locate in the $c000-$ffff RAM in a separate ASX file, with the usual org definition: org $c000 {code}... then assemble and insert the OBX file as a data stream in a second ASX file that loads the OBX in the normal RAM from $0000-$bfff, and then make a little routine in the second ASX file that moves the data from the buffer area to the place where it belongs. so in the 2nd ASX will apear things like this: org $8000 buffer ins "first.obx" jsr move_first_to_$c000-$ffff ...etc. @ bryede All I want is to use the last 16kB bank in the 800 XL for storing program code. But with the xboot-package this can be kind of awkward. ----- mux Quote Link to comment Share on other sites More sharing options...
analmux Posted September 29, 2003 Author Share Posted September 29, 2003 ...another solution might be using a variable, say: REMAP0 equ $4000 then, whenever you want a piece of code to apear in the last 16kb bank: (example code) random equ $d20a org $8000 start mva $14 colbk lda random and #3 tax lda start_data+REMAP0,x sta graphp0+2 jmp start+REMAP0 start_data dta $68,$72,$3f,$44 And then insert a move routine that moves the code to the desired place. In this case $4000 bytes higher in memory ..... But now I'm thinking about this problem....I wanted to map program code in the $c000-$ffff area for my super mario 3 clone, because I already planned where all the data should be located (stupid ), but off course with XASM it is easier to relocate the leveldata/fonts etc. in this area than to map the program there. ----- mux Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 30, 2003 Share Posted September 30, 2003 the professional loader may show you how to code a small kernel routine to load data directly into that area... it contains small service routines which disable ROM, implement a mini NMI and SIO routine so you can load directly code there... in meantime i have requested fox to sent me his kernel routine... i got it few years ago when i placed code in that ram area as well but lost it due to harddisc crash... cheers, hve Quote Link to comment Share on other sites More sharing options...
fox Posted October 4, 2003 Share Posted October 4, 2003 Actually loading data to a different memory area than it's compiled for is #1 on my TODO list for xasm. I got some suggestions from xasm users to do that - you could also have emailed me, since I rarely read AtariAge forums. As Heaven suggested - xboot /p is good for development purposes, and for the final product you can write your own loader, or relocate things yourself. 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.