6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Nov 11, 2024 6:51 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Apr 20, 2016 6:14 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
I thought I would mess around with compiling my own version of MS BASIC going off of this page:

http://www.pagetable.com/?p=46

When I try to compile (Windows 10), I get these errors:

Code:
> c:\tmp\cc65\bin\ca65.exe -D microtan msbasic.s -o c:\tmp\microtan.o

memory.s(139): Error: Range error (-9 not in [0..255])
inline.s(118): Error: Unexpected trailing garbage characters
inline.s(133): Error: Unexpected trailing garbage characters
poke.s(118): Error: Unexpected trailing garbage characters
float.s(777): Error: Range error (-4 not in [0..255])
float.s(1451): Error: Range error (-9 not in [0..255])
init.s(85): Error: Unexpected trailing garbage characters
init.s(443): Error: Unexpected trailing garbage characters




Apparently, I'm not the only one according to an Ubuntu user.

I'm more familiar with KickAssembler and never really worked with CC65.

Any suggestions on what I need to do? I haven't altered anything.

Thanks

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 20, 2016 7:07 pm 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 284
cbmeeks wrote:
I thought I would mess around with compiling my own version of MS BASIC going off of this page:

http://www.pagetable.com/?p=46

When I try to compile (Windows 10), I get these errors:

Code:
> c:\tmp\cc65\bin\ca65.exe -D microtan msbasic.s -o c:\tmp\microtan.o

memory.s(139): Error: Range error (-9 not in [0..255])
inline.s(118): Error: Unexpected trailing garbage characters
inline.s(133): Error: Unexpected trailing garbage characters
poke.s(118): Error: Unexpected trailing garbage characters
float.s(777): Error: Range error (-4 not in [0..255])
float.s(1451): Error: Range error (-9 not in [0..255])
init.s(85): Error: Unexpected trailing garbage characters
init.s(443): Error: Unexpected trailing garbage characters




Apparently, I'm not the only one according to an Ubuntu user.

I'm more familiar with KickAssembler and never really worked with CC65.

Any suggestions on what I need to do? I haven't altered anything.

Thanks


Maybe microtan needs to be in uppercase?

Also, the instructions indicate that there is more involved than just running ca65 on the file msbasic.s:

Quote:
First duplicate one of the cfg files, and add it to make.sh. cbmbasic2 is a good start, as you can quite easily test the resulting images in the VICE emulator – CC65 can even provide symbol information for the VICE debugger. Add a case in defines.s to define one of CBM1, CBM2, APPLE etc., because you need one flavour of platform specific code, and include your own defines_*.s. For Commodore BASIC, you also need to define CONFIG_CBM_ALL.



Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 20, 2016 7:11 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
Those instructions, from what I can tell, are for creating your own version.

They also say to run the make.sh script. Since I'm on Windows, I just translated one of the commands and arbitrarily picked microtan. I also tried cbmbasic1.

I tried it in uppercase but it made no difference.

make.sh:

Code:
if [ ! -d tmp ]; then
   mkdir tmp
fi

for i in cbmbasic1 cbmbasic2 kbdbasic osi kb9 applesoft microtan; do

echo $i
ca65 -D $i msbasic.s -o tmp/$i.o &&
ld65 -C $i.cfg tmp/$i.o -o tmp/$i.bin -Ln tmp/$i.lbl

done




** EDIT **

One easy fix is that it doesn't like the C style comments "/*...*/". So changing them to ";" removes those errors.


** EDIT 2 **

ca65 is clearly failing on assembling negative numbers. One of the examples is:

Code:
        lda     #-9


I would have no idea what to put there instead. I'm not sure what the original intent was.

My assumption is that I could translate that to binary instead (%1111_0111) but not sure what to do on this one:

Code:
        ldx     #TEMP1-FAC+1


It's evaluating to -9 as well.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 20, 2016 8:26 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Just adding 256 should sort out these negative numbers. The original code will have expected them to wrap within a byte-sized value.
Example: -1 is intended to be $ff. 256-1 or -1+256 is 255, which is $ff.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 20, 2016 8:28 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
Duh.

That seemed to do the trick.

I changed one to

Code:
        ldx     #-MANTISSA_BYTES + 256


and it worked.

Thanks!

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: rudla.kudla and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: