A85: Re: Re: What am I doing wrong?


[Prev][Next][Index][Thread]

A85: Re: Re: What am I doing wrong?




Hello,

> In usgard, programs are not always run from the same location in memory
> (like most other ti-xx assembly shells), so every time an '&' is used, an
> offset byte (or possibly word) from the last '&' is inserted into the code.
> This means that for each of these .dw's, there is actually 3 bytes used.
> I'm not sure how this is affecting your code (as i didn't really look), but
> that should get you on the right track.  You may want to look through the
> memory of this area of code to see exactly what is there.
> 
> -mike pearce

Yes, Usgard really does some weird things with that relocation, but not what you think - it would crash all your programs. Think about it, a random byte (random for Z80) after each and every absolute call (or jump) in your program! Cool, huh? :-) And those calls (and jumps) are mostly IN your program, not out of it i.e. to the shell's code (the shell could modify the return address so that it points at the byte following the extra byte - and as I believe, that's exacatly how ZShell handles it's ROM-calls ). 

Yes, [I believe] Usgard's string85.exe does add its relocation table to the program, but it adds it probably to the end of the program...

I know that... one shouldn't post to a list if one isn't absolutely  sure about one's opinions. Let's see if I've embarrassed myself badly... :-)

BTW, I'd like to know if I've understood Usgard's relocation scheme and ZShell's ROM-calls correctly, please correct me if I'm wrong. 

And to the original question:

Maybe the problem is in  ".dw &xxxx+nn" part of your code. Try to arrange your labels so that you only need to write ".dw &yyyy". Please tell if that works...

Henri Moilanen




Follow-Ups: References: