I'm dredging my memory, but back in the '80s this problem was "solved" by a pseudo-instruction, LDAZ, meaning load zero-page. I wrote an assembler myself for the 6502 back in the 1980's, and I seem to recall this is how I did it. I don't think there's a reliable way of deducing whether a zero-page instruction is appropriate otherwise.
On Friday 15 March 2013 22:27:49 Masur Jonathan wrote: > Hello everyone, > > Without much surprise, I am unable to do contribute to SDCC during my > free time. > > My plan is now to attempt to get, with my master project next year > (2014), a project where I'll do a 6502 and 65C816 port of SDCC, along > with some hardware simulation of both processors in order to run program > compiled by them. Hopefully there will be some professor that will > accept such a project. (as they are typically more into research for > next generation CPUs than old '80s CPUs...) > > For now I'm just taking more advanced CS courses in order to be ready > for the task, and I'll have to try to study SDCC as much as possible > before next year. > > What is strange is that I see an "AS6500" port in the documentation, but > nowhere else. This is really strange, as I don't see where this comes from. > There is already dozen of free-ware 6502 and 65C816 assemblers available > around, but for the sake of consistency, I think it'd be nice to port > SDAS and SDLD for the 6502 and 65C816, and this should be rather > straightforward. > (I already wrote some kind of tiny assembler in java once (for a > completely unrelated project) and it is only about 800 lines, and just > took me a couple of days to write, all from scratch) > > But if someone already did the porting I don't want to re-invent the wheel. > > A problem I see for the linker is that it's not possible to know code > size in advance, unless you know which variables are zero-page in > advance. Many assemblers resolves this in a dirty way, but the official > 6502 standard mentions clearly that the following syntax : > > lda myvariable > > could be both a zero-page and non-zeropage instruction. If the assembly > files are compiled separately and that myvariable is an extern variable, > it's impossible to know if it's zero-page and that will be a problem for > the linker. > > Sorry for the long post, and thanks in advance for advice, > Jonathan Masur > > --------------------------------------------------------------------------- > --- Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_mar > _______________________________________________ > Sdcc-user mailing list > Sdcc-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sdcc-user -- Richard. PGP Key-id: 0x5AB3D350 Broad-mindedness, n.: The result of flattening high-mindedness out. ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user