don't click here

Undocumented features in asm68k

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

  1. Hivebrain

    Hivebrain

    Administrator
    3,068
    204
    43
    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

    La mer va embrassé moi et délivré moi lakay. Tech Member
    1,425
    1,744
    93
    your mom
    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