Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Why does this work in a crossassembler?
2004-09-27 20:07
Fix

Registered: Feb 2003
Posts: 55
Why does this work in a crossassembler?

Hi,

Why does this work in a crossassembler and not in TASS 5.x

I get illegal quantity.....

Or do I have to do it on a Zeropage to have it work ?

CROSS ASSEMBLER:

lda (text),y
rts

text: dc.b 0,0

- - -

TASS 5.2

lda (text),y
rts

text .byte $00,$00


Have I made a fool out of myself now ?

/Fix
2004-09-27 20:56
cadaver

Registered: Feb 2002
Posts: 1163
The crossassembler is not being strict enough, and therefore compiles a program that won't work (unless you assemble it to the zeropage)
2004-09-27 21:38
Fix

Registered: Feb 2003
Posts: 55
I missed one important thing in the crossasm, there where a

seg.u zp_up
org $02

:-)

and in tass you need to write

test = $02

and then I can address them as I want.. :-)

Thanx..
2004-09-28 11:02
Graham
Account closed

Registered: Dec 2002
Posts: 990
this is obviously an error of the cross assembler. "(text),y" does not work in non-zeropage adresses. i guess the crossasm mistakes it for "text,y" and thinks the brackets are just a part of an expression.
2004-09-28 11:04
Graham
Account closed

Registered: Dec 2002
Posts: 990
btw, if you want to assemble to zeropage adresses with tasm, you cannot do that directly. use .OFFS to move the assembled code to a non-zeropage part of the memory, else you will trash tasm while assembling (since it uses zeropage adresses itself).
2004-09-28 13:07
WVL

Registered: Mar 2002
Posts: 924
Quote: Hi,

Why does this work in a crossassembler and not in TASS 5.x

I get illegal quantity.....

Or do I have to do it on a Zeropage to have it work ?

CROSS ASSEMBLER:

lda (text),y
rts

text: dc.b 0,0

- - -

TASS 5.2

lda (text),y
rts

text .byte $00,$00


Have I made a fool out of myself now ?

/Fix


wtf do you want to do with

lda (text),y ?!?!

i hope you mean you have your pointers to your text there and not the text itself. Anyhow it's bad coding practice (even on the c64 and in assembler ;) to call something what it's not.

it should be called 'textpointer' or something.

are you sure you don't just mean

lda text,y ?
2004-09-28 13:49
hollowman

Registered: Dec 2001
Posts: 475
Quote: wtf do you want to do with

lda (text),y ?!?!

i hope you mean you have your pointers to your text there and not the text itself. Anyhow it's bad coding practice (even on the c64 and in assembler ;) to call something what it's not.

it should be called 'textpointer' or something.

are you sure you don't just mean

lda text,y ?


so everytime i use different words having to do with the human genitalia as labels, it is bad coding practise since i call something what its not?
2004-09-28 14:51
WVL

Registered: Mar 2002
Posts: 924
curse words in code are generally accepted as useful contributions in pieces of code ;)

Anyway, i was just interested if Fix really knows what the code that he has written down does..
2004-09-28 15:29
Hoogo

Registered: Jun 2002
Posts: 105
Quote: so everytime i use different words having to do with the human genitalia as labels, it is bad coding practise since i call something what its not?

Calling them what they are ia also not always a good practice, even if they are damnlabel1 to damnlabel294 :-)
2004-09-28 22:45
Puterman
Account closed

Registered: Jan 2002
Posts: 188
wvl: it's arguable whether variable names which indicate the type of the data is good coding practice or not.
2004-09-29 06:39
Hoogo

Registered: Jun 2002
Posts: 105
Speaking variable names can make bugs more visible. If you choose the prefix ba_ for ByteArrays, "lda ba_states" or "jmp ba_states" most time make no sense, "lda ba_states,y" and "jmp (ba_states)" might be better.
 
... 2 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Didi/Laxity
Durandal
Jazzcat/Onslaught
xAD/nIGHTFALL
Smasher/F4CG
Guests online: 183
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 Tim  (9.7)
4 Irata  (9.7)
5 hedning  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.044 sec.