| |
ready.
Registered: Feb 2003 Posts: 441 |
64tass v1.45 bug
Using 64tass v1.45 or earlier by Breeze and Singular (64TASS V1.45), I can't compile the illegal op code ANC. I need:
....
lda ($2e),y
anc #$ff
ror
....
I have managed 64tass to compile the ANC op code in this way:
....
lda ($2e),y
.byte $0b, $ff
ror
....
In this way it works fine. Hope this can be helpful for a new version of 64tass.
BR,
Ready. |
|
... 17 posts hidden. Click here to view all posts.... |
| |
Hermit
Registered: May 2008 Posts: 208 |
Regarding source code that causes 'Oops, too many passes.'
I played around with branching to prove my assumption. Here is a code which recalls the bug, wherever you place it in memory:
loop beq jploop
.rept $80
NOP
.next
jploop jmp loop
As you can see, this would be a 'branch too far' normally, but the 2 byte bne xx isn't taken into account. That's why, writing .rept $81 of NOPs also causes the 'Oops', while .rept $82 and more calls 'branch too far'. The latter should be the case with $80 and $81 too. .rept $7f of NOPs and below is the safe area, where no error message at all.
Maybe I'll find in 64tass source where this can be fixed. At least we catched this bug, time to destroy it ;)
-I didn't experience this bug with backward-branching, because there 2 byte of BNE xx doesn't count into amount of max. jumping.
|
| |
Hermit
Registered: May 2008 Posts: 208 |
Here's an extract from 64tass.c 1.46 row 1767. It seems to calculate relative address by subtracting logical address (l_address) from absolute address value (val). And it substracts that 2 too (the 2 byte that bne/beq allocates). The problem must be in this if-else structure, because $80 and $81 branching both goes to the point where the normal (below $80) branches go. I restructured lookout of this code a bit to better see the hierarchy...
if (cnmemonic[ADR_REL]!=____)
{
if (d)
{
if (fixeddig && (l_address >> 16)!=(((unsigned)val) >> 16)) {err_msg(ERROR_BRANCH_TOOFAR,NULL); break;}
val=(val-l_address-2) & 0xffff; //hermit: maybe this '2' should be handled in other way
if (val<0xFF80 && val>0x007F) // hermit: checks BNE boundaries here.
{
if (arguments.longbranch && (cnmemonic[ADR_ADDR]==____) && ((cnmemonic[ADR_REL] & 0x1f)==0x10))
{//branch
longbranch=0x20;val=0x4C03+(((val+l_address+2) & 0xffff) << 16);
if (fixeddig) err_msg(ERROR___LONG_BRANCH,NULL);
}
else
{
if (cnmemonic[ADR_ADDR]!=____)
{
val=(val+l_address+2) & 0xffff;
opr=ADR_ADDR;w=1;ln=2;goto brancb;
}
else if (cnmemonic[ADR_REL_L]!=____)
{//gra
val=(val-1) & 0xffff;
opr=ADR_REL_L;w=1;ln=2;goto brancb;
}
else if (fixeddig) {err_msg(ERROR_BRANCH_TOOFAR,NULL); break;}
}
}
opr=ADR_REL;w=0;// bne -hermit: bne with safe 00..$7f jump comes here ------BUT WHY $80 and $81 too?
} else fixeddig=0; if (longbranch) ln=4; else ln=1;
}
|
| |
soci
Registered: Sep 2003 Posts: 480 |
Should work now.
svn co https://tass64.svn.sourceforge.net/svnroot/tass64/trunk tass64 |
| |
WVL
Registered: Mar 2002 Posts: 902 |
soci : do you also have a compiled version available? :) (somehow the official version is always 10x smaller and faster than any that i can compile myself) |
| |
soci
Registered: Sep 2003 Posts: 480 |
http://sourceforge.net/projects/tass64/files/binaries/
Here's a win32 binary, I haven't tried it, maybe it does not even execute. Mac donations or hints how to cross compile on Linux are accepted ;)
|
| |
Hermit
Registered: May 2008 Posts: 208 |
Hi there Soci
It was fast, thank you very much for the effort.
I compiled it in Puppy Linux, works perfectly, 82kbyte, little bit more than previously. And the binary should work fine on the other Linux distros too.
If you don't mind I shared the linux binary here, in a zip with the license texts, just as with your .exe verison:
http://hermit.netne.net/c64prog/64tass-1.46-r38.zip
Cheers, You made my day even better with this fix :) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
"somehow the official version is always 10x smaller and faster than any that i can compile myself"
strip -s to the rescue =)
|
| |
Hein
Registered: Apr 2004 Posts: 954 |
Quote: http://sourceforge.net/projects/tass64/files/binaries/
Here's a win32 binary, I haven't tried it, maybe it does not even execute. Mac donations or hints how to cross compile on Linux are accepted ;)
Thanks. |
| |
Kaizen
Registered: May 2009 Posts: 24 |
Hi,
tried now to compile on Mac OS X.
The first makefile returns some errors:
gcc -c -o 64tass.o 64tass.c
gcc -c -o opcodes.o opcodes.c
gcc -c -o misc.o misc.c
misc.c:25:18: error: argp.h: No such file or directory
misc.c:601: error: array type has incomplete element type
misc.c:628: error: syntax error before 'parse_opt'
misc.c:628: warning: 'struct argp_state' declared inside parameter list
misc.c:628: warning: its scope is only this definition or declaration, which is probably not what you want
misc.c: In function 'parse_opt':
misc.c:668: error: 'ARGP_KEY_ARG' undeclared (first use in this function)
misc.c:668: error: (Each undeclared identifier is reported only once
misc.c:668: error: for each function it appears in.)
misc.c:668: error: dereferencing pointer to incomplete type
misc.c:669: error: 'ARGP_KEY_END' undeclared (first use in this function)
misc.c:669: error: dereferencing pointer to incomplete type
misc.c:670: error: 'ARGP_ERR_UNKNOWN' undeclared (first use in this function)
misc.c: At top level:
misc.c:675: error: variable 'argp' has initializer but incomplete type
misc.c:675: warning: excess elements in struct initializer
misc.c:675: warning: (near initialization for 'argp')
misc.c:675: warning: excess elements in struct initializer
misc.c:675: warning: (near initialization for 'argp')
misc.c:675: warning: excess elements in struct initializer
misc.c:675: warning: (near initialization for 'argp')
misc.c:675: warning: excess elements in struct initializer
misc.c:675: warning: (near initialization for 'argp')
make: *** [misc.o] Error 1
Instead the makefile2 returns only some warnings:
gcc -Wall -DWIN32 -c -o 64tass.o 64tass.c
64tass.c: In function 'compile':
64tass.c:2047: warning: format '%06x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
64tass.c:2055: warning: format '%04x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
64tass.c:2055: warning: format '%06x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'
64tass.c:2071: warning: suggest parentheses around comparison in operand of ^
64tass.c:745: warning: unused variable 'filestat'
64tass.c:740: warning: unused variable 'fflen'
gcc -Wall -DWIN32 -c -o opcodes.o opcodes.c
gcc -Wall -DWIN32 -c -o misc.o misc.c
gcc 64tass.o opcodes.o misc.o -o 64tass
Could this second version works well?
Sorry for my question, but I don't know C and so I cannot understand what means this several warnings.
THX. ;-) |
| |
WVL
Registered: Mar 2002 Posts: 902 |
I recompiled Pearls for Pigs with v1.46, no problems, everything went ok and the demo runs fine ;) |
Previous - 1 | 2 | 3 - Next |