Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nrossi From: nrossi@jarthur.Claremont.EDU (Nick Rossi) Newsgroups: comp.sys.cbm Subject: Re: HELP: Assembly - Address Maintenance for code overlaying Message-ID: <10066@jarthur.Claremont.EDU> Date: 10 Dec 90 20:28:27 GMT References: <2373.27637c31@iccgcc.decnet.ab.com> Organization: Harvey Mudd College, Claremont, CA 91711 Lines: 24 In article <2373.27637c31@iccgcc.decnet.ab.com> lockemer@iccgcc.decnet.ab.com writes: >I am writing a program in assembly which will need to load different sections >of code into the same areas of memory. These sections will have multiple >routines in them. Does anyone have any suggestions/tricks/tips on how to access >the routines from the main code (such as using labels somehow) so that I do not >have to manually keep track of where each routine ends up any time it is >reassembled? I am writing this on a 128 using MERLIN 128. A related question is >how do I do the same thing if I want to have routines in other bank >configurations? Thanks... > >Todd Lockemer The standard way to do this is to include a jump table at the start of the memory area where your routines are located. Then, all of your calls to the machine language from basic will be offsets from the start of the memory area in multiples of three bytes. I always define a variable like ML to equal the start of the memory area (such as ML = 49152), and then the calls to routines become SYSML, SYSML+3, SYSML+6, SYSML+9, etc. ----------------------------------------------- Nick Rossi, '93 | "That's nasty, Wyatt..." Harvey Mudd College | "That's Chet, Gary!" -----------------------------------------------