home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
decus
/
RB140
/
grlib03a.arj
/
CXY2CP.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-12-08
|
3KB
|
87 lines
PAGE ,132
title CXY2CP.ASM
;UPDATE HISTORY
;==============
;14 nov 84 Convert to CI86 V2.2
;29 nov 84 adjust list format to 132 width
;27 dec 84 clear DX for big maths
include asmc.h
SEGEND CODE
SEGDEF DATA
include asmd.h
SEGEND DATA
SEGDEF CODE
PUBLIC cxy2cp, a_cur
IF @bigmodel
EXTRN fifo_mt:FAR
ELSE
EXTRN fifo_mt:NEAR
ENDIF
;********************************************************************
;* *
;* f u n c t i o n s cxy2cp() a_cur() *
;* *
;* CXY2CP takes the x_start and y_start values and converts *
;* them to a GDC cursor position and sends it to the GDC. *
;* The computed values are stored at curl0 to curl2. *
;* *
;* A_CUR takes the values at curl0 to curl2 and sends them *
;* to the GDC. *
;* *
;* entry: x_start = x pixel location *
;* y_start = y pixel location *
;* exit: curl0 to curl2 set to GDC cursor values *
;* *
;********************************************************************
PROCDEF cxy2cp
push bx
push cx
push dx
mov cl, BYTE PTR sh_p_lin
mov bx, WORD PTR y_start ;get line number
shl bx, cl ;and convert to a start of line offset
xor dx,dx ;clear DX for 16/32 bit maths
mov ax, WORD PTR x_start
mov cl,4
sar ax, cl ;convert x_start to a WORD offset in ax
add ax, bx ;and leave pixel position in dl.
mov WORD PTR curl0, ax
mov ax, WORD PTR x_start
and ax, 0FH
mov cl,4
shl al, cl ;move pixel value to high nibble.
mov BYTE PTR curl2, al
call a_cur
pop dx
pop cx
pop bx
ret
PROCEND cxy2cp
PROCDEF a_cur
call fifo_mt
mov al,49H ;set cursor location to that in curl0,1,2
out 57H,al ;issue the GDC cursor location command
mov ax,WORD PTR curl0 ;fetch WORD low address
out 56H,al
mov al,ah ;middle address
out 56H,al
mov al,BYTE PTR curl2 ;dot address [top 4 bits] and highDW addr
out 56H,al
ret
PROCEND a_cur
include epilogue.h
END