Joined: Fri Aug 30, 2002 1:09 am Posts: 8545 Location: Southern California
|
Welcome.
I hardly know anything about linkers. I used one 30+ years ago, but with a batch file set up by someone else (who initially had a lot of trouble getting it going), and I modified it from the templates for different projects without really understanding it.
However, even without a linker, I can imagine a few ways to do it. Does your assembler produce a symbol table at the end of the list (.lst) file that you could copy and paste into the new source code that will be used for RAM-resident program material, even if you then finish up with a search-and-replace-all to change them all into EQUates (constants)?
Again without a linker, you could have your various files, with your main file calling the one for the ROM source code by using an INCL (include) line, and then sending only the portion of the output file that is to be RAM-resident out to your target computer over the serial port.
I understand many of the home computers of yesteryear had jump tables of system entry points. The positions in the tables were fixed; but these pointed to the system entry points, so if the manufacturer modified the system in later versions to fix bugs or add features, the contents of the table would reflect the new addresses but the user didn't have to concern himself with that because the tables' starting addresses didn't change and the index into the table for getting the address of the desired system entry point didn't change.
From WDC's excellent programming manual which I can never pass up an opportunity to recommend, "Programming the 65816, Including the 6502, 65C02 and 65802," chapter 12, and page 190:
Apple Computer's ProDOS operating system takes this method a step further: all operating system routines are called via a JSR to a single ProDOS entry point. One of the parameters that follow the JSR specifies the routine to be called, the second parameter specifies the address of the routine's parameter block. This method allows the entry points of the internal ProDOS routines to "float" from one version of ProDOS to the next; user programs don't need to know where any given routine is located. These last two paragraphs are from the "Synthesizing instructions with RTS, RTI, and JSR" page of my treatise on 6502 stacks (plural, not just the page-1 hardware stack), and there's a little more about it there.
For my workbench computer, although I can assemble code on the PC and send it over the serial line as an Intel Hex file, I have not done it that way in many years. The workbench computer has Forth in ROM, and I send source-code text over the serial link, which gets compiled, assembled, or executed, as appropriate, on the fly (described in the linked page). Forth entry points in ROM are found by their headers, and approximately 24 assembly-language ones are in a table of constants I compile at the beginning of a project so the onboard assembler has the needed addresses to look up by name, for example JMP POP2-TRUE , . The incremental compilation and assembly makes for an interactive development with immediate turn-around time between writing a piece of code and trying it out, without having to re-compile or re-assemble any of the previous underlying code.
_________________ http://WilsonMinesCo.com/ lots of 6502 resources The "second front page" is http://wilsonminesco.com/links.html . What's an additional VIA among friends, anyhow?
|
|