+Ripdubski Posted April 7, 2014 Share Posted April 7, 2014 I'm learning assembly so be kind if this is dumb. Whats the best way to determine the load address when writing a program? One thing I've read said to subtract 1.5K from highest ram location but that seems silly.. Wouldnt that limit the program size to 1.5k? Enlighten me. Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 7, 2014 Share Posted April 7, 2014 Load address is up to you, but you need to consider the environment, e.g. whether it has to work with a Dos present, whether it works with Basic or a cartridge present. The "top of memory - 1.5K" is more like the upper limit, the real figure is closer to 1K. On a >= 48K machine the Display List will start at $9C20 which is precisely 32 bytes less than 1K. For something that's bootable, e.g. cassette or ATR image the lower limit is generally $480 - the first byte after the cassette buffer. Once a program is loaded it can use the cassette buffer as workspace if required. For something that's to be loadable from Dos - that's a tricky one since there's so many Doses out there and the memory use varies. To be safe, probably $3800. Although Dos 2.x should tolerate partially overwriting the DUP since it's dynamically loaded and can be refetched. For something that coexists with Basic it gets tricky because there might be a Basic program present also. But since Atari is generally a single-tasking system, it's usual that a loaded program will have exclusive use of the system or at most only show consideration for Dos. Quote Link to comment Share on other sites More sharing options...
+Ripdubski Posted April 7, 2014 Author Share Posted April 7, 2014 Ok, i was reading $3600. I was more interested in if there was a programatic way to do it? Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 7, 2014 Share Posted April 7, 2014 6502 doesn't lend well to relocatable execution. An alternate is to do multiple versions of a program with different load addresses. Quote Link to comment Share on other sites More sharing options...
MaPa Posted April 7, 2014 Share Posted April 7, 2014 I use $2000 as load address in my prods but I rarely return to DOS (only FLOP disk mag intros). Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted April 7, 2014 Share Posted April 7, 2014 $2000 is a safe address to start applications. Quote Link to comment Share on other sites More sharing options...
+Ripdubski Posted April 7, 2014 Author Share Posted April 7, 2014 Thanks all. Quote Link to comment Share on other sites More sharing options...
+Ripdubski Posted April 7, 2014 Author Share Posted April 7, 2014 I used $3800. I got my first assembly program in 25+ years working! Woot! I did learn the hard way that RTS was required before .END I had a lot of strange things occurring when the program would end. Thanks again. 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.