?login_element?

Subversion Repositories NedoOS

Rev

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

  1.     OUTPUT "op_40_7F.bin"
  2.  
  3.     ;;; generate all 40..7F instructions (all common `ld xx,yy` variants + halt)
  4.     LUA ALLPASS
  5.         registers = { 'b', 'c', 'd', 'e', 'h', 'l', '(hl)', 'a' }
  6.         for r1 = 1, #registers do
  7.             for r2 = 1, #registers do
  8.                 instruction = 'ld '..registers[r1]..','..registers[r2]
  9.                 if (r1 == r2 and registers[r1] == '(hl)') then
  10.                     instruction = 'halt'    -- `ld (hl),(hl)` is `halt`
  11.                 end
  12.                 _pc(instruction)
  13.             end
  14.         end
  15.     ENDLUA
  16.  
  17. ;;; abandoned work in progress
  18. ; while the issue with DEFARRAY was resolved, the next blocker is IF inside DUP...
  19.  
  20. ;     DEFARRAY registers b, c, d, e, h, l, (hl), a
  21. ;
  22. ; R1 DEFL 0
  23. ;     DUP 8
  24. ;         IF R1==6
  25. ;             halt
  26. ;         ELSE
  27. ;             ld  registers[R1],registers[R1]
  28. ;         ENDIF
  29. ; R1 DEFL R1+1
  30. ;     EDUP