nuadok Posted March 13, 2020 Share Posted March 13, 2020 Hello. I have made a little program using Program Editor and Atari Macro Assembler suite. When I assemble the program the system creates an object file. How do I execute this object file? The ATA Manual does not say nothing about this. Thanks for your help. Quote Link to comment Share on other sites More sharing options...
+MrFish Posted March 13, 2020 Share Posted March 13, 2020 From Atari DOS, use the "L. Binary Load" command. Quote Link to comment Share on other sites More sharing options...
nuadok Posted March 13, 2020 Author Share Posted March 13, 2020 2 hours ago, MrFish said: From Atari DOS, use the "L. Binary Load" command. It asks for a file. Do I have to insert the object code file? I did and the emulator (atari800win) hung up. I think I should insert the "executable" file, the same way I insert "AMAC" or "MEDIT", but there is not "exec" file like those called TEST, being TEST.OBJ my assembled object file. Quote Link to comment Share on other sites More sharing options...
+MrFish Posted March 13, 2020 Share Posted March 13, 2020 You just need to have the disk inserted that contains the file you want to load. Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 14, 2020 Share Posted March 14, 2020 Chances are the file you created has no run/init headers as part of the binary. In many cases you can just use Doses run at address command, in some cases the Dos will just run at the load address if no run address is supplied. But you can generally get the assembler to put it in for you - put a section of code similar to this before or after the remainder. e.g. *=$2E0 .WORD RUN_ADR,INIT_ADR If you have no requirement for a seperate initialize section then just omit INIT_ADR. Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted March 14, 2020 Share Posted March 14, 2020 10 hours ago, nuadok said: It asks for a file. Do I have to insert the object code file? I did and the emulator (atari800win) hung up. Atari DOS does not have dedicated "object code files", and there is no such thing as "linking". If you want to link two "object codes" into "one executable" you just concatenate the files. If you want to load an executable from the DUP menu, you better make sure that the address the binary is loaded to does not overlap with the memory area the DUP is loaded into, or you will not be able to return to the DUP menu after loading the file to run it. Thus, there are two things you can do: 1) Give your program a run address so DUP can run your file directly after having loaded it, so there is no need to RUN it manually. This is done by adding the following lines to your code: *=$2e0 ; this is the run address vector .WORD startAddress 2) Just place the program in an address space the DUP does not need. Off my head, I do not remember where the 2.0S/2.5 DUP requires its memory, but I would believe you may be safe at $3c00 and above. Quote Link to comment Share on other sites More sharing options...
Rybags Posted March 14, 2020 Share Posted March 14, 2020 (edited) DUP can binary load over itself to a point - the binary loader is fairly early in the code. The system is usually smart enough to know when an overwrite has occurred so that a reload of DUP can be performed if needed. Note the logic for use of MEM.SAV gets thrown in there also. Edited March 14, 2020 by Rybags Quote Link to comment Share on other sites More sharing options...
nuadok Posted March 14, 2020 Author Share Posted March 14, 2020 Hello again. The program still freezes. I got this test code: I assembly it: Run it and it freezes: I have not been able to find a complete test code written with Atari Macro Assembler in Internet. Can you provide me a complete one and what exactly do i have to do to run it? Thanks. Note: I read the AMA Manual and it says nothing about how to run a program. Quote Link to comment Share on other sites More sharing options...
fox Posted March 14, 2020 Share Posted March 14, 2020 Apparently, the people here are not familiar with the AMAC syntax. 1. Select a memory location for your program with ORG. 2. Terminate your program somehow (e.g. RTS for return to DOS). 3. Specify the run address as an argument to END. ORG $6000 MAIN LDA 710 STA 712 LDY #1 RTS END MAIN This program changes the border color to the background color and returns to DOS. LDY #1 is not essential. If missing, some DOSes will report an error when they get back control. 2 Quote Link to comment Share on other sites More sharing options...
nuadok Posted March 14, 2020 Author Share Posted March 14, 2020 (edited) 30 minutes ago, fox said: Apparently, the people here are not familiar with the AMAC syntax. 1. Select a memory location for your program with ORG. 2. Terminate your program somehow (e.g. RTS for return to DOS). 3. Specify the run address as an argument to END. ORG $6000 MAIN LDA 710 STA 712 LDY #1 RTS END MAIN This program changes the border color to the background color and returns to DOS. LDY #1 is not essential. If missing, some DOSes will report an error when they get back control. Hello Mr Fox. It worked. I tested changing LDA 710 to LDA 711 and added a jump to avoid returning inmediately to be sure that the program was executed: ORG $6000 MAIN LDA 711 STA 712 LDY #1 JMP MAIN RTS END MAIN It changes the background color to pink (it seems that the original background color is black). How did you learn this? Thanks again. Edited March 14, 2020 by nuadok Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted March 14, 2020 Share Posted March 14, 2020 3 hours ago, nuadok said: Hello again. The program still freezes. Errr... The contents of $2e0 is not $2e0 itself (as you put into your source), but the entry address in the code from which it is run. So, for example, if your code starts at "Main", then *=$2e0 .WORD Main would do the job. Quote Link to comment Share on other sites More sharing options...
Martin72 Posted March 15, 2020 Share Posted March 15, 2020 You can find all information about the Atari Macro Assembler in the 2 documents: Atari Macro Assembler Atari Program-Text Editor You can find these documents here : Atari Macro Assembler I've make some pictures of the original documentation: 1 Quote Link to comment Share on other sites More sharing options...
fox Posted March 15, 2020 Share Posted March 15, 2020 18 hours ago, nuadok said: How did you learn this? I learned that in the 80s. There were these excellent books in Polish: "Asembler 6502" by Jan Ruszczyc and four parts of "Mapa pamięci Atari XL/XE". AMAC is not a friendly environment to study the 6502 asm. Try Quick Assembler (QA) instead. It's an IDE. For the start: opt 21 org $600 loop lda $d40b sta $d01a jmp loop In the "Setup" menu set the run address to 0600. Then select "Assembly" and "Run". Shift+Break to terminate your program. Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted March 15, 2020 Share Posted March 15, 2020 From personal experience, you don't really need to enter anything into $2E0. Both Assemler Editor and MAC65 will compile the code which when loaded will run at the load address. Obviously if you need an INIT then RUN you would use $2E2 and $2E0 with the addresses of the INIT code and the RUN code. I think I've only ever used these addresses with BOOT Cassettes and Disks where there is no DOS Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted March 15, 2020 Share Posted March 15, 2020 1 hour ago, TGB1718 said: Both Assemler Editor and MAC65 will compile the code which when loaded will run at the load address. I think I've only ever used these addresses with BOOT Cassettes and Disks where there is no DOS Ehem, not quite. So, first for "binary load files". If you want to run a binary load file either as AUTORUN.SYS or from the DUP menu of any of the Atari DOSes, e.g. DOS 2.0S, 2.5 or 3.0, then it *needs* a run address or it will not be run. This is different for Os A/+ and related products from OSS. They use an implicit run address which is the load address of the first segment of the file, unless there is a run address explicitly given. Many game DOSes (such as NDOS) follow the same convention, i.e. implicitly assume a RUN address if none is given. However, as said, for compatibility with Atari DOSes, you'll need one. Second, BOOT tapes and disks are an entirely different business. They do not use a binary load file structure (the thing that starts with a 0XFF 0XFF pair), but use the boot structure: First, a boot flag which has no meaning but must be present, then the number of sectors (or blocks) to be loaded, followed by the load address where to place the data, followed by the RUN address. The init address is then the load address + 6. However, this mechanism does not use $2e0 to $2e3, but $a,$b and $c,$d. 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted March 15, 2020 Share Posted March 15, 2020 Sorry, my bad, I stopped using "Atari" DOS's back in the 80's when I got MAC/65 which wouldn't run on DOS 2.0 or 2.5, I ran it on OS/A+ and Spartdos (1050 with US Doubler) which do allow running from the load address. 1 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.