home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Science / Science.zip / imdisp79.zip / PARADISE.ASM < prev    next >
Assembly Source File  |  1992-11-29  |  6KB  |  287 lines

  1. .MODEL  LARGE
  2.  
  3. ifdef _286
  4. .286
  5. endif
  6.  
  7. .CODE
  8.  
  9.       PUBLIC  _WriteLinePAR
  10. _WriteLinePAR  PROC
  11.       push    bp
  12.       mov     bp,sp
  13.  
  14.       push ds             ;microsoft requires these registers be
  15.       push si             ;maintained across all calls; all other
  16.       push di             ;registers can be modified freely
  17.                           ;bp+6 is dummy variable hue
  18.       mov bx, [bp+6]      ;x1 - beginning column
  19.       mov cx, [bp+8]      ;# of samples
  20.       mov dx, [bp+10]     ;y  - screen row
  21.       mov ax, [bp+12]     ;segment of buffer
  22.       mov si,ax
  23.       mov ax, [bp+14]     ;offset of buffer
  24.       mov ds,ax
  25.       mov ax, 0a000h
  26.       mov es,ax
  27.       mov ax,640
  28.       mov bx, [bp+10]
  29.       mov cx,[bp+6]
  30.       mul bx
  31.       add ax,cx
  32.       jnc smmall1
  33.       inc dx
  34. smmall1:
  35.       mov bx,dx
  36.       mov dx,ax
  37.       mov cl,4
  38.       shl ax,cl
  39.       shr ax,cl
  40.       mov di,ax
  41.       mov cl,12
  42.       shr dx,cl
  43.       mov cl,4
  44.       shl bx,cl
  45.       add bx,dx
  46.       mov dx, 3ceh
  47.       mov al,0fh
  48.       mov ah,5
  49.       out dx, ax
  50.       mov dx, 3ceh
  51.       mov al,9h
  52.       mov ah, bl
  53.       out dx, ax
  54.       cld
  55.       mov cx,[bp+8]
  56. rep   movsb
  57.  
  58.  
  59.         pop di              ;
  60.         pop si              ;restore registers
  61.         pop ds              ;
  62.         pop bp              ;restore stack frame
  63.         ret                 ;return to caller
  64.  
  65. _WriteLinePAR ENDP
  66.  
  67.  
  68.  
  69.         PUBLIC _ClearDisplayPAR
  70. _ClearDisplayPAR  PROC
  71.         push    bp
  72.         mov     bp,sp
  73.  
  74.         push ds             ;microsoft requires these registers be
  75.         push si             ;maintained across all calls; all other
  76.         push di             ;registers can be modified freely
  77.       mov bx, [bp+6]
  78.       mov dx, 3ceh
  79.       mov al,0fh
  80.       mov ah,5
  81.       out dx, ax
  82.       mov ax,0a000h
  83.       mov es,ax
  84.       mov dx,3ceh
  85.       mov si,bx
  86.       mov bl,0
  87. outer_loop:
  88.       mov al,9h
  89.       mov ah, bl
  90.       out dx, ax
  91.       cld
  92.       mov di,0
  93.       mov ax,si
  94.       xor ah,ah
  95.       mov cx,8000h
  96.       rep stosb
  97.       add bl,8h
  98.       cmp bl,80h
  99.       jnz outer_loop
  100.  
  101.         pop di              ;
  102.         pop si              ;restore registers
  103.         pop ds              ;
  104.         pop bp              ;restore stack frame
  105.         ret                 ;return to caller
  106.  
  107. _ClearDisplayPAR ENDP
  108.  
  109.  
  110.  
  111.         PUBLIC  _ReadLinePAR
  112. _ReadLinePAR PROC
  113.         push    bp
  114.         mov     bp,sp
  115.  
  116.         push ds             ;microsoft requires these registers be
  117.         push si             ;maintained across all calls; all other
  118.         push di             ;registers can be modified freely
  119.                             ;bp+6 is dummy variable hue
  120.         mov bx, [bp+6]      ;x1 - beginning column
  121.         mov cx, [bp+8]      ;# of samples
  122.         mov dx, [bp+10]     ;y  - screen row
  123.         mov ax, [bp+12]     ;segment of buffer
  124.         mov di,ax
  125.         mov ax, [bp+14]     ;offset of buffer
  126.         mov es,ax
  127.         mov ax, 0a000h
  128.        mov ds,ax
  129.       mov ax,640
  130.       mov bx, [bp+10]
  131.       mov cx,[bp+6]
  132.       mul bx
  133.       add ax,cx
  134.       jnc smmall2
  135.       inc dx
  136. smmall2:
  137.       mov bx,dx
  138.       mov dx,ax
  139.       mov cl,4
  140.       shl ax,cl
  141.       shr ax,cl
  142.       mov si,ax
  143.       mov cl,12
  144.       shr dx,cl
  145.       mov cl,4
  146.       shl bx,cl
  147.       add bx,dx
  148.       mov dx, 3ceh
  149.       mov al,0fh
  150.       mov ah,5
  151.       out dx, ax
  152.       mov dx, 3ceh
  153.       mov al,9h
  154.       mov ah, bl
  155.       out dx, ax
  156.       cld
  157.       mov cx,[bp+8]
  158. rep   movsb
  159.  
  160.  
  161.         pop di              ;
  162.         pop si              ;restore registers
  163.         pop ds              ;
  164.         pop bp              ;restore stack frame
  165.         ret                 ;return to caller
  166.  
  167. _ReadLinePAR ENDP
  168.  
  169.  
  170.  
  171.         PUBLIC  _ReadPixelPAR
  172. _ReadPixelPAR PROC
  173.         push    bp
  174.         mov     bp,sp
  175.  
  176.         push ds             ;microsoft requires these registers be
  177.         push si             ;maintained across all calls; all other
  178.         push di             ;registers can be modified freely
  179.            pushf               ; save flags for cld below - mwm 8/27/90
  180.         mov bx, [bp+6]      ;row
  181.         mov cx, [bp+8]      ;col
  182.         mov ax, [bp+10]     ;segment of buffer
  183.         mov di,ax
  184.         mov ax, [bp+12]     ;offset of buffer
  185.         mov es,ax
  186.         mov ax, 0a000h
  187.         mov ds,ax
  188.         mov ax,640
  189.         mov bx, [bp+6]
  190.         mov cx,[bp+8]
  191.         mul bx
  192.       add ax,cx
  193.       jnc smmall3
  194.       inc dx
  195. smmall3:
  196.       mov bx,dx
  197.       mov dx,ax
  198.       mov cl,4
  199.       shl ax,cl
  200.       shr ax,cl
  201.       mov si,ax
  202.       mov cl,12
  203.       shr dx,cl
  204.       mov cl,4
  205.       shl bx,cl
  206.       add bx,dx
  207.       mov dx,3ceh
  208.       mov al,0fh
  209.       mov ah,5
  210.       out dx, ax
  211.       mov dx, 3ceh
  212.       mov al,9h
  213.       mov ah, bl
  214.       out dx, ax
  215.       cld
  216.       movsb
  217.  
  218.  
  219.         popf                ; restore flags - mwm 8/27/90
  220.         pop di              ;
  221.         pop si              ;restore registers
  222.         pop ds              ;
  223.         pop bp              ;restore stack frame
  224.         ret                 ;return to caller
  225.  
  226. _ReadPixelPAR ENDP
  227.  
  228.  
  229.  
  230. public _WritePixelPAR
  231. _WritePixelPAR PROC
  232.         push    bp
  233.         mov     bp,sp
  234.  
  235.         push ds             ;microsoft requires these registers be
  236.         push si             ;maintained across all calls; all other
  237.         push di             ;registers can be modified freely
  238.         mov bx, [bp+6]      ;screen row
  239.         mov cx, [bp+8]      ;screen column
  240.         mov dx, [bp+10]     ;value
  241.         mov ax, 0a000h
  242.         mov es,ax
  243.         mov ax,640
  244.         mov bx, [bp+6]
  245.         mov cx,[bp+8]
  246.         mul bx
  247.         add ax,cx
  248.         jnc smmall4
  249.         inc dx
  250. smmall4:
  251.       mov bx,dx
  252.       mov dx,ax
  253.       mov cl,4
  254.       shl ax,cl
  255.       shr ax,cl
  256.       mov di,ax
  257.       mov cl,12
  258.       shr dx,cl
  259.       mov cl,4
  260.       shl bx,cl
  261.       add bx,dx
  262.       mov dx, 3ceh
  263.       mov al,0fh
  264.       mov ah,5
  265.       out dx, ax
  266.       mov dx, 3ceh
  267.       mov al,9h
  268.       mov ah, bl
  269.       out dx, ax
  270.       cld
  271.       mov ax,[bp+10]
  272.       xor ah,ah
  273.       stosb
  274.  
  275.  
  276.         pop di              ;
  277.         pop si              ;restore registers
  278.         pop ds              ;
  279.         pop bp              ;restore stack frame
  280.         ret                 ;return to caller
  281.  
  282. _WritePixelPAR ENDP
  283.  
  284.  
  285.  
  286. END
  287.