?login_element?

Subversion Repositories NedoOS

Rev

Rev 539 | Blame | Compare with Previous | Last modification | View Log | Download

  1.     ;; classic syntax (name is after MACRO directive)
  2.     MACRO   classicNameNoArg
  3.         dz  "classic-no-arg\n"
  4.     ENDM
  5.     MACRO   classicNameOneArg arg1?
  6.         db  "classic-1-arg: ", arg1?, "\n", 0
  7.     ENDM
  8.     MACRO   classicNameTwoArg arg1?, arg2?
  9.         db  "classic-2-arg: ", arg1?, arg2?, "\n", 0
  10.     ENDM
  11.  
  12.     ;; new optional syntax (label on MACRO line is used as macro name)
  13. newNameNoArg    MACRO
  14.                     dz  "new-no-arg\n"
  15.                 ENDM
  16. newNameOneArg   MACRO  arg1?
  17.                     db  "new-1-arg: ", arg1?, "\n", 0
  18.                 ENDM
  19. newNameTwoArg   MACRO  arg1?, arg2?
  20.                     db  "new-1-arg: ", arg1?, arg2?, "\n", 0
  21.                 ENDM
  22.  
  23.     ;; but label doesn't work over colon separator
  24. Label       :   MACRO nameOrArg?
  25.                     dz  "name-or-arg as name\n"
  26.                 ENDM
  27.  
  28.     ;; DEFL labels also don't work, even without colon
  29. Babel = 2       MACRO nameOrArg2?
  30. ;                     dz  "name-or-arg2 as name\n"
  31.                 ENDM
  32.  
  33.     MODULE module1  ; first version did use "module1" as part of macro name - now fixed+tested
  34.  
  35. newInModule     MACRO arg1?
  36.                     db "in-module-new-1-arg: ", arg1?, "\n", 0
  37.                 ENDM
  38.  
  39.                 MACRO classicInModule arg1?
  40.                     db "in-module-classic-1-arg: ", arg1?, "\n", 0
  41.                 ENDM
  42.  
  43.     ENDMODULE
  44.  
  45.     OUTPUT "label_as_name.bin"      ; verify defined macros (by checking bin output)
  46.     classicNameNoArg : classicNameOneArg 'a' : classicNameTwoArg 'b', 'c'
  47.     newNameNoArg : newNameOneArg 'a' : newNameTwoArg 'b', 'c'
  48.     nameOrArg? : nameOrArg2?
  49.     newInModule 'm' : classicInModule 'M'
  50.  
  51.     ;; invalid macro names
  52.                 MACRO @invalidClassic   ; no need for "ENDM" due to error
  53. @invalidNew     MACRO
  54.  
  55.                 MACRO #invalidClassic2 arg1?    ; no need for "ENDM" due to error
  56. #invalidNew2    MACRO arg1?
  57.  
  58. trailingChar$   MACRO arg1
  59.  
  60.                 MACRO trailingChar$ arg1
  61.