Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NGX - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

   IdleLoopOpCodes [Type: byte list]   [Range: 0-255]      [Max: 16 bytes]
   KeyLoopOpCodes  [Type: byte list]   [Range: 0-255]      [Max: 16 bytes]


                  +----------------------------------------+
                  |                WARNING:                |
                  |                                        |
                  |  Do not use these keywords unless you  |
                  |     know exactly what you're doing     |
                  |                                        |
                  |           Incorrect entries            |
                  |    may cause unpredictable results     |
                  +----------------------------------------+


   This feature can make NGX 'anything-aware'. While NGX is waiting for a
   key to be pressed, and before it reads a file entry from the disk (also
   during text search), the IdleLoopOpCodes will be called. By default, an
   Int 28h (idle) is issued.

   By using the .ini file, you can re-program the idle loop (and even the
   key loop if you have reasons to): specify up to 16 (sixteen) bytes of
   i8086 opcodes, in a comma-separated list, to replace the current loop.
   The key loop *must* end with the following code (five bytes):
      sub     ah,ah
      int     16h
      retn
   Registers *must* be preserved, except what follows from the code above
   (i.e. it's ok to change AX and flags OF,SF,ZF,AF,PF,CF).


   Following are the default loops (32 contiguous bytes):

                                   ;even
   KeyLoopOpCodes=b4h,01h,    \    ;@@is: mov   ah,1    ;Key ready?
                  cdh,16h,    \    ;      int   16h
                  75h,05h,    \    ;      jnz   @@yo    ;Yes, get it
                  e8h,07h,00h,\    ;      call  idle    ;Else idle
                  ebh,f5h,    \    ;      jmp   @@is
                  28h,e4h,    \    ;@@yo: sub   ah,ah
                  cdh,16h,    \    ;      int   16h     ;Get key pressed
                  c3h              ;      retn          ;$-@@is = 16 bytes
  IdleLoopOpCodes=cdh,28h,    \    ;idle: int   28h     ;DOS idle
                  c3h,        \    ;      retn
                  87h,dbh,    \    ;      xchg  bx,bx
                  87h,dbh,    \    ;      xchg  bx,bx
                  87h,dbh,    \    ;      xchg  bx,bx
                  87h,dbh,    \    ;      xchg  bx,bx
                  87h,dbh,    \    ;      xchg  bx,bx
                  87h,dbh,    \    ;      xchg  bx,bx
                  c3h              ;      retn          ;$-idle = 16 bytes


   Note: It's recommended you test this feature before using it.


   ; Following is a 'nothing-aware' loop that can be used for maximum speed
   ; if other programs needn't be notified of any idle time:
   KeyLoopOpCodes  = 28h,e4h,cdh,16h,c3h        ;Wait for and get user key
   IdleLoopOpCodes = c3h                        ;Return immediately


   ; Following is DOS idle (int 28h), and
   ;  'Release time-slice' (OS/2, Windows enhanced mode):
   IdleLoopOpCodes = cdh,28h,     \     ;int    28h
                     b8h,80h,16h, \     ;mov    ax,1680h
                     cdh,2fh,     \     ;int    2fh           ;DOS 3.1+
                     c3h                ;retn

   ; Following is TopView or DesqView 'Give up CPU'
   ; Note: Under DesqView, the current time-slice is set to expire at
   ;       the next clock tick rather than immediately if NGX is in-
   ;       stalled as a TSR (int 08h hooked).
   IdleLoopOpCodes = b8h,00h,10h, \     ;mov    ax,1000h
                     cdh,15h,     \     ;int    15h
                     c3h                ;retn

   ; Following is Novell Netware: 'Ipx Driver - Relinquish Control'
   IdleLoopOpCodes = 53h,         \     ;push   bx
                     bbh,0ah,00h, \     ;mov    bx,000ah
                     cdh,7ah,     \     ;int    7ah
                     5bh,         \     ;pop    bx
                     c3h                ;retn

See Also: Technical notes

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson