I'd like to see beyond 16bit indexing limit, so how to do it?
This is the normal way... it only sees 32k forwards and backwards.

lea data(pc),a0

data: dc.l $0

I think I did it yesterday, or I just thought I did dit it but it was something else, but now I can't remember what it was. Suppose you have 64k of data between those two lines, you ain't seeing "data" anymore. I can think of a hundred bad ways to do it, but in case you know the best way, you could enlighten me. I think I just put .l somewhere...

Just want to point out that on 68020 and above you have 32-bit PC relative addressing modes available.

Yes, but don't use them on the Amiga. They are not needed and slow. It would be faster to use absolute addresses and let the Amiga loader relocate. If there is a free address register and very many accesses then something like the examples above is the best.

What's surprising there? * = current PC, *+2 = current PC+2 = lea instruction +2. It works fine and there are no problems with it.

"Cleaner" version would be:

Code:

MLEA MACRO
lea *(pc),\2
add.l #(\1-*)+4,\2
ENDM

Yes, I had to look closer. On first sight it seemed to me that both *+2 were trying to refer to the same location. And I nearly wanted to believe that inside a macro you have the same address in * all the time.

Quote:

You say you wouldn't recommend it but do not explain why. I am interested as to WHY you would not recommend it because I can't see any reason.

Ok, ok. No reason to get loud.
I personally would avoid the * symbol whenever possible, because it is not implemented the same in all assemblers. As an example, critical cases are short-branches

Code:

bra.b *-2

and directives which can be arbitrarily split over several lines

Code:

dc.l *,*,*,*

different to

Code:

dc.l *,*
dc.l *,*

It also makes your source hard to read and hard to maintain. It is a relict from the first assemblers in the 1960s where labels were limited in length and in number. As Photon wrote \@ also works with AsmOne, so there is no reason to use *.
The only case where I have to use * is with assembler-inline code in C sources.

Using uppercase wasn't meant as shouting, I just wanted to emphasize that I'm really interested in the reason why you wouldn't recommend it.

Quote:

Originally Posted by phx

I personally would avoid the * symbol whenever possible, because it is not implemented the same in all assemblers.

If I want portable code I do not use Assembler so that argument is void, for me at least.

Quote:

Originally Posted by phx

As an example, critical cases are short-branches

Code:

bra.b *-2

and directives which can be arbitrarily split over several lines

Code:

dc.l *,*,*,*

different to

Code:

dc.l *,*
dc.l *,*

All true but nothing of that applies to the Macro because there are no branches at all!

Quote:

Originally Posted by phx

It also makes your source hard to read and hard to maintain. It is a relict from the first assemblers in the 1960s where labels were limited in length and in number. As Photon wrote \@ also works with AsmOne, so there is no reason to use *.

How often do you use Asm-One? And for what? I'm sorry but I have to ask this question because it seems I'm using AsmOne a LOT more than you and Asm-One has a lot of problems when you are using lots of macros (as I do in my demosystem) which is why I avoid these generated labels (yes, I of course do know about them, actually my whole demosystem is driven by macros) when they are not really required and in this case they aren't. And I don't see how it makes my sources hard to read because usually you do not care about how a macro works, you're just interested that it works.

Quote:

Originally Posted by phx

The only case where I have to use * is with assembler-inline code in C sources.

How about pc relative jump tables? dc.l *-TAB. There are certainly more reasons to use * than just inline asm in C!

Don't misunderstand me. My replies were general and not directed to you personally. I didn't want to advise you or even make you change your coding habbits. You just asked why I wouldn't use '*'. And I answered. Just have fun everybody!

You're right about AsmOne. I never used it in my whole life (because of those "problems" ).

Don't misunderstand me. My replies were general and not directed to you personally. I didn't want to advise you or even make you change your coding habbits. You just asked why I wouldn't use '*'. And I answered. Just have fun everybody!

Now I think you misunderstood my reply. I'm always open to a discussion like that because no one knows everything (which is why I asked why you wouldn't recommend it and I told you my reasons why I used it ;D). Discussions like that can be very useful. And no, I didn't understand your reply as "he wants me to change my coding habits" (that's impossible after 20 years anyway :P).

