<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 13 Nov 2011 08:44:24 +0100
From   : rick@... (Rick Murray)
Subject: Assembling large files

Hi, while one *could* argue BBC stuff is relevant to 
comp.sys.acorn.misc, this seemed like a more logical place, so I've 
moved it here.

Full quote for context for those not also reading csam:

On 12/11/2011 12:57, jgharston wrote:
> Rick Murray wrote:
>> JGH - purely out of interest, how did you coax the BASIC assembler to
>> assemble from a file instead of code held in memory?
>
> Intercept OSWORD 0 to feed a slightly processed version of
> each line from the input file. I've lost the source and
> still haven't yet got around to recreating it :)
>
> Essentially, it monitors for an opening [ or>, once it sees
> an [ it then prepends every input line with OPT0: until end
> of file. It then resets PTR and does a second pass prepending
> with OPT3:. A line starting with>  links to another file so
> you can have, eg:
>
> REM>  Part1
> OSWORD=&FFF1:etc
> O%=whatever:P%=whatever, etc
> [
> etc
> ]
>> Part2
>
> REM>  Part2
> blah blah
> [
> more etc
> ]
>
> See http://mdfs.net/Software/HADFS/Source/ for a
> sample large project.
>
> JGH

This leads to my second question - given that you are assembling outside 
of BASIC's usual method, plus the ability to include other files 
(nifty!), how do you resolve memory references so labels point to the 
correct address?

I was surprised, actually, by how small the ASSEM program is.


Best wishes,

Rick.

-- 
Rick Murray, eeePC901 & ADSL WiFI'd into it, all ETLAs!
BBC B: DNFS, 2 x 5.25" floppies, EPROM prog, Acorn TTX
E01S FileStore, A3000/A5000/RiscPC/various PCs/blahblah...
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>