?login_element?

Subversion Repositories NedoOS

Rev

Rev 129 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.     ORG 'PS'  :   OUTPUT "Issue45B_arg_substitution.bin"
  2.  
  3.     ; labels expected to emerge from the macro argument substition
  4. TESTD_mydef_TESTD_12345:
  5. mydef_TESTD_12345:
  6.  
  7.     MACRO def name?, val?
  8.         ld  sp,name?_mydef_name?_val?
  9.         ld  sp,mydef_name?_val?
  10.     ENDM
  11.  
  12.     def TESTD, 12345
  13.  
  14.     DEFINE MY_VERSION "1.2.3.4.5"   ; should not clash with sjasmplus _VERSION define
  15.     db "\nMy version: ", MY_VERSION, ", sjasm: ", '0'+_SJASMPLUS, "\n"
  16.     DISPLAY "Sjasmplus version: ", _VERSION
  17.  
  18.     ; as result of the refactoring happening due to Issue #45 and #35, now array indexing by array should work
  19.  
  20.     DEFARRAY arrayIdx 2,3,4,0,1
  21.     DEFARRAY arrayTxt 't0', 't1', 't2', 't3', 't4'
  22.  
  23.     ; simple hard-wired source to access array elements
  24.     db  "\n", arrayTxt[0], " ", arrayTxt[1], " ", arrayTxt[2], " ", arrayTxt[3], " ", arrayTxt[4], "\n"
  25.  
  26.     ; dynamic array access in DUP repeater
  27. ii=0
  28.     DUP 4
  29.         db  arrayTxt[ii], " "
  30. ii=ii+1
  31.     EDUP
  32.     db  arrayTxt[4], "\n"
  33.  
  34.     ; hard-wired source to access array elements with extra indirection
  35.     db  arrayTxt[arrayIdx[0]], " ", arrayTxt[arrayIdx[1]], " ", arrayTxt[arrayIdx[2]], " ", arrayTxt[arrayIdx[3]], " "
  36.     db  arrayTxt[arrayIdx[4]], "\n"
  37.  
  38.     ; dynamic indirect array access in DUP repeater
  39. ii=0
  40.     DUP 4
  41.         db  arrayTxt[arrayIdx[ii]], " "
  42. ii=ii+1
  43.     EDUP
  44.     db  arrayTxt[arrayIdx[4]], "\n"
  45.