stardot / beebasm

A portable 6502 assembler with BBC Micro style syntax
http://www.retrosoftware.co.uk/wiki/index.php/BeebAsm
GNU General Public License v3.0
83 stars 26 forks source link

PUTBASIC and ! or pling command does not tokenise correctly onto disk. #64

Closed mikroman closed 2 years ago

ZornsLemma commented 2 years ago

Hi mikroman,

Which version of beebasm are you using? I'm not aware of any changes in this area recently but it might be worth trying a version built from the proposed-updates branch (https://github.com/stardot/beebasm/tree/proposed-updates) and/or the lhs-token-fix branch (https://github.com/stardot/beebasm/tree/ZornsLemma/lhs-token-fix).

Do you have a test case which shows the problem? ! does seem to tokenise correctly in at least some cases (e.g. https://github.com/stardot/beebasm/blob/ZornsLemma/lhs-token-fix/test/3-directives/basiclhstoken.bas). If you can attach a test case to this issue I'll see if I can work out what's going wrong.

Cheers.

Steve

mikroman commented 2 years ago

Premature with this issue. I have just realized that it does work. I have found that some BASIC programs seem to behave oddly when encountered and fail. I have to find the two programs that fail and the two that work. I will get back to you.

mikroman commented 2 years ago

In one case I replaced the pling with four "POKES" instead. The program worked correctly from then on. so.... Version 4.17 btw

mikroman commented 2 years ago

Example #1 PLANET1.txt Line 910 !&80=TIME EORRND was replaced by 920 ?&80=206 930 ?&81=173 940 ?&82=2 950 ?&83=45

Because one of the four: the pling, time or eor or rnd is not functioning correctly.

ZornsLemma commented 2 years ago

Thanks, I can reproduce that failure with v1.09. I think you are being hit by https://github.com/stardot/beebasm/issues/45, which is fixed on the proposed-updates branch.

There is a similar BASIC tokenisation bug (https://github.com/stardot/beebasm/issues/63) which I recently fixed on the ZornsLemma/lhs-token-fix branch - that includes all the proposed-updates changes as well, so that's probably your best bet at this point.

Please give one of those branches a try and let me know how you get on. I've tried both of them and they both tokenise your line 910 correctly.

mikroman commented 2 years ago

Wow, thanks for your effort. Greatly appreciated. I will look and test some more.

mikroman commented 2 years ago

That branch requires a build of the program which I'm not set up to do. My C is definitely not sharp. I could use an executable if you could make that possible.

ZornsLemma commented 2 years ago

I'm assume you're looking for a Windows executable? Unfortunately I don't use that myself so I can't help. If you post over on the beebasm thread at stardot someone else will probably be able to help out though. (I'm guessing you're mikroman_3526 over there?)

(If you're on Linux on x86-64 I can build you an executable, but I suspect that's no help.)

mikroman commented 2 years ago

OK. No prob. I did find some help in that area I am happy to report that I resolved my issue. This line needed a space between the (?&276b and MOD16) 370 PROCADJUST(1,(?&276B MOD16)+10*(?&276B DIV16),2,"SHIPS PER GAME",99,1,1):?&276B=EVAL("&"+STR$(R%))

mikroman commented 2 years ago

I'm assume you're looking for a Windows executable? Unfortunately I don't use that myself so I can't help. If you post over on the beebasm thread at stardot someone else will probably be able to help out though. (I'm guessing you're mikroman_3526 over there?)

(If you're on Linux on x86-64 I can build you an executable, but I suspect that's no help.)

I am mikroman_3526

ZornsLemma commented 2 years ago

Thanks, I'm glad it worked!

I think the need for a space before "MOD" is a bug; I don't know how easy it will be to fix (I haven't even tried yet; I half hope someone else will take a look before I get round to it :-) ) but I've raised https://github.com/stardot/beebasm/issues/65 for this anyway so it doesn't get forgotten.

If you're happy the "pling" issue is fixed, please close this issue.