home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progc
/
ce331src.arj
/
BIOS.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-11-24
|
2KB
|
91 lines
page 60,132
title BIOS - Assembler BIOS calls for CodEd
;
; B I O S . A S M
;
; purpose:
; Assembler level function calls for CodEd
;
; modification log:
; 7/14/88 John W. Grothman
; 2/7/89 jwg - mod for MASM 5.1
; 1/4/90 jwg - mod PcGetC for either the extended keyboard (EKBD
; defined) or the original keyboard (OKBD defined)
; 10/7 jwg - back to the C model
;
.MODEL LARGE,C
.CODE
CTRL equ 1 ;MUST equal high byte of 'CTRL' #define in struct.h
SPEC equ 8 ;MUST equal high byte of 'SPEC' #define in struct.h
public PcGetC, PcPutC, PcMove
PcGetC proc
IFDEF EKBD
mov ah,16 ;extended keyboard read
int 16h ;call keyboard BIOS
cmp al,0 ;main byte = 0?
jne chk4e0
cmp ah,3 ;aux. byte = 3?
jne addspec
xor ax,ax ;restore NUL's original value
jmp short getout
chk4e0: cmp al,0e0h ;main byte = E0?
jne normchar
cmp ah,0 ;was E0 real?
jne addspec
mov ax,0e0h ;restore real E0
jmp short getexit ; and return
ENDIF
IFDEF OKBD
mov ah,7 ; DOS direct console input
int 21h
cmp al,0 ; non-ascii char?
jne normchar
mov ah, 7 ; get next aux. byte
int 21h
cmp al,3 ; aux. byte = 3?
jne addspeco
xor ax,ax ; restore NUL's original value
jmp short getout
ENDIF
normchar: xor ah,ah ;char was normal, so just return it with
jmp short getout ; no flag bits set (make sure ah = 0)
addspec: mov al,ah ;move aux. byte to main byte
addspeco: mov ah,SPEC
getout: cmp ax,20h ;check for a CTRL char
jae getexit
or al,40h ;offset to CAP letters
mov ah,CTRL
getexit: ret
PcGetC endp
;
PcPutC proc char:BYTE
mov ah,14 ;write char with current attributes
mov al,char ;char to write
int 10h ;call video BIOS
ret
PcPutC endp
;
PcMove proc row:BYTE, col:BYTE
mov ah,2 ;set cursor position
mov dh,row ;row to move to
mov dl,col ;column to move to
mov bh,0 ;video page 0
int 10h ;call video BIOS
ret
PcMove endp
end