home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GRIPS 2: Government Rast…rocessing Software & Data
/
GRIPS_2.cdr
/
dos
/
imdisp
/
source
/
paradise.asm
< prev
next >
Wrap
Assembly Source File
|
1991-01-03
|
6KB
|
282 lines
.MODEL LARGE
.CODE
PUBLIC _WriteLinePAR
_WriteLinePAR PROC
push bp
mov bp,sp
push ds ;microsoft requires these registers be
push si ;maintained across all calls; all other
push di ;registers can be modified freely
;bp+6 is dummy variable hue
mov bx, [bp+6] ;x1 - beginning column
mov cx, [bp+8] ;# of samples
mov dx, [bp+10] ;y - screen row
mov ax, [bp+12] ;segment of buffer
mov si,ax
mov ax, [bp+14] ;offset of buffer
mov ds,ax
mov ax, 0a000h
mov es,ax
mov ax,640
mov bx, [bp+10]
mov cx,[bp+6]
mul bx
add ax,cx
jnc smmall1
inc dx
smmall1:
mov bx,dx
mov dx,ax
mov cl,4
shl ax,cl
shr ax,cl
mov di,ax
mov cl,12
shr dx,cl
mov cl,4
shl bx,cl
add bx,dx
mov dx, 3ceh
mov al,0fh
mov ah,5
out dx, ax
mov dx, 3ceh
mov al,9h
mov ah, bl
out dx, ax
cld
mov cx,[bp+8]
rep movsb
pop di ;
pop si ;restore registers
pop ds ;
pop bp ;restore stack frame
ret ;return to caller
_WriteLinePAR ENDP
PUBLIC _ClearDisplayPAR
_ClearDisplayPAR PROC
push bp
mov bp,sp
push ds ;microsoft requires these registers be
push si ;maintained across all calls; all other
push di ;registers can be modified freely
mov bx, [bp+6]
mov dx, 3ceh
mov al,0fh
mov ah,5
out dx, ax
mov ax,0a000h
mov es,ax
mov dx,3ceh
mov si,bx
mov bl,0
outer_loop:
mov al,9h
mov ah, bl
out dx, ax
cld
mov di,0
mov ax,si
xor ah,ah
mov cx,8000h
rep stosb
add bl,8h
cmp bl,80h
jnz outer_loop
pop di ;
pop si ;restore registers
pop ds ;
pop bp ;restore stack frame
ret ;return to caller
_ClearDisplayPAR ENDP
PUBLIC _ReadLinePAR
_ReadLinePAR PROC
push bp
mov bp,sp
push ds ;microsoft requires these registers be
push si ;maintained across all calls; all other
push di ;registers can be modified freely
;bp+6 is dummy variable hue
mov bx, [bp+6] ;x1 - beginning column
mov cx, [bp+8] ;# of samples
mov dx, [bp+10] ;y - screen row
mov ax, [bp+12] ;segment of buffer
mov di,ax
mov ax, [bp+14] ;offset of buffer
mov es,ax
mov ax, 0a000h
mov ds,ax
mov ax,640
mov bx, [bp+10]
mov cx,[bp+6]
mul bx
add ax,cx
jnc smmall2
inc dx
smmall2:
mov bx,dx
mov dx,ax
mov cl,4
shl ax,cl
shr ax,cl
mov si,ax
mov cl,12
shr dx,cl
mov cl,4
shl bx,cl
add bx,dx
mov dx, 3ceh
mov al,0fh
mov ah,5
out dx, ax
mov dx, 3ceh
mov al,9h
mov ah, bl
out dx, ax
cld
mov cx,[bp+8]
rep movsb
pop di ;
pop si ;restore registers
pop ds ;
pop bp ;restore stack frame
ret ;return to caller
_ReadLinePAR ENDP
PUBLIC _ReadPixelPAR
_ReadPixelPAR PROC
push bp
mov bp,sp
push ds ;microsoft requires these registers be
push si ;maintained across all calls; all other
push di ;registers can be modified freely
pushf ; save flags for cld below - mwm 8/27/90
mov bx, [bp+6] ;row
mov cx, [bp+8] ;col
mov ax, [bp+10] ;segment of buffer
mov di,ax
mov ax, [bp+12] ;offset of buffer
mov es,ax
mov ax, 0a000h
mov ds,ax
mov ax,640
mov bx, [bp+6]
mov cx,[bp+8]
mul bx
add ax,cx
jnc smmall3
inc dx
smmall3:
mov bx,dx
mov dx,ax
mov cl,4
shl ax,cl
shr ax,cl
mov si,ax
mov cl,12
shr dx,cl
mov cl,4
shl bx,cl
add bx,dx
mov dx,3ceh
mov al,0fh
mov ah,5
out dx, ax
mov dx, 3ceh
mov al,9h
mov ah, bl
out dx, ax
cld
movsb
popf ; restore flags - mwm 8/27/90
pop di ;
pop si ;restore registers
pop ds ;
pop bp ;restore stack frame
ret ;return to caller
_ReadPixelPAR ENDP
public _WritePixelPAR
_WritePixelPAR PROC
push bp
mov bp,sp
push ds ;microsoft requires these registers be
push si ;maintained across all calls; all other
push di ;registers can be modified freely
mov bx, [bp+6] ;screen row
mov cx, [bp+8] ;screen column
mov dx, [bp+10] ;value
mov ax, 0a000h
mov es,ax
mov ax,640
mov bx, [bp+6]
mov cx,[bp+8]
mul bx
add ax,cx
jnc smmall4
inc dx
smmall4:
mov bx,dx
mov dx,ax
mov cl,4
shl ax,cl
shr ax,cl
mov di,ax
mov cl,12
shr dx,cl
mov cl,4
shl bx,cl
add bx,dx
mov dx, 3ceh
mov al,0fh
mov ah,5
out dx, ax
mov dx, 3ceh
mov al,9h
mov ah, bl
out dx, ax
cld
mov ax,[bp+10]
xor ah,ah
stosb
pop di ;
pop si ;restore registers
pop ds ;
pop bp ;restore stack frame
ret ;return to caller
_WritePixelPAR ENDP
END