home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
COMMS
/
YAMBEE.ARC
/
BEELIB.CSM
< prev
next >
Wrap
Text File
|
1990-09-20
|
2KB
|
113 lines
;
; Beelib MICROBEE machine language functions for YAM.
; Written by Bob Logan 12-Feb-85
; These functions were given to public domain for the good of all.
; Please report any bugs or improvments to me by personal message on
; Tesseract RCPM.
include bds.lib
DELY: equ 139 ;1 m/s delay on a MICROBEE at 3.375Mhz
; function to delay for 1 m/s on a Microbee WITHOUT checking keyboard
FUNCTION milibee
call ma1toh ;get number of milisecs
inx h
sl5: dcx h
mov a,h
ora l
jnz sl5a ;still more delay
ret
sl5a: lxi d,DELY
sl6: dcx d
mov a,d
ora e
jnz sl6
jmp sl5
ENDFUNC
SET3: equ 0E045h ;location of set 300 baud routine
; set 300 baud on bee lobaud()
FUNCTION lobaud
push b
call SET3 ; Rset_300
pop b
ret
ENDFUNC
SET12: equ 0E048h ;location of set 1200 baud routine
; set 1200 baud on bee hibaud()
FUNCTION hibaud
push b
call SET12 ; Rset_1200
pop b
ret
ENDFUNC
PIOBD: equ 2h ; PIO location in bee
; set DTR line for putting modem on line onbee()
FUNCTION onbee
in PIOBD
db 0cbh,0d7h ;simulate (set 2,a)
out PIOBD
ret
ENDFUNC
; set DTR line for putting modem on line offbee()
FUNCTION offbee
in PIOBD
db 0cbh,97h ;simulate (res 2,a)
out PIOBD
ret
ENDFUNC
PTRLOC: equ 0DF68h ;location of first queue pointer
; check if char is available from RS232 queue on bee miready()
FUNCTION miready
xra a ;reset z flag
lhld PTRLOC + 2 ;get second pointer contents
lda PTRLOC ;first part of 1st pointer contents
cmp l
jnz chready
lda PTRLOC + 1 ;2nd part of 1st pointer contents
cmp h
jnz chready
lxi h,0000h ;return false = no char available
ret
chready:lxi h,0101h ;return true if pointers differ
ret ;cause there's a char waiting
ENDFUNC
RSIN: equ 0E030h ;location of input routine
; get char from RS232 queue on bee beein()
FUNCTION beein
push b
call RSIN ; RS_IN
mov l,a
mvi h,0
pop b
ret
ENDFUNC
RSOUT: equ 0E04Bh ;location of output routine
; output char to RS232 port on bee beeout(char)
FUNCTION beeout
call ma1toh ; ma1toh places the char in both A & HL
push b
call RSOUT ; RS_out
pop b
ret
ENDFUNC
;end of file