Looking at the 64tass manual, a [$xxxx] can be a long indirect which is not what you wanted. Of course a ($xxxx) can be an indirect which isn't what you want either, but they can also set order of operation. I think since the *2 is outside the () it will be used to set order of operation.
You can assemble with a listing file. I would do that and see what the actual bytes that line of code generates--that will tell you how it behaved and then you can decide if that's how you think it should have behaved.
Bottom line is that I think you are okay.
Glad you found min_mon. I wasn't sure if that was part of the EhBasic package or something that someone else added. I've been focused on OSI 6 digit basic and had set EhBasic to the side but plan to pick it up again soon. I got bogged down in expanding the monitor portion to something more powerful. At this point I'm thinking I'll a single EPROM that I'll page with OSI basic, EhBasic, the expanded monitor and then something yet to be determined.
You might want to consider converting the min_mon that comes with Symon, assembling the whole thing, and seeing if it working in Symon. If it does, then you only need to modify min_mon to fit the IO on your system.
Jim
64tass assembler peculiarity
Re: 64tass assembler peculiarity
Vladimir wrote:
BTW, I replaced the square brackets with parentheses.
The first error disappeared. Has it affected anything else, God knows.
What should mean square brackets there?
Code: Select all
CMP #(TK_TAB-$80)*2 ; compare normalised token * 2 with TABWhat should mean square brackets there?
Quote:
ERROR E017: Missing constant value (number, label, function or '*'). ROW 1562, FILE D:\Elektronik\6502\ehbasic\high ROM test\basic.asm
6502 sources on GitHub: https://github.com/Klaus2m5
Re: 64tass assembler peculiarity
jim30109 wrote:
Looking at the 64tass manual, a [$xxxx] can be a long indirect which is not what you wanted. Of course a ($xxxx) can be an indirect ...
jim30109 wrote:
...Glad you found min_mon. I wasn't sure if that was part of the EhBasic package or something that someone else added....
To run the BASIC on a real machine, you need an environment, system routines. If you are trying to run EhBASIC using Michal Kowalski's 6502 simulator then you need to use min_mon as simulation of such environment. The procedure is described in the manual.
In addition, min_mon.asm has a second and, perhaps, more important mission. It is an example, the study of this file is necessary in order to understand how to correctly install the BASIC on a real machine. But, in this case, min_mon should be replaced with a real OS.
For now, I ran out of questions, everything became more or less clear.
Thank you, Kameraden
Re: 64tass assembler peculiarity
Sorry for digging up this old thread. While there were plenty of unclear points they were mostly sorted so I don't want to address everything unless someone asks for a clarification.
There's one misunderstanding however which bothered me for years. Worse it appears to spread so I'd like to address it at the source here.I have to admit this message was a bit low-level and misleading. Later versions (like the old 1.53.1515 released a month after the incident) print this improved message instead:
An address for 64tass is a (numeric) value together with indexing, immediate and indirection operations. This is somewhat different from normal use where it usually stands for a numeric value identifying a memory location.
In this case the address is [TK_TAB-$80] which can't be multiplied as the numeric value 43 had already an indirect long addressing mode applied on. The immediate mode operation haven't joined in yet due to precedence rules.
Probably I could make the expression parser more complicated by special casing brackets to not mean indirection here but I won't. It wouldn't help either as parentheses are used for expression grouping not brackets.
The parser is generic and accepts any random (but syntactically correct) addressing modes even if it turns out that it does not work with the opcode it or it's just nonsense.
There are various design reasons why addresses for 64tass are more than just simple numbers. One of the easiest ones is to support register based addresses:
There's one misunderstanding however which bothered me for years. Worse it appears to spread so I'd like to address it at the source here.
Code: Select all
basic.asm:1558:19: error: invalid operands to multiply '*' 'address' and 'int'
CMP #[TK_TAB-$80]*2 ; compare normalised token * 2 with TAB
^
Code: Select all
basic.asm:1558:19: error: multiply '*' of address '[43]' and int '2' not possible
CMP #[TK_TAB-$80]*2 ; compare normalised token * 2 with TAB
^
In this case the address is [TK_TAB-$80] which can't be multiplied as the numeric value 43 had already an indirect long addressing mode applied on. The immediate mode operation haven't joined in yet due to precedence rules.
Probably I could make the expression parser more complicated by special casing brackets to not mean indirection here but I won't. It wouldn't help either as parentheses are used for expression grouping not brackets.
The parser is generic and accepts any random (but syntactically correct) addressing modes even if it turns out that it does not work with the opcode it or it's just nonsense.
There are various design reasons why addresses for 64tass are more than just simple numbers. One of the easiest ones is to support register based addresses:
Code: Select all
tmp = 1,s ; indirection is only valid at opcodes but indexing is fine here
lda tmp+1 ; lda 2,s