6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 8:22 pm

All times are UTC




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Fri Mar 31, 2017 2:56 am 
Offline

Joined: Wed Jul 20, 2016 2:14 am
Posts: 78
Location: Irkutsk, Russia
Hi.
I tried to assemble EhBASIC with 64tass assembler.
The source was taken on the https://github.com/Klaus2m5/6502_EhBASI ... /basic.asm
BTW, I am very novice user of 64tass (or, I'm trying to become a user).
As it usually happens, I got a bunch of errors, basically in .BYTE directives, because, in accordance with the manual, 64tass does not expects here any multi character strings.
Well, I can use .TEXT instead which accepts strings of any length. But, I was surprised that not every multi character string causes an error. For example,
line 8230 .byte "XP(",TK_EXP ; EXP( gives an error, but
line 8212 .byte "EEK(",TK_DEEK ; DEEK( causes no error.
I can not understand why this is so. Does anyone know this?


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 31, 2017 5:04 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8513
Location: Midwestern USA
Vladimir wrote:
Hi.
I tried to assemble EhBASIC with 64tass assembler.
The source was taken on the https://github.com/Klaus2m5/6502_EhBASI ... /basic.asm
BTW, I am very novice user of 64tass (or, I'm trying to become a user).
As it usually happens, I got a bunch of errors, basically in .BYTE directives, because, in accordance with the manual, 64tass does not expects here any multi character strings.
Well, I can use .TEXT instead which accepts strings of any length. But, I was surprised that not every multi character string causes an error. For example,
line 8230 .byte "XP(",TK_EXP ; EXP( gives an error, but
line 8212 .byte "EEK(",TK_DEEK ; DEEK( causes no error.
I can not understand why this is so. Does anyone know this?

Could you please be more explicit than "gives an error?" What is the exact diagnostic being emitted by the assembler?

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 31, 2017 3:17 pm 
Offline

Joined: Wed Jul 20, 2016 2:14 am
Posts: 78
Location: Irkutsk, Russia
BigDumbDinosaur wrote:
What is the exact diagnostic being emitted by the assembler?


8230:8 error: can't convert to a 8 bit unsigned integer '"XP("'
.byte "XP(",TK_XP ; EXP(
8236:8 error: can't convert to a 8 bit unsigned integer '"OR"'
.byte "OR",TK_FOR ; FOR
8238.....
8242.....
8244.....
and so on...

This error is clear to me. Another is unclear, some similar lines do not make errors, for example:

8218 .byte "OKE",TK_DOKE ; DOKE note - "DOKE" must come before "DO"
8224 .byte "LSE",TK_ELSE ; ELSE
8226 .byte "ND",TK_END ; END
.........
.........
Why? What is the difference?


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 31, 2017 3:58 pm 
Offline

Joined: Sat Jul 28, 2012 11:41 am
Posts: 442
Location: Wiesbaden, Germany
Every assembler has its own disease. It would be interesting, if the working .byte directives produce correct object code. On the other hand if the documentation says that something isn't working it doesn't guarantee that it is not working all of the time.

_________________
6502 sources on GitHub: https://github.com/Klaus2m5


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 31, 2017 4:38 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
Vladimir wrote:
BigDumbDinosaur wrote:
What is the exact diagnostic being emitted by the assembler?


8230:8 error: can't convert to a 8 bit unsigned integer '"XP("'
.byte "XP(",TK_XP ; EXP(
8236:8 error: can't convert to a 8 bit unsigned integer '"OR"'
.byte "OR",TK_FOR ; FOR
8238.....
8242.....
8244.....
and so on...

This error is clear to me. Another is unclear, some similar lines do not make errors, for example:

8218 .byte "OKE",TK_DOKE ; DOKE note - "DOKE" must come before "DO"
8224 .byte "LSE",TK_ELSE ; ELSE
8226 .byte "ND",TK_END ; END
.........
.........
Why? What is the difference?


For whatever reason, it's ignoring your " marks. When it sees X, it's thinking that you're presenting a HEX number, and P( is not a valid HEX string. Similarly, with OR, it sees the O and probably thinks that it's an Octal number, and R is not a valid octal digit.

Mind, this is all a guess. I've not used the software.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 31, 2017 7:25 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
If I understand the ehbasic source correctly, there .byte "ABCD" is used to reserve/allocate 4 bytes of memory.
64tass ref manual allows .byte <expression>{,<expression} to reserve multiple bytes in one line.
But "string" is not a valid expression me thinks.

You can verify this: how many bytes in those lines where 64tass does not report an error are reserved? (compare the PC values) - I assume it increments by one for the string and by one for the token.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 31, 2017 8:36 pm 
Offline
User avatar

Joined: Fri Mar 31, 2017 7:52 pm
Posts: 45
I've been working with 64tass a lot lately. I've had to replace most .byte directives in sample codes with .text directives.

It is actually pretty powerful once you get used to it because of some variation.

.null "text" will compile to the byte values followed by a $0 (null), so you don't have to use .text "text",0

.ptext "text" puts a character count in front, so you don't have to use .text 4,"text"

64tass has its quirks, but is the one I eventually gravitated to because it is straight forward to build a ROM image with.

Thanks,
Jim W4JBM


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 31, 2017 9:41 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8513
Location: Midwestern USA
TASS is yet another example of an assembler written by someone who evidently didn't know that, at least in the 6502 universe, a standard does exist for the assembly language.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 01, 2017 1:37 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
BDD, what assembler would you recommend that best adhered to the standard. I still haven't settled on an assembler yet.


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 01, 2017 2:06 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
That would be good information to add to the "assemblers" portion of my links page, at http://wilsonminesco.com/links.html#assem .

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 01, 2017 2:21 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
Quote:
That would be good information to add to the "assemblers" portion of my links page, at http://wilsonminesco.com/links.html#assem .


Agree whole heartedly. As a newbie, that list was a good start, but I needed more guidance! I'm trying to settle on an assembler to stick with for a spell, and want to be sure I'm learning the standard way of doing things, not some almost right assembler's quirks. I'm sure after a while I can re-evaluate and find that a quirky one will be what I want, but untill then...


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 01, 2017 3:34 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
BigDumbDinosaur wrote:
TASS is yet another example of an assembler written by someone who evidently didn't know that, at least in the 6502 universe, a standard does exist for the assembly language.

... or maybe he or she knew, but decided to follow a more unique path, for any reason under the Sun. You must be aware that variety is the spice of life, BDD!

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 01, 2017 4:02 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Dan, does it need to be free, or would you be willing to pay for a good one? I'm not sure paying is necessary to get a good one that has rather standard operation, but at least it's not like Windows which you kind or 'rent.' I bought Cross-32 (C32 for short) from Universal Cross Assemblers over 20 years ago; and although as an intensive user I find bugs in everything, I have not been sorry. It's still $99, even though that's quite a bit less money now than it was back then, and it assembles for lots of different processors, and gives you the tools to make the tables for new processors too, meaning you could design your own processor and have a nice macro assembler for it. I've used it for 65c02 and 65816, and have enjoyed freedoms it gives that many others apparently don't, if I am to believe what I see in others' code written for free assemblers.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 01, 2017 4:32 am 
Offline

Joined: Sat Mar 11, 2017 1:56 am
Posts: 276
Location: Lynden, WA
I'd be willing to pay once I am far enough along to make an experience informed decision. $99 is a bit steep for me, because I really don't know what I want/need.

What I THINK I want/need is an assembler who's syntax (other than the mnemonics, which I hope are exactly the same in every 6502 assembler) is as standard as one could hope for. As I learn, I'm discovering that maybe there isn't a hard standard, so I'm lightening up my expectations there. I want a tool I can learn with, and hopefully keep using as I get more proficient.

ACME has worked well for my simple fledgling needs, and maybe it fills the bill for my admittedly poorly informed desires.


Top
 Profile  
Reply with quote  
PostPosted: Sat Apr 01, 2017 4:39 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8513
Location: Midwestern USA
Dan Moos wrote:
BDD, what assembler would you recommend that best adhered to the standard. I still haven't settled on an assembler yet.

Two assemblers I recommend are André Fachat's xa65 cross-assembler (documentation right here) and Andrew Jacobs' Java-powered cross-assembler. Both assemblers support the MOS Technology assembly language syntax standard and generate code for NMOS 6502s, 65C02 and 65C816. They are free for the downloading.

André's assembler is very comprehensive and runs on 64 bit Linux (I've tested it on one of my Linux machines). I don't know if the source can be compiled on a Windows box but I do know André originally developed it on an Atari ST (MC68000 system) and was able to compile the source code as written on Linux.

Andrew's assembler should be able to run on any machine that has the Java run-time installed. He was able to assemble my Supermon 816 program on it, which means it fully understands the 65C816 in native mode.

Use your favorite text editor with either assembler (I use UltraEdit, which while not free as in free beer, is tailor-made for software development).

Quote:
As I learn, I'm discovering that maybe there isn't a hard standard...

The definitive form of the 6502 assembly language is that published by MOS Technology c. 1975. The WDC standard is the MOS Technology standard with additions to cover the 65C816/65C802, primarily in the areas of immediate mode addressing. So there really is a standard for the assembly language itself.

The one place where the standard does not apply is pseudo-operations (assembler directives), such as .byte or .word. Assembler developers are free to conjure whatever pseudo-ops they wish. However, most good assemblers use pseudo-ops that are or resemble those published by MOS Technology.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 63 guests


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: