Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline BLTCON0

  • Jr. Member
  • **
  • Join Date: Oct 2013
  • Posts: 91
    • Show all replies
There's the old (a->b) and the new (b<-a) syntax as far as I know.
E.g. Devpac2 understands only the old, while Devpac3 understands both old and new, if I recall correctly.
I don't think there's a 3rd option and while nothing would prevent someone from coding a semantically equivalent assembler using your proposed alternative, I doubt anyone would actually bother reinventing the wheel when two official standards already exist.
 

Offline BLTCON0

  • Jr. Member
  • **
  • Join Date: Oct 2013
  • Posts: 91
    • Show all replies
Re: Looking for assembly syntax slightly different from mototrolla ?
« Reply #1 on: October 17, 2017, 10:06:22 AM »
Quote from: psxphill;831845

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


Probably to maintain an analogy with the address register (i.e. pointer) dereferencing syntax:
move.l (a6),d0 (copy contents of address pointed to by a6)
vs
move.l a6,d0 (copy a6 itself)

since the ambiguity move.l 4,d0 would create has already been resolved by the # prefix for immediate transfer.
With no ambiguity left between move.l 4,d0 and move.l (4),d0, it ends up being a matter of style/personal preference.

I've only seen (and used) the move.l 4,d0 syntax though, both in others' code and in disassemblers' output.
 

Offline BLTCON0

  • Jr. Member
  • **
  • Join Date: Oct 2013
  • Posts: 91
    • Show all replies
Re: Looking for assembly syntax slightly different from mototrolla ?
« Reply #2 on: October 17, 2017, 01:59:59 PM »
@psxphill
It's used in Motorolla's Programmer's Reference Manual, e.g. in the MOVE instruction the corresponding addressing modes are indicated by (xxx).W and (xxx).L