Harry Potter Posted October 7, 2021 Author Share Posted October 7, 2021 So don't use Low Memory at all. I thought I had something going there. It has to be due to a bad executable file format. I tried everything, but I can't get the extra RAM to work. I will try the RAM at $0400-$06FF now. Quote Link to comment Share on other sites More sharing options...
mellis Posted October 7, 2021 Share Posted October 7, 2021 Over the decades that I have been involved with Atari 8-bits, I've watched some folks look to higher level languages (like C or Pascal) for something faster than BASIC but easier to learn than 6502 assembly language. What ends up happening is that, outside of simple console I/O programs (which could be written on any computer) those languages do little to make programming our 8-bit Ataris any easier. With such limited resources, programming a 64K computer requires a thorough understanding of its memory map and what that means in terms of the computer's underlying hardware. If you find these details too cumbersome, BASIC is truly the best, most approachable way to program these machines. When you get more comfortable with that, you can branch out into programming small, assembly language subroutines that can be used to speed up your BASIC program. What I am reading in your threads is that you do not understand how the computer's memory map works, and therefore you struggle to properly configure the C linker. Unless you really understand the layout of your program in memory, you will continually struggle to make C do what you want on these machines. I assume you are attempting to program the 8-bit Atari because you want to take advantage of its graphics and sounds capabilities, but doing so will be very difficult in this language I believe you have chosen specifically because you think it will be easier (spoiler: it is not easier). If Atari 8-bit sounds an graphics are what you seek, I recommend getting started in BASIC and then moving to assembly language. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 7, 2021 Author Share Posted October 7, 2021 I have the Mapping the Atari e-book and perused it for usable Low Memory addresses. I don't need these areas, but using them should increase the amount of usable RAM. I don't know why my program is not working, but the CBM versions work. I really don't want to add code to the main module to load in the Low Memory stubs, as the OS should be able to load these stubs into memory from the executable. You're right about using BASIC first, though, but I have nothing but MadLibAtari to program in BASIC, and MadLibAtari works fine in cc65 C. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted October 7, 2021 Share Posted October 7, 2021 (edited) 30 minutes ago, Harry Potter said: I don't know why my program is not working It's been explained quite a few times now and you need to a) comprehend why and b) resolve. We can do this for you but my fear it you won't learn unless you work it out. Its not clear whether you have two things going on here... is your library supposed to use the low memory area or is your library something a client (e.g. your test app) is utilising as a kind-of 'framework' and as a bonus they can (optionally) access low memory if they so wish? Edited October 7, 2021 by Wrathchild Quote Link to comment Share on other sites More sharing options...
drac030 Posted October 7, 2021 Share Posted October 7, 2021 54 minutes ago, Harry Potter said: I don't know why my program is not working But I do: IT OVERWRITES DOS. 56 minutes ago, Harry Potter said: I have the Mapping the Atari e-book and perused it for usable Low Memory addresses. The addresses listed there for the area $0700-$1FFF are only valid for DOS 2.0s, which means that they are not "contractual", as they say. But even for DOS 2.0s, as it was already said to you, Mapping the Atari gets the address $15A4 wrong: it is not a procedure of "loading MEM.SAV if it exists". It is the binary loader. 3 1 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 7, 2021 Author Share Posted October 7, 2021 It's not the library that is to access he memory but the config files used by the library. I really want to add these memory locations to usable memory. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 7, 2021 Author Share Posted October 7, 2021 Okay. What parts of Low Memory can I use? Quote Link to comment Share on other sites More sharing options...
+Stephen Posted October 7, 2021 Share Posted October 7, 2021 1 minute ago, Harry Potter said: Okay. What parts of Low Memory can I use? JUST DON'T. What the are you expecting to gain by a few extra bytes?!? Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted October 7, 2021 Share Posted October 7, 2021 15 minutes ago, Harry Potter said: It's not the library that is to access the memory but the config files used by the library. The config file merely defines the area, it doesn't access it, nor provide any content for it?! 16 minutes ago, Harry Potter said: I really want to add these memory locations to usable memory. Then just leave that up to the user, they will know what memory area can be used. e.g. if the user knows that DOS isn't needed after the XEX has been loaded then they can use that area for what they like. The user has many options on doing that, decompress data into it or wipe it and use for screen RAM, their call. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted October 7, 2021 Share Posted October 7, 2021 17 minutes ago, Harry Potter said: Okay. What parts of Low Memory can I use? You can use a few bits and pieces here and there, but it's generally not worth it as a utility library for general programming. You can use anything that isn't used by the DOS....and you can figure out where DOS stops by using some memory values. You need to READ mapping the atari and de re atari, not just peruse them. You don't need to write us a utility to use low memory, we all pretty much know what is there and can use it if we feel like it. There really is no magical piece of low memory that you can make useful to anybody in the general case, there are way too many failure cases. 4 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted October 8, 2021 Share Posted October 8, 2021 If you really need to use low memory for your program, don't try loading into these areas, just use them for data/variables, that way you control how it's used and if it crashes, so much easier to see what's broken. 1 Quote Link to comment Share on other sites More sharing options...
dmsc Posted October 8, 2021 Share Posted October 8, 2021 Hi! On 10/7/2021 at 2:18 PM, drac030 said: Maybe providing some switch or even a template to the linker could help it to detect errors in configuration, just as a sort of safety checks. Then you could say to the OP: "add --std-executable to the linker switches and see what it says". This would stop the whole process at the stage where the executable cannot be created, and not at the stage when it is executed and crashes the system. If you use the XEX output format in the linker, it will automatically write correct headers, but he is using the RAW output format, in which the linker does not know the output format. We already told him to use the XEX output format a while ago, also we told him to read the documentation, and we also told him that he does not need to use a non-standard linker config for using low memory, but he does not listen. On 10/7/2021 at 2:18 PM, drac030 said: In assemblers you are on your own too, but it actually takes effort to convince an assembler to produce a messed-up binary, as the regular executable is usually the default. In CC65 it is the same if you use the correct linker config, you need to use raw output format to produce an invalid file. Have Fun! 1 Quote Link to comment Share on other sites More sharing options...
drac030 Posted October 8, 2021 Share Posted October 8, 2021 I see, so nevermind. Anyway, the binary he posted is messed as it can be seen above, but the first problem is that it overwrites the very code that is loading the program (in DOS 2.0s and 2.5 - under any other DOS it overwrites God knows what) . And the OP seems fixated at the idea that what is there "shouldn't be needed by a cc65 program", and is unable to connect the fact that he is overwriting a part of the OS with the fact that his program crashes in the middle of loading. What a mess. 2 Quote Link to comment Share on other sites More sharing options...
+DjayBee Posted October 9, 2021 Share Posted October 9, 2021 What do you expect? He comes from a platform which does not know the concept of an operating system. 3 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted October 9, 2021 Share Posted October 9, 2021 6 hours ago, DjayBee said: What do you expect? He comes from a platform which does not know the concept of an operating system. Ouch!!! Quote Link to comment Share on other sites More sharing options...
glurk Posted October 9, 2021 Share Posted October 9, 2021 At least part of the issue is that he's using "Mapping the Atari" and much of the stuff in the book that refers to DOS is only relevant to the particular version of Atari DOS that was current at that time. And of course there are a plethora of DOS's available, and much of the book's info does not apply to any of them at all... Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted October 9, 2021 Share Posted October 9, 2021 (edited) Maybe this might be a bit better as it has the updates for XL and XE machines:- https://www.atariarchives.org/mapping/ Mapping The Atari Update.pdf Edited October 9, 2021 by TGB1718 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 9, 2021 Author Share Posted October 9, 2021 I got the message: simply don't do it. I could be overwriting something important and undocumented. 2 Quote Link to comment Share on other sites More sharing options...
drac030 Posted October 11, 2021 Share Posted October 11, 2021 Where is the "Finally" button to click? 1 3 Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted October 12, 2021 Share Posted October 12, 2021 (edited) On 10/9/2021 at 2:10 PM, Harry Potter said: I got the message: simply don't do it. I could be overwriting something important and undocumented. It isn't undocumented, it just within a number of documents other than the one or another you apparently are reading. Edited October 12, 2021 by _The Doctor__ 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.