home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / CLIPINT.ZIP / INTDEMO.PRG < prev    next >
Encoding:
Text File  |  1987-05-16  |  2.6 KB  |  99 lines

  1. ** Note that INTR is a function (at the end of this, that calls INTERRUPT)
  2. ** INTR converts the 8 "8-bit valued variables" and converts them into 16-bits
  3. ** Note that all INTR are in the form of:
  4. **   INTR(i#,ah,al,bh,bl,ch,cl,dh,dl)
  5. **
  6.  
  7. ** Scrolling demo
  8. *****************************************************************
  9. *****************************************************************
  10.  
  11. for i = 1 to 10
  12.    @ i+7,9 say "There's the scrolling bit - up, down, up, etc..."
  13. next i
  14.  
  15. for i = 1 to 5
  16.    for j = 1 to 7
  17.       INTR(16,07,01,07,00,00,00,24,79)     && Scroll down
  18.    next j
  19.  
  20.    for j = 1 to 7
  21.       INTR(16,06,01,07,00,00,00,24,79)     && Scroll up
  22.    next j
  23. next i
  24.  
  25. ** Clearscreen demo
  26. *****************************************************************
  27. *****************************************************************
  28. @ 20,10 say "Or we can clear the screen rather quickly"
  29. wait
  30.  
  31. INTR(16,07,00,07,00,00,00,24,79)           && Clear the screen
  32.  
  33.  
  34. ** Stuff demo
  35. *****************************************************************
  36. *****************************************************************
  37.  
  38. stuff = INTR(17,00,00,00,00,00,00,00,00)
  39. ? "You could disassemble ",stuff," to determine monitor type,RAM,printers,etc"
  40. ? "Sorry, I'm too lazy"
  41. ?
  42. ?
  43. stuff = INTR(18,00,00,00,00,00,00,00,00)
  44. ? "It says you have",ltrim(str(stuff)),"K of regular RAM"
  45.  
  46. INTR(20,00,131,00,00,00,00,01,00)
  47. ? "Your COM port 1 is initialized to 8-N-1 (big deal, huh)"
  48. ?
  49. ?
  50. inkey(2)
  51.  
  52.  
  53. ? "If you've a mono monitor, hit ALT-C here 'cuz it won't work"
  54. wait
  55.  
  56.  
  57. INTR(16,07,00,07,00,00,00,24,79)           && Clear the screen
  58.  
  59. INTR(16,00,06,00,00,00,00,00,00)           && Go into graphics mode
  60.  
  61. for i = 20 to 600 step 20
  62.    for j = 1 to 200 step int(i/5)+1
  63.       interrupt(16,3073,0,i,j)                  && It's easier calling the ASM
  64.       interrupt(16,3073,0,i+10,200-j)           &&  function directly
  65.       interrupt(16,3073,0,600-i,j)
  66.       interrupt(16,3073,0,600-i+10,200-j)
  67.    next j
  68. next i
  69. INKEY(0)
  70.  
  71.  
  72. INTR(16,00,02,00,00,00,00,00,00)           && Go into text mode
  73.  
  74.  
  75. @ 3,3 say "I think you get the point"
  76.  
  77. return
  78.  
  79.  
  80. *****************************************************************
  81. *****************************************************************
  82. && Executes the interrupt specified in int_num
  83.  
  84. function INTR
  85. parameters int_num,ah,al,bh,bl,ch,cl,dh,dl
  86. private ax,bx,cx,dx
  87.  
  88. ax = ah*256+al          && Join the highs and lows to form the x's
  89. bx = bh*256+bl
  90. cx = ch*256+cl
  91. dx = dh*256+dl
  92.  
  93. return interrupt(int_num,ax,bx,cx,dx)
  94. *****************************************************************
  95.  
  96.  
  97.  
  98.  
  99.