home *** CD-ROM | disk | FTP | other *** search
- ; assembly language support routines
-
- _DATA segment word public 'DATA'
- ; str db 9,9,"r=%d,c=%d,color=0x%02X",10,0
- _DATA ends
-
- DGROUP group _DATA
-
- ; extrn _printf:near
-
- _TEXT segment byte public 'CODE'
- assume cs:_TEXT, ds:DGROUP
-
- ;void Dot( int color, int pixrow, int pixcol );
- public _Dot
- _Dot proc ; write a dot on the screen
- push bp
- mov bp,sp
-
- mov al,[bp+4] ; get color (byte)
- mov ah,0Ch ; write pixel
- mov dx,[bp+6] ; get row
- mov cx,[bp+8] ; get column
- int 10h ; call video rom bios
- pop bp
- ret
- _Dot endp
-
- ;int GetMode( void );
- public _GetMode
- _GetMode proc ; get the screen mode
- mov ah,0Fh ; get mode function
- int 10h ; call video rom bios
- xor ah,ah ; clear top byte (low byte has mode)
- ret
- _GetMode endp
-
- ;void SetMode( int newmode );
- public _SetMode
- _SetMode proc ; set the screen mode
- push bp
- mov bp,sp
- mov al,[bp+4] ; get new mode
- xor ah,ah ; set mode function
- int 10h ; call video rom bios
- pop bp
- ret
- _SetMode endp
-
- _TEXT ends
- end
-