Welcome, Guest. Please login or register.

Author Topic: Looking for assembly syntax slightly different from mototrolla ?  (Read 5472 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline psxphill

Quote from: Einstein;831834
I remember I have "occasionally" made mistakes (read bugs) with the motorola syntax ever since I learned it, which is why I was curious about the existence of the alt syntax.


If the idea is to remove mistakes then surely the preferred style would be

immediate: move.w #4,d0
absolute addressing: move.w (4), d0

with an error if you do:
move.w 4,d0

I don't know where the brackets round the number for absolute addressing syntax comes from though.

https://en.wikibooks.org/wiki/68000_Assembly#Absolute_far_addressing
 

Offline psxphill

Re: Looking for assembly syntax slightly different from mototrolla ?
« Reply #1 on: October 17, 2017, 12:04:47 PM »
Quote from: BLTCON0;831846
Probably to maintain an analogy with the address register (i.e. pointer) dereferencing syntax:

I understand why the syntax makes sense. I just can't find any official documentation or assembler that uses it.

I thought it might have been MIT standard, but it doesn't appear to be.
 

Offline psxphill

Re: Looking for assembly syntax slightly different from mototrolla ?
« Reply #2 on: October 17, 2017, 05:26:37 PM »
Quote from: Einstein;831854
The '#' would then be enforced superfluous syntax.

Yes, that is entirely the point. If you are explicit about whether it's # or () then it will be more obvious to you if you make a mistake and use the wrong one, using naked numbers opens up the possibility to misread it. Which I thought was the problem you were trying to solve in the first place.