don't click here

Undocumented features in asm68k

Discussion in 'Technical Discussion' started by Hivebrain, Aug 20, 2022.

  1. Hivebrain

    Hivebrain

    Administrator
    3,001
    99
    28
    53.4N, 1.5W
    Github
    I was looking through asm68k in a hex editor when I noticed a bunch of predefined macros:

    Code (Text):
    1. ifd macros
    2.  if def(\1)
    3. ifnd macros
    4.  if ~def(\1)
    5. ifeq macros
    6.  if (\1)=0
    7. ifne macros
    8.  if (\1)<>0
    9. ifgt macros
    10.  if (\1)>0
    11. iflt macros
    12.  if (\1)<0
    13. ifge macros
    14.  if (\1)>=0
    15. ifle macros
    16.  if (\1)<=0
    17. ifc macros
    18.  if strcmp(\1,\2)
    19. ifnc macros
    20.  if ~strcmp(\1,\2)
    What I found interesting is that you can mix macros and if like that.

    I also found stricmp(), which is a case-insensitive version of strcmp(), and addrmode(), which I don't know what it does other than output $10 as a byte.
     
    • Informative Informative x 2
    • List
  2. Devon

    Devon

    There's nothing left but faith Tech Member
    867
    610
    93
    In the manual, it mentions switch "/k" that allows "pre-defined foreign conditionals" like "ifnd", which is among those macros you listed. Looks like they probably just inserted those macros for those "foreign conditionals" to be enabled.
     
    • Informative Informative x 2
    • List