Need help with TASM Assembler

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
ken_g
Posts: 8
Joined: 16 Feb 2003

Need help with TASM Assembler

Post by ken_g »

Hello,

I am trying to write a program and I'm using the TASM Assember to assemble it. I need to be able to load the high address bit and low address bit into the registars. All the 6502 assembler books I have say I can to it like this:

TEST NOP
LDY #<TEST ;load ADDRH into Y
LDX #>TEST ;load ADDRL into X

But when I use the TASM assember, it loads 01 into Y and 00 into X no matter what I use after the ">" or "<". Even if I do the following:

LDY #<$1122
LDX #>$1122

I still get 01 and 00 instead of 11 in Y and 22 in X. Is this feature not supported in TASM? Is there an easy way around it. Thanks in advance for your help.

Ken Guenther
ken_g
Posts: 8
Joined: 16 Feb 2003

Post by ken_g »

I got my answer. I need to be doing the following:

TEST NOP
LDX #(TEST >> 8) ; LOAD ADDRH
LDY #(TEST & $FF) ; LOAD ADDRL

Thanks.
Ken Guenther
User avatar
GARTHWILSON
Forum Moderator
Posts: 8774
Joined: 30 Aug 2002
Location: Southern California
Contact:

Post by GARTHWILSON »

I had to put the cursor on the various emoticons and look at the bottom address line to see what you might have written that produced the sunglasses face. It was 8), which makes sense now. Sometimes you have to check the "Disable Smilies in this post" box when you write. (I just did.) Then click "Preview" to make sure you got what you intended. You can always edit your own posts after posting too. The "Edit" box to click on won't show up if you're not logged in though.

You had the < and > backwards for the assemblers I've used, but I still couldn't figure out what would give you the 0 and 1 in X and Y. Did you figure that out?

Garth
ken_g
Posts: 8
Joined: 16 Feb 2003

Post by ken_g »

Sorry about the smiley face. I didn't notice it until I read your reply. And your right that I had my < and > backwards. It should have been the other way around.

I found out what it is doing is a greater than and less than comparison. I think it defaults to compairing to zero if another variable is not supplied. So it was giving a 1 for true and 0 for false.

Ken
autoboy
Posts: 2
Joined: 26 Apr 2003
Contact:

Post by autoboy »

I don't really know what's going on for you. I use the <>-operators all the time to refer to lo/hi-byte of an adress. (We ARE speaking of Turbo Assembler on the c64, right?) Are you sure you have set the adress where the code should go?

* = $0810

test nop
ldx #<test
ldy #>test

?

I guess the assembler might default to starting you program att adress $0000 otherwise, or something like that.

/autoboy
Last edited by autoboy on Sun Apr 27, 2003 8:53 am, edited 1 time in total.
User avatar
Mike Naberezny
Site Admin
Posts: 295
Joined: 30 Aug 2002
Location: Northern California
Contact:

Turbo Assembler vs. TASM

Post by Mike Naberezny »

ken_g wrote:
I am trying to write a program and I'm using the TASM Assember to assemble it. I need to be able to load the high address bit and low address bit into the registars.
autoboy wrote:
(We ARE speaking of Turbo Assembler on the c64, right?) Are you sure you have set the adress where the code should go?
Hi,

TASM is a popular cross-assembler for DOS. It can be found on 6502.org in the Cross-Development Software area.

Regards,
Mike
Post Reply