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
 
... 2 posts hidden. Click here to view all posts....
 
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.
2004-09-29 20:32
Fix

Registered: Feb 2003
Posts: 55
wow... many replies...


Yes I know what I'm doing :-)


The label name, just an exampel..


Graham:

How do .offs work in tasm, never used it..

2005-02-11 09:53
Krill

Registered: Apr 2002
Posts: 3083
.offs adds a fixed offset to the assembler's destination pointer. that destination pointer normally equals * in the code, but can be changed using that .offs command. you use it like this:

*= $2000
LABEL
*= $02
.OFFS LABEL-*; adds "distance" from $02 to $2000 to tass's destination pointer
ZPCODE
; imagine some zeropage code starting at $02 here

ENDZPCODE
* = ENDZPCODE-ZPCODE+LABEL; restore * to point to the correct address
.OFFS 0; reset offset
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
zzarko/Avatar
iAN CooG/HVSC
New Design/Excess
WVL/Xenon
Exile/Anubis
Icon/TRIAD
Guests online: 423
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 Uncensored  (9.5)
9 Wonderland XIV  (9.5)
10 No Bounds  (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 Crackers
1 Mr. Z  (9.9)
2 OTD  (9.8)
3 Antitrack  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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