64tass assembler peculiarity
64tass assembler peculiarity
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?
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?
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 64tass assembler peculiarity
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?
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?
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: 64tass assembler peculiarity
BigDumbDinosaur wrote:
What is the exact diagnostic being emitted by the assembler?
.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?
Re: 64tass assembler peculiarity
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
Re: 64tass assembler peculiarity
Vladimir wrote:
BigDumbDinosaur wrote:
What is the exact diagnostic being emitted by the assembler?
.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?
Mind, this is all a guess. I've not used the software.
Re: 64tass assembler peculiarity
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.
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.
Re: 64tass assembler peculiarity
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
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
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 64tass assembler peculiarity
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!
Re: 64tass assembler peculiarity
BDD, what assembler would you recommend that best adhered to the standard. I still haven't settled on an assembler yet.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: 64tass assembler peculiarity
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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: 64tass assembler peculiarity
Quote:
That would be good information to add to the "assemblers" portion of my links page, at http://wilsonminesco.com/links.html#assem .
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: 64tass assembler peculiarity
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.
Mike B.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: 64tass assembler peculiarity
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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: 64tass assembler peculiarity
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.
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.
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 64tass assembler peculiarity
Dan Moos wrote:
BDD, what assembler would you recommend that best adhered to the standard. I still haven't settled on an assembler yet.
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 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!