home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug097.arc
/
SPEED.MAC
< prev
next >
Wrap
Text File
|
1979-12-31
|
2KB
|
125 lines
;
;
; 512k Operating system support program.
; CPU speed switcher.
;
;
bdos equ 5
cr equ 13
lf equ 10
tab equ 9
bell equ 7
command_line equ 80h
bios_start equ 0E700h
id equ 218h
id_val equ 0AA55h
speed_flag equ 28Dh
speed_port equ 9
speed_bit equ 2
aseg
org 100h
ld de,start_mesg
ld c,9
call bdos
ld hl,(bios_start+id)
ld de,id_val
or a
sbc hl,de
jr nz,get_lost
ld de,use_mesg
ld hl,command_line
ld a,(hl)
or a
jr z,prt_ret
ld b,a
parse:
inc hl
ld a,(hl)
cp '?'
jr z,show_speed
or 'a'-'A'
cp 'f'
jr z,set_fast
cp 's'
jr z,set_slow
djnz parse
jr prt_ret
set_fast:
ld hl,fast_mesg
ld a,0FFh
jr set_speed
set_slow:
ld hl,slow_mesg
xor a
set_speed:
ld (bios_start+speed_flag),a
and speed_bit
in a,(speed_port)
ld de,speed_mesg_loc
ld bc,5
ldir
ld de,speed_mesg
jr prt_ret
show_speed:
ld a,(bios_start+speed_flag)
ld hl,fast_mesg
or a
jr nz,ss_1
ld hl,slow_mesg
ss_1:
ld de,show_mesg_loc
ld bc,5
ldir
ld de,show_mesg
jr prt_ret
get_lost:
ld de,wb_mesg
prt_ret:
ld c,9
call bdos
ret
start_mesg:
db cr,lf,'Microbee 512k Enhanced Operating System v2.2,'
db ' (c) 1987 Peter Broughton.',cr,lf
db 'SPEED : CPU speed switcher (requires hardware).',cr,lf,lf,'$'
wb_mesg:
db bell,'Wrong operating system !!',cr,lf,lf,'$'
use_mesg:
db 'Use : SPEED F(ast)/S(low)/?(query).',cr,lf,lf,'$'
speed_mesg:
db 'CPU speed now set to '
speed_mesg_loc:
db '42.00 MHz.',cr,lf,lf,'$'
show_mesg:
db 'CPU speed currently '
show_mesg_loc:
db '42.00 MHz.',cr,lf,lf,'$'
fast_mesg:
db '6.75',0
slow_mesg:
db '3.375'
if ($ and 7Fh) ne 0
ds 80h-($ and 7Fh)
endif
end