6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 1:34 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Mar 27, 2003 1:09 pm 
Offline

Joined: Sun Feb 16, 2003 10:48 pm
Posts: 8
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 28, 2003 12:25 pm 
Offline

Joined: Sun Feb 16, 2003 10:48 pm
Posts: 8
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 28, 2003 3:27 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8540
Location: Southern California
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 28, 2003 3:59 pm 
Offline

Joined: Sun Feb 16, 2003 10:48 pm
Posts: 8
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 26, 2003 1:29 pm 
Offline

Joined: Sat Apr 26, 2003 1:09 pm
Posts: 2
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.

Top
 Profile  
Reply with quote  
 Post subject: Turbo Assembler vs. TASM
PostPosted: Tue Apr 29, 2003 2:19 pm 
Offline
Site Admin
User avatar

Joined: Fri Aug 30, 2002 1:08 am
Posts: 281
Location: Northern California
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

_________________
- Mike Naberezny (mike@naberezny.com) http://6502.org


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: