I suppose, if I'm going to continue hammering (my head) on this, I should move my source over to linux from risc os.
It is possible that the risc os ZMAC builds broken binaries somehow. It looks fine in a hex dump, but the #wp2 has a large amount of magic and bs around it.

I know linux ZMAC can produce working wp2 binaries.

#zMac #linux #riscos

update:
Binaries generated by RISC OS ZMAC and Linux ZMAC are identical! That's not the issue.

I think I've discovered part of the problem with running/not running binaries:
I changed my program so that the non-initialized data space come *after* PRGEND and reassembled
and now the program runs.

So I think maybe the WP2 doesn't like binaries that end in a long string of NULLS, even if followed by a ^Z.

int2hex() is doing something really really weird but hey one bug at a time.

Success!!!
I'm not sure the clone #z80 in the #wp2 groks "ld bc,(address)" which is a properly z80 thing to say.
Changed it to "ld hl, (address)
ld b,h
ld c,l" and it worked.

I have now confirmed that the stack is *below* the program area of 0xAC00-0xFFFF.
The techref says the stack area is from 0xA800 to 0xABFF which shows once again 5 minutes of RTFM can save hours of WTF. :-)
OTOH trusting Tandy docs? Not a good plan. <shrug>

BTW the stack at the point when my binary was called?
0xABF6

I'm proud of that number. I spent enough work getting to it!

I have a number of *ancient* 8080 programs that were ported to CP/M and then abandoned in the CPMUG disks to die. Some of them would be... almost useful on a WP2. There's an intriguing calculator, and several small BASICs, and of course my personal obsession, FOCAL.

Any of them (even FOCAL) would be a step up from what's now available, which is nothin.

Not that I've got the time, but it's fun to think about. And this question had me roadblocked.

#wp2 #CPM #CPMUG #8080

@goosey does the WP-2 CamelForth work for you?

http://bitchin100.com/files/wp2/CAMEL.ZIP

@millihertz
It does!
I have the older wp2 so it needs the display bug fix
I'm afriad I don't know forth beyond 1 1 + .