Darkhog Posted April 26, 2013 Share Posted April 26, 2013 I've assembled first program from Atari Roots (one that adds two to two) and saved as object file. As Sparta Dos X user I couldn't get it to run. SDX doesn't have RUN command and else. What I need to do with my code to be able to run it from SDX? Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted April 26, 2013 Share Posted April 26, 2013 http://sdx.atari8.info/sdx_files/4.45/sdx-445-manual.pdf This should help.. Quote Link to comment Share on other sites More sharing options...
Xuel Posted April 26, 2013 Share Posted April 26, 2013 (edited) It's better to test the two plus two program within MAC/65. You don't need to save it to a file. The program doesn't output anything. It only changes a memory location. So you'll need a monitor like Mac/65's DDT to see the effect. Here are the steps starting from scratch for those who want to follow along: 1. Download Mac/65. 2. Boot the cartridge in Altirra or your emulator of choice. 3. Type in the program from Atari Roots Chapter 4. Change the starting location of the assembly since page 6 gets used by Mac/65: 40 *=$3800 Also, add the following line at the top to tell Mac/65 to actually assemble to memory. 10 .OPT OBJ See also the Mac/65 Manual. Make sure you use the correct number of spaces between the line numbers and the first token on each line. You can cut-and-paste this in Altirra: 10 .OPT OBJ 40 *=$3800 60 CLD 70 ADDNRS CLC 80 LDA #2 90 ADC #2 100 STA $CB 110 RTS 120 .END 4. Assemble with "ASM" 5. Start debugger with "DDT" 6. Type "E 3800" to see your code 7. Type "E CB" to see initial value in address $CB 8. Type "G 3800" to run your code 9. Type "E CB" to see the value stored by your program Edited April 26, 2013 by Xuel 1 Quote Link to comment Share on other sites More sharing options...
Darkhog Posted April 26, 2013 Author Share Posted April 26, 2013 (edited) http://sdx.atari8.in...-445-manual.pdf This should help.. Which part of it? Because I've read through it like five time and only thing I could get with was this X command that didn't work anyway. //edit: Xuel, thanks again. Will try it. Edited April 26, 2013 by Darkhog Quote Link to comment Share on other sites More sharing options...
Darkhog Posted April 26, 2013 Author Share Posted April 26, 2013 Also I'm working through Writing programs that will run when loaded and cannot find SDX equivalents to commands presented there. And when I just try to execute directly from SDX prompt or via X command, Atari crashes. Quote Link to comment Share on other sites More sharing options...
drac030 Posted April 26, 2013 Share Posted April 26, 2013 This means your program has a serious bug. Check and recheck the code, the following conditions first: 1) if the load address is correct, i.e. it does not overwrite DOS (DOS is above $0700 and below MEMLO value). 2) if the start address (RUNAD) is correct. When there is no RUNAD segment in your code, SDX executes the binary from the beginning. To append RUNAD segment, add this: *= $02E0 .word start and mark the beginning of your program with the label 'start'. Quote Link to comment Share on other sites More sharing options...
Darkhog Posted April 26, 2013 Author Share Posted April 26, 2013 Well, I'm going with code from Atari Roots (someone even posted it earlier, I think it was Xuel). Where do I add RUNAD segment? At beginning or end of code? Quote Link to comment Share on other sites More sharing options...
drac030 Posted April 26, 2013 Share Posted April 26, 2013 Simply add this at the end of your source. It can be anywhere in fact, but the end of the program listing is perhaps the most convenient point. Quote Link to comment Share on other sites More sharing options...
Darkhog Posted April 26, 2013 Author Share Posted April 26, 2013 Hm... Still doesn't work, even with this. When I ASM code, then BSAVE and run from SDX, it still crashes my (virtual) Atari. Quote Link to comment Share on other sites More sharing options...
drac030 Posted April 26, 2013 Share Posted April 26, 2013 Try assembling to a file, IIRC: ASM,,#D:FNAME.OBJ Quote Link to comment Share on other sites More sharing options...
Darkhog Posted April 26, 2013 Author Share Posted April 26, 2013 Thanks, drac030! That totally works! Quote Link to comment Share on other sites More sharing options...
Darkhog Posted April 27, 2013 Author Share Posted April 27, 2013 I'm currently going through "The Visitor" section of Atari Roots. I've already entered and saved "library" from beginning of the chapter, but have no idea how to link it with actual program. Any help? 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.