home *** CD-ROM | disk | FTP | other *** search
- Title - DP - assembler implementation of GRAPHIX routine
-
- include model.h
- include prologue.h
- @CODE ends
-
- @DATAI SEGMENT
-
- extrn ColorGlb:word
- extrn GrafBase:word
-
- __mask db 07Fh, 0BFh, 0DFh, 0EFh, 0F7h, 0FBh, 0FDh, 0FEh
-
- @DATAI ENDS
-
-
- @CODE SEGMENT
-
-
- public DP
-
-
- DPX equ @ab[bp]
- DPY equ @ab+2[bp]
-
-
- DP proc near
-
- push bp ;standard setup
- mov bp,sp
-
- ;compute offset of start of row
-
- mov ax,DPY ;get the row
- mov ah,al ;duplicate in high register
- and ax,01FEh ;mask out unwanted portions
- ; NB: AH = row mod 2
- ; AL = 2 * (row\2)
- sal ax,1 ;*4
- sal ax,1 ;*8
- sal ax,1 ;*16
- mov bx,ax
- and bh,7
- sal ax,1 ;*32
- sal ax,1 ;*64
- add ax,bx
- mov di,ax
-
- ;add offset of start of column and set ES to point to video
-
- mov ax,DPX ;get column number
- mov bx,ax ;duplicate column number
- sar ax,1 ;/2
- sar ax,1 ;/4
- sar ax,1 ;/8
- add di,ax ;add to offset
- mov ax,GrafBase ;set segment register of video map
- mov es,ax ; memory
-
- ;get mask to desired pixel and mask of pixel to insert
-
- and bx,7 ;col mod 8
- mov al,__mask[bx] ;mask to isolate pixel
- mov bl,al ;and construct mask to insert
- not bl ; pixel with colour of
- and bx,ColorGlb ; ColorGlb
-
- ;set pixel
-
- and al,byte ptr es:[di] ;get and mask out pixel
- or al,bl ;insert new pixel
- mov byte ptr es:[di],al ;and store back into the video map
-
- pop bp ;standard return
- ret
-
- DP endp
-
- include epilogue.h
-
- end
-