
;************************************************************************
; Read value of the pixel at 100,50 and return value in AX              *
; Use BIOS function READ PIXEL to get the value.                        *
;************************************************************************

X               EQU     [BP+4]          ;Formal parameters on stack
Y               EQU     [BP+6]

        PUBLIC  _BIOS_Pixel_Read

_BIOS_Pixel_Read PROC    NEAR
        PUSH    BP
        MOV     BP,SP
        MOV     CX,X                    ;Load pixel (column)
        MOV     DX,Y                    ;Load raster (row)
        MOV     AH,0DH                  ;Function = READ PIXEL
        INT     10H                     ;Ask BIOS to read the pixel
        XOR     AH,AH                   ;Clear upper bits of AX (since value in
        POP     BP
        RET
_BIOS_Pixel_Read ENDP
