home *** CD-ROM | disk | FTP | other *** search
/ GRIPS 2: Government Rast…rocessing Software & Data / GRIPS_2.cdr / dos / imdisp / source / paradise.asm < prev    next >
Assembly Source File  |  1991-01-03  |  6KB  |  282 lines

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