To make it a bit more clear, I'd f.e. never use bra.b *+2 in a macro for the reasons you mentioned, branch distance can change and then all hell breakes loose. However, in the case of the "PC relative lea" macro there are no problems like that because it consists of just 2 instructions of fixed length that can never(!) change. Which is why I don't see it as a problem to use the "*" symbol there.

Quote:

Originally Posted by phx

You're right about AsmOne. I never used it in my whole life (because of those "problems" ).

I never found a better alternative so despite the lot of problems Asm1 definitely has, it's still the best choice for me. =)

Then we have probably both seen a lot in our lifes. It's 27 years assembler coding here.

Quote:

However, in the case of the "PC relative lea" macro there are no problems like that because it consists of just 2 instructions of fixed length that can never(!) change. Which is why I don't see it as a problem to use the "*" symbol there.

When using AsmOne with the mentioned problems in mind you are certainly right in this case. But that doesn't mean I would recommend it with Devpac, for example. I was trying to make a general statement for all assemblers and all code situations.
And there might be also some special cases where * is just easier. You mentioned one form of jump table. But there are several kinds of jump tables.

Quote:

I never found a better alternative so despite the lot of problems Asm1 definitely has, it's still the best choice for me. =)

You cannot get me to any statement about which assembler to prefer. It makes no sense as I'm probably biased as being the author of two Amiga assemblers.
It heavily depends on personal taste, how you are used to work and in which environment you want to do it.

Ah, but then you won't have us believe that your first choices aren't phxAss and...

vasm

Everyone remembers PhxAss though. Maybe the name wasn't so bad after all . Vasm is getting very good. It's worth while to switch from PhxAss as it's more forgiving and has less bugs. No one should be using Devpac as vasm has a Devpac compatibility mode, more options and more optimizations. Vasm can optimize branches both forward and backward for example. AsmOne still makes sense as it has some features vasm never will. You have to live with the bugs and lack of support though. Ced with ARexx, and BDebug make a pretty potent programming combo. I think many 68k assembly programmers are set in their ways and don't try new things so they miss gems like vasm. It took me a long time to switch but I'm glad I did.

Most of the assemblers I know support "*" as symbol for current PC so I don't really see a problem. And coming back to the portability, one assembler might expect \@ while another one uses a different syntax for these generated labels. So you will have to adapt the macro anyway if you want to use it with a different assembler.

Quote:

Originally Posted by phx

And there might be also some special cases where * is just easier. You mentioned one form of jump table. But there are several kinds of jump tables.

I was merely pointing out the fact that using "*" does have its uses, even nowadays. Of course there are lots of different approaches to do jump tables but that was not the point.

Quote:

Originally Posted by phx

You cannot get me to any statement about which assembler to prefer. It makes no sense as I'm probably biased as being the author of two Amiga assemblers.
It heavily depends on personal taste, how you are used to work and in which environment you want to do it.

You could f.e. tell me to use vasm and I'd still use Asm1 because as you say it depends on personal taste. So far I didn't find any other package with shorter turnaround times than Asm1 so despite its bugs it allows me to do the things I want to do in the shortest time.

Yeah, I've certainly never coded a 68K assembler, that's for sure. I've made my own bugfixed version of AsmOne 1.02, with Promax's help, and I've made a C-64 crossassembler (with parallel cable transfer) monstrosity using macros in AsmOne, but certainly not a real assembler for Amiga. Props.

I did code a Z80 assembler on PC though, with the sole purpose of coding a little MSX-cartridge Pong game The cartridge EPROM did work and I was very proud... for about a day or two and then, you know, lose interest and onto the next project This was way after MSX was popular, as nothing but nostalgia would have made me do all that work

My first steps in coding assembler was when I was 11, on the Acorn Atom and Apple-II. But it was not until I was 13 or so that it was anything more than 'modified typed-in sources from magazines'. If you know what I mean. All those home computer brands, one more exciting than the other! Good times