home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG067.ASM < prev    next >
Assembly Source File  |  1988-05-25  |  1KB  |  32 lines

  1.  
  2. ;************************************************************************
  3. ; Read character code at the cursor position at Row and Col             *
  4. ; Entry: Row,Col  Passed on the stack as integers                       *
  5. ; Exit:  AX       Character code found                                  *
  6. ;************************************************************************
  7.  
  8. Row     EQU     [BP+4]
  9. Col     EQU     [BP+6]
  10.  
  11.         PUBLIC  _BIOS_Read_Char
  12.  
  13. _BIOS_Read_Char PROC NEAR
  14.         PUSH    BP
  15.         MOV     BP,SP
  16.  
  17.         MOV     DH,Row                  ;Set row and column
  18.         MOV     DL,Col
  19.         MOV     BH,0                    ;Select page 0
  20.         MOV     AH,2                    ;Function = Set cursor position
  21.         INT     10H                     ;Ask BIOS to set cursor position
  22.  
  23.         MOV     AH,8                    ;Function = READ CHARACTER & ATTRIBUTE
  24.         MOV     BH,0                    ;from page 0
  25.         INT     10H                     ;Ask BIOS to fetch character
  26.  
  27.         XOR     AH,AH                   ;Clear upper half of AX
  28.  
  29.         POP     BP
  30.         RET
  31. _BIOS_Read_Char ENDP
  32.