04 October 2021, 15:50 | #41 | ||||
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
Quote:
Quote:
PC-relative addressing is for constant data close to the PC, typically strings. If you need "data storage on the heap", then PC-relative is not the right addressing mode anyhow. base-register relative for small data, or absolute for large data, either in a separate hunk, or allocated upon startup if you prefer pure (as in "resident-able") code. Slink will create an error in case ALVs are required to access data. Quote:
That's not the only "style issue" with the code. About 80% of the rexxsyslib.library is pretty useless (at least for any higher programming language) because it uses dual return codes, return codes in condition registers and other assembly-only features. Well, and it is utterly useless because it is utterly undocumented.... It's pretty much an alien to the rest of the system (well, maybe along with graphics whose built-system is also a mess). Quote:
Not at all. Apparently, the built-system they used created one separate hunk per translation unit, so there is nothing really strange about that. There are advantages and disadvantages on many hunks. The disadvantage is that it takes longer to load and requires more relocation information. The advantage is that it may load even if the main memory is pretty fragmented, which was an issue with the tiny RAM the A1000 came with. Today, this is not really an issue anymore. Amiga Basic aka "Microsoft Basic" is more or less a straight port from Mac, and probably half assembler and half C. |
||||
04 October 2021, 15:54 | #42 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
Quote:
In C++, it's ideally "one file, one class", and you can mimic this in assembler as well. |
|
04 October 2021, 16:02 | #43 | |
Registered User
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
|
Quote:
In my C++ code I usually follow this paradigm. On the C128 I didn't do it because it was at the beginning a rather hands-on project, but as it grew it became more and more apparent that it gets harder to maintain already. Compile time doesn't matter in this case because the generation is so fast that it doesn't reall matter one way or the other. However, I find it nice when I finished a module (i.E. Keyboardhandling) it's in a seperate file and I don't have to touch it again until I find a bug or need to improve it. It doesn't clobber up my current file and I can let it out of my head because it's finished. |
|
05 October 2021, 02:49 | #44 | ||||||||
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,546
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
But it seems to be the trend these days. Most of the 'modern' source code I have looked at has a ton of 'boilerplate' at the start, but little or no description of what the code does or how it works, and barely a single comment in sight thereafter. And dozens of files that are little more than stubs, which you have to wade through trying to figure out what some function actually does. Quote:
Quote:
Sadly it appears to use the upper 8 bits of addresses for something else, which makes it fundamentally incompatible with 32 bit systems. Commodore were right not to pay Microsoft for this dross! It's a pity because the top level design was rather nice (certainly much better than any 8 bit BASIC I have used) and it has excellent support for Amiga system functions. Some day I hope to finish patching it to at least work properly on a stock A1200 with FastRAM. Last edited by Bruce Abbott; 05 October 2021 at 02:55. |
||||||||
05 October 2021, 08:24 | #45 | |||||
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
Quote:
So it's not very well organized, essentially. (-; If you want to use them from any language but assembler, then that makes the calls pretty useless. Well, despite many of them also use the Rexx error reporting and forwarding functions in case something goes wrong, which is also only usable from assembler. Quote:
Quote:
Quote:
Quote:
MacOs fixed the handle issues pretty soon, and there was also a 2.x beta version of Microsoft Basic (there are hints on beta test reports on it in the CBM bug tracker database), but it MS wanted to charge CBM 1$ per sold copy, and CBM went cheap and ditched the project. If you want to "fix" that, then be prepared for quite a challenge because the entire memory management has to be redone. Read "Inside macintosh" to get an idea what these "upper bits" are supposed to mean. |
|||||
05 October 2021, 09:59 | #46 | |||
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,546
|
Quote:
We have to conform to the conventions of 'any other language' when interfacing to it, so... Quote:
You may say "why bother?" but I have fond memories of programming in AmigaBASIC on the A1000, so for me it's another part of the 'retro' experience that I would like to explore (eg. imagining a '2.x' version that worked on newer machines). Quote:
ETA: Oh oh! Inside Macintosh "The best guide to the Mac's ROMs is Inside Macintosh. Unfortunately, Inside Macintosh is also the most incomprehensible documentation ever written." Last edited by Bruce Abbott; 05 October 2021 at 10:07. |
|||
05 October 2021, 13:34 | #47 |
Registered User
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
|
With Winuae and the ability to push Processor further, Assembling code isn't anymore an issue: on "My" 040 at 100mhz that it's like a piece of cake.
So, the real deal it's only debugging, that needs to be flawless, otherwise will be a pain in the ass |
05 October 2021, 14:43 | #48 | ||
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
Quote:
Quote:
Actually, I do not find these books hard to read, but what's hard about them is that MacOs has also a couple of inconsistencies as it uses three different calling conventions. Assembler, Pascal and C, depending on the system trap you use, passing rules are different. AmigaOs libraries use one convention (exception: ARexx, and Dos/Tripos for using data registers for pointers and the BPTRs). MacOs "QuickDraw" (approximately Amiga "graphics.library") is an odd-ball that it keeps its own list of globals in the "a5 world", a construction no other MacOs manager uses. Concepts of quick-draw are fine and well thought about, but the technical integration into the Os is... weird. |
||
05 October 2021, 14:44 | #49 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
Quote:
The issue is not so much assembling stuff. It's managing stuff, and "needing the debugger". If the thing is properly maintained, you wouldn't need the debugger so often. |
|
05 October 2021, 17:13 | #50 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
But it's on my list. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Devpac Debug hunks | phx | Coders. General | 21 | 16 July 2023 08:13 |
Assembler files and C in GCC / bartman's amiga-debug | zero | Coders. C/C++ | 11 | 12 March 2021 16:17 |
Devpac include files? | anotheramigafan | Coders. General | 2 | 21 August 2018 21:44 |
Open '.txt' files in Devpac without CR\LF Characters | Blip | Coders. General | 4 | 11 January 2018 03:46 |
Debugging included files (AsmOne vs DevPac) | nandius_c | Coders. Asm / Hardware | 4 | 24 August 2014 13:19 |
|
|