home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / QWIK21.ZIP / QPAGE.INC < prev    next >
Encoding:
Text File  |  1986-12-09  |  2.0 KB  |  40 lines

  1. { Qpage.inc - procedures for changing pages                 ver 2.0, 11-24-86 }
  2. { These procedures are only needed if you intend to use more than one page.   }
  3.  
  4. { QviewPage - changes the page to be displayed              ver 2.0, 11-24-86 }
  5. procedure QviewPage (Page: byte);
  6. begin
  7. Inline(
  8.    $8B/$46/<PAGE         {       MOV   AX,[BP+<Page]    ;Move new page number}
  9.   /$38/$06/>MAXPAGE      {       CMP   [>MaxPage],AL    ;If page>MaxPage ...}
  10.   /$78/$08               {       JS    Exit             ;  exit.}
  11.   /$84/$C0               {       TEST  AL,AL            ;If page<0 ...}
  12.   /$78/$04               {       JS    Exit             ;  exit.}
  13.   /$B4/$05               {       MOV   AH,$05           ;To select page}
  14.   /$CD/$10               {       INT   $10              ;Change view page}
  15.                          {Exit:}
  16. );
  17. end;
  18.  
  19. { QwritePage - changes the page to be written by Q          ver 2.0, 11-24-86 }
  20. { All Q utilities only write to the page defined by this procedure.  The
  21.   default is page 0 and you should usually end your programs on page 0. }
  22. procedure QwritePage (Page: byte);
  23. begin
  24. Inline(
  25.    $8B/$46/<PAGE         {       MOV   AX,[BP+<Page]    ;Move new page number}
  26.   /$38/$06/>MAXPAGE      {       CMP   [>MaxPage],AL    ;If page>MaxPage ...}
  27.   /$78/$18               {       JS    Exit             ;  exit.}
  28.   /$84/$C0               {       TEST  AL,AL            ;If page<0 ...}
  29.   /$78/$14               {       JS    Exit             ;  exit.}
  30.   /$31/$C9               {       XOR   CX,CX            ;Set CX=0}
  31.   /$8E/$C1               {       MOV   ES,CX            ;Set ES=0}
  32.   /$26/$F7/$26/$4C/$04   {       ES:   MUL WO[$044C]    ;AX*(bytes/page)}
  33.   /$B1/$04               {       MOV   CL,$04           ;Set counter}
  34.   /$D3/$E8               {       SHR   AX,CL            ;Divide AX by 16}
  35.   /$03/$06/>PAGE0SEG     {       ADD   AX,[>Page0seg]   ;Add display segment}
  36.   /$A3/>QSEG             {       MOV   [>Qseg],AX       ;Segment for Q utils}
  37.                          {Exit:}
  38. );
  39. end;
  40.