Jump to content
Sign in to follow this  
Rybags

Assembler that can force absolute address for z-page references

Recommended Posts

Do any of our commonly used PC-based Assemblers allow forcing absolute (2 byte) addressing mode rather than zero page for selected instructions?

 

e.g. lda label2

where label2 = $80 will assemble using the zero page LDA opcode.

 

I know that the Atari Assembler Editor cart does it all the time but I don't want to use it and I want to control if/when the non default mode is used.

 

Logically the usage might be:

 

lda.w label2

 

I had the idea of maybe just make macros to cover all possibilities but it'd probably be easier if the assembler could take care of it. Especially when you have stuff like inc label2,x

Share this post


Link to post
Share on other sites

From XASM manual:

 

 

You can explicitly specify absolute (a:) and zero-page (z:) addressing modes.

 

Examples:

nop
asl @
lda >$1234  assembles to lda #$12
lda $100,x
lda 0       zero-page (8-bit address)
lda a:0     absolute (16-bit address)
jmp ($0a)
lda ($80),y

Edited by MaPa

Share this post


Link to post
Share on other sites

Thanks Mapa.

 

Since MADS is sort of descended from Xasm, I tried it there.

 

Seems you can do it with:

 

lda.a or lda.w

Share this post


Link to post
Share on other sites

Although not commonly used, my shasm65 assembler explicitely uses different mnemonics for absolute and zero page addressing.

 

# absolute:
lda 1
inc 1

# zero page:
lda.z 1
inc.z 1

# immediate
lda. 1

Share this post


Link to post
Share on other sites

what about simply using:

 

lda $00ff instead?

 

lda $ff

will definitely assemble to zp.

 

wouldn't that do it??

 

&falcon

Edited by falcon_

Share this post


Link to post
Share on other sites

what about simply using:

 

lda $00ff instead?

 

lda $ff

will definitely assemble to zp.

 

wouldn't that do it??

 

&falcon

I should think so, but it wouldn't help if you're using labels:

 

address = $80
  lda address

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...