| |
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.... |
| |
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. |
| |
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). |
| |
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 ? |
| |
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? |
| |
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.. |
| |
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 :-) |
| |
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. |
| |
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. |
| |
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..
|
| |
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 |