Jump to content
IGNORED

XASM question


analmux

Recommended Posts

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! 8) :D

Link to comment
Share on other sites

@ 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

Link to comment
Share on other sites

...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 :roll: ), but off course with XASM it is easier to relocate the leveldata/fonts etc. in this area than to map the program there.

 

 

 

 

-----

mux

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...