?login_element?

Subversion Repositories NedoOS

Rev

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

  1.     OUTPUT "op_IX_BIT_DDCB.bin"
  2.  
  3.     ;;; generate shift instructions: #DDCBFF00 .. #DDCBFF3F ("ix-1" = FF index byte)
  4.     LUA ALLPASS
  5.         instructions = { 'rlc', 'rrc', 'rl', 'rr', 'sla', 'sra', 'sli', 'srl' }
  6.         registers = { '(ix-1),b', '(ix-1),c', '(ix-1),d', '(ix-1),e', '(ix-1),h', '(ix-1),l', '(ix-1)', '(ix-1),a' }
  7.         for ii = 1, #instructions do
  8.             for rr = 1, #registers do
  9.                 instruction = instructions[ii]..' '..registers[rr]
  10.                 _pc(instruction)
  11.             end
  12.         end
  13.     ENDLUA
  14.  
  15.     ;;; generate `bit` instructions: #DDCBFF46 .. #DDCBFF7E (two: {#x6, #xE})
  16.     LUA ALLPASS
  17.         for bb = 0, 7 do
  18.             instruction = 'bit '..bb..',(ix-1)'
  19.             _pc(instruction)
  20.         end
  21.     ENDLUA
  22.  
  23.     ;;; generate `res` + `set` instructions: #DDCB1180 .. #DDCB11FF ("ix+17" = 11 index byte)
  24.     LUA ALLPASS
  25.         instructions = { 'res', 'set' }
  26.         registers = { '(ix+17),b', '(ix+17),c', '(ix+17),d', '(ix+17),e', '(ix+17),h', '(ix+17),l', '(ix+17)', '(ix+17),a' }
  27.         for ii = 1, #instructions do
  28.             for bb = 0, 7 do
  29.                 for rr = 1, #registers do
  30.                     instruction = instructions[ii]..' '..bb..','..registers[rr]
  31.                     _pc(instruction)
  32.                 end
  33.             end
  34.         end
  35.     ENDLUA
  36.