RDROYA01@ULKYVX.BITNET.UUCP (07/12/86)
The addresses in the background module are absolute because on my system everything in the O/S is absolute. Even the bios is linked in at an absolute address, a real pain. But I think you can overcome this problem on a relocatable system with a little work. First some labels My module CPMLIB Offset from cpm (in CPMLIB) ========================================================= _ccpmain _main $1f4a log_dsk _log_dsk $79a2 ssp stack $617e [this is in the revised sources] dmaddr [none] wherever your bios stores the current dma address Where to put the code. I think it could be linked into the bios in a relocatable system. You will need to arrange for the caller to pass the address of an output routine (_outchar in mine) and the address of the program's base page (*_base in 'C' progs) to the trap #1 handler. It would then store those addresses until needed. It would resize the tpa so that h_tpa was $100-$200 less than base, and later load the address of the supplied output routine into an address register, e.g. into a0, and jsr (a0) instead of jsr _outchar. This would also allow any program you write to work although two programs calling trap #1 at once would surely bomb since it assumes one to be the controller and the other a parasite. This really was written to be part of the editor. Another alternative is to use the offsets above to discover the relative addresses of the presently equated values. This would work if your system allows a user program to find the location of the O/S. For instance the CPMLIB _traphnd (trap #2 handler) is $228 above _main. If you know the trap handler's address or if you know the address of the cpm module, then you can calculate the absolute addresses needed. BTW: currently, I am back into xLisp. I'd like to set it up to run in tandem with the editor so I can add some GNU_MOCK_LISP type functions to my system. Does anyone have any experience with Mock Liasp and Xlisp who can point out potential gotcha's? It looks like Mock is closer to Franz than to Common Lisp. Is this correct? ATTENTION: R. Heller, I emailed a newer source file that explains some of this direct to you but got back some errors on the mail attempt. Did you ever receive? I'll go ahead and post the new sources to the net as they deal quite well with the disk change, disk logging, and dma buffer problems I had earlier. Still hacking away, Robert Royar rdroya01@ulkyvx.bitnet