?login_element?

Subversion Repositories NedoOS

Rev

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

  1. ; test include paths on command line and their priorities, there are multiple steps:
  2. ; luainc.asm       = no extra include path, should include from working directory
  3. ; luaincS.asm      = +include paths "luaincSSSS_v"
  4. ; luaincSS.asm     = +include paths "luaincSSSS_i"
  5. ; luaincSSS.asm    = +include paths "luaincSSSS_v", "luaincSSSS_i"
  6. ; luaincSSSS.asm   = +include paths "luaincSSSS_i", "luaincSSSS_v"
  7.  
  8. ; The following code is intentionally mischievous and damaging assembling process, and
  9. ; the results of the assembling will very likely change in the future, as the work
  10. ; on consolidation of sjasmplus will continue, this is NOT example how to use lua scripts!
  11. ; it's more like anti-example, how to NOT use it.
  12.  
  13.     LUA PASS1
  14.         pass = 0
  15.     ENDLUA
  16.     LUA ALLPASS
  17.         pass = pass + 1
  18.         if pass == 1 or pass == 3 then
  19.           sj.warning('Pass updated to ' .. pass .. ', device: ' .. sj.get_device())
  20.         end
  21.     ENDLUA
  22.  
  23.     DEVICE ZXSPECTRUM1024
  24.  
  25.     ORG     $8000
  26.  
  27.     INCLUDELUA luaincSSSS.lua   ; this will load local version (defining two functions)
  28.  
  29.     INCLUDELUA <luaincSSSS.lua> ; this may load "system" version depending on -I options
  30.  
  31. loopyLoop:
  32.  
  33.     call    forwardyLabelo
  34.  
  35.     LUA ALLPASS
  36.     inc_ld_local('A', pass + 10)    -- defined only in local LUA script (never changes)
  37.     ENDLUA
  38.  
  39.     LUA ALLPASS
  40.     inc_ld_system('A', pass)        -- defined in all includes, the one with priority wins
  41.     ENDLUA
  42.  
  43.     jr  loopyLoop
  44.  
  45. forwardyLabelo:
  46.     rst 0
  47.  
  48.     ds  stretchItEvenMore-forwardyLabelo-1, 201
  49.  
  50.     ALIGN 256
  51. stretchItEvenMore:
  52.     rst 16
  53.