+JAC! Posted January 18, 2015 Share Posted January 18, 2015 (edited) Hi, three things first: 1) I've never used SDX and not even loaded a program for it 2) I know the file format though and wrote a parser for it 3) I know 1) and 2) are a somehow a contradiction, but who said this forum is for logical questions only I have a program here as source that was done for SDX. The author (mono) uses the CPP pre-processor because the code uses symbols relative to COMTAB. The latter I assume is the base address for all system routines, like the EXEC ($0004) pointer under Amiga OS. ; In asm source you must include: ; #include "sdxdef.icl" ; and assembly with: ; $ cpp -P source.asm -o source.a && mads source.a DECOUT2 = COMTAB-21 The reason behind using the pre-processor seems to be that MADS cannot result definition like the one above if COMTAB is a relocated symbol. And when I replace DIVA = COMTAB+255 DIVB = COMTAB+$103 FACA = COMTAB+255 FACB = COMTAB+$103 RESI = COMTAB+$107 by FACA SMB 'FACA' FACB SMB 'FACB' RESI SMB 'RESI' it all compiles fine with MADS without the pre-processor but will must likely not load because RESI for example will not be resolved. What's the reason behind this? Does the SDX loader only resolve a subset of the entries known in this "COMTAB"?If yes, why? I'd assume all entries in COMTAB are "public" (at least the code above anyway codes against that assumption/offsets). Edited January 18, 2015 by JAC! Quote Link to comment Share on other sites More sharing options...
mono Posted January 21, 2015 Share Posted January 21, 2015 (edited) Try to replace "RESI" with "COMTAB+$107" inplace. For example: lda RESI replace with: lda COMTAB+$107 It compiles and run correctly. Cpp does it this way Edit: SDX resolves only COMTAB symbol, as an starting address of system variables table (this table contain variables like RESI, DIVA, DIVB, etc). Edited January 21, 2015 by mono Quote Link to comment Share on other sites More sharing options...
+JAC! Posted January 28, 2015 Author Share Posted January 28, 2015 (edited) Hi mono. I know it works that way, the questions was why isn't it done the more flexible way. The answer probably is all about saving memory at the expense of less flexibility/implicit addresses/openess. Valid for an 8-bit machine and in fact even the Amiga OS libs worked exactly the same way.Only the root pointer to each libs was dynamic. Within every libs relative jump tables were used.# My thoughts were just too much into modern linkers and FJC's use case with the GUI. Edited January 28, 2015 by JAC! Quote Link to comment Share on other sites More sharing options...
mono Posted January 29, 2015 Share Posted January 29, 2015 Ok. Sorry for misunderstanding 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.