beebasm putbasic problem

Development tools discussion area.
User avatar
sydney
Posts: 1967
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne

beebasm putbasic problem

Postby sydney » Mon Aug 28, 2017 2:13 pm

Every time I try to use PUTBASIC, even with a very simple source and BASIC file, I get the following error:

Code: Select all

Error: test.bas: Unspecified file error.


My source file (test.asm) is:

Code: Select all

PUTBASIC "test.bas", "test"


My BASIC file (test.bas) is:

Code: Select all

10PRINT"SYD CANT CODE"
GOTO10


and my command line is:

Code: Select all

beebasm -i test.asm -do test.ssd


I'm running linux mint 18.1 and I'm pretty sure I'm running an up to date version of beebasm, it reports beebasm 1.08.
I can INCBIN and INCLUDE files with no problems. What am I doing wrong?

User avatar
ctr
Posts: 93
Joined: Wed Jul 16, 2014 2:53 pm

Re: beebasm putbasic problem

Postby ctr » Mon Aug 28, 2017 2:29 pm

You can't omit the line numbers in your basic code. This is a nuisance.

User avatar
sydney
Posts: 1967
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne

Re: beebasm putbasic problem

Postby sydney » Mon Aug 28, 2017 2:48 pm

So so simple! :lol:

I'm sure I'd read line numbers were optional. Thanks for the quick answer.

User avatar
ctr
Posts: 93
Joined: Wed Jul 16, 2014 2:53 pm

Re: beebasm putbasic problem

Postby ctr » Mon Aug 28, 2017 3:40 pm

sydney wrote:I'm sure I'd read line numbers were optional.

That rang a bell so I had another look. Github has a bunch of proposed updates including automatic line numbering. Stardot has a thread about it.

User avatar
tricky
Posts: 1816
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: beebasm putbasic problem

Postby tricky » Mon Aug 28, 2017 6:47 pm

The one that catches me out, is no abbreviations.
P. bad
PRINT good

User avatar
Rich Talbot-Watkins
Posts: 1089
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: beebasm putbasic problem

Postby Rich Talbot-Watkins » Mon Aug 28, 2017 7:20 pm

jsbeeb's BASIC tokeniser actually uses the BASIC 4 ROM code to tokenise lines! As in: it creates a fake Beeb, puts the ASCII string into the right place in memory, sets up the necessary zero page, and then emulates the ROM call until it exits.

https://github.com/mattgodbolt/jsbeeb/b ... okenise.js

That kind of approach would of course work perfectly for BeebAsm, were it to have a full 6502 emulation engine inside (something I had considered at some point, in order to get decent subroutine timing information).

SteveF
Posts: 429
Joined: Fri Aug 28, 2015 8:34 pm

Re: beebasm putbasic problem

Postby SteveF » Mon Aug 28, 2017 9:14 pm

Well it's not the swanky approach suggested by Rich, but here's a quick-ish hack to add support for BASIC abbreviations. I *think* this is equivalent to the proposed-updates branch in Tom's repo plus this change, but frankly I'm not entirely sure...

https://github.com/ZornsLemma/beebasm/t ... eviations2

Fair warning: I have only given this the most cursory testing. Let me know how you get on if you try it...

User avatar
simonm
Posts: 164
Joined: Mon May 09, 2016 2:40 pm
Contact:

Re: beebasm putbasic problem

Postby simonm » Wed Aug 30, 2017 7:46 pm

Im reminded that it would be great to get a BeebAsm repo going in the stardot team; it's such a useful tool and there's a number of useful patches around now.

User avatar
kieranhj
Posts: 484
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK

Re: beebasm putbasic problem

Postby kieranhj » Thu Aug 31, 2017 6:01 pm

simonm wrote:Im reminded that it would be great to get a BeebAsm repo going in the stardot team; it's such a useful tool and there's a number of useful patches around now.

Indeed. And we never got to the bottom of the Teletextr bug when I was getting different behaviour at runtime whilst using a locally built binary from one of the branches.

SteveF
Posts: 429
Joined: Fri Aug 28, 2015 8:34 pm

Re: beebasm putbasic problem

Postby SteveF » Thu Aug 31, 2017 8:59 pm

kieranhj wrote:
simonm wrote:Im reminded that it would be great to get a BeebAsm repo going in the stardot team; it's such a useful tool and there's a number of useful patches around now.

Indeed. And we never got to the bottom of the Teletextr bug when I was getting different behaviour at runtime whilst using a locally built binary from one of the branches.

My best guess here would be that you were running into one of the bugs documented in the RetroSoftware thread here: http://www.retrosoftware.co.uk/forum/vi ... 57ff9c9a9a The very last post in that series mentions a bug I introduced while fixing an earlier bug which caused assembly to succeed but generate invalid output, rather than fail with a mysterious/incorrect error.

But it's just a guess, of course. As far as I know the latest proposed-updates version has no bugs in this area; if you do manage to reproduce this behaviour with the latest build let me know and I'll take a look...

Cheers.

Steve


Return to “development tools”

Who is online

Users browsing this forum: No registered users and 1 guest