Title 'Morrow MD-HD CPM2 emulation message file (9_Aug_84)' ; Morrow MD-HD CPM2 emulation message file ; Rev 1.0 ; Copyright 1984 ; ; This .com file is combined with the CPM20.RSX to form ; the CPM2.COM command. ; .z80 Rev equ 10h Bdos equ 5 Display equ 9 WarmBoot equ 0 Cr equ 0dh Lf equ 0ah Asc0 equ 30h Flag_Off equ 8 Address_Off equ 4 Last_Off equ 12h aseg org 100h Cpm2: ld hl,(Bdos+1) ;get bdos address Next_RSX: push hl ;save bdos address ld de,Last_Off ;offset to last RSX flag add hl,de ld a,(hl) ;get last RSX flag pop hl ;restore bdos address cp 0ffh ;see if last RSX jr z,Last_RSX ;all RSX's have been found push hl ld de,Flag_Off ;offset to flag add hl,de ;add offset push hl ;save flag pointer inc hl ;set pointer to RSX name inc hl ld de,RSX_Name ;pointer to desired RSX name ld b,Name_Length ;length of name Name_Loop: ld a,(de) ;get character from name cp (hl) ;compare to RSX jr nz,Not_Found ;jump if no match inc hl inc de djnz Name_Loop ;loop 'til complete match ld a,(Dup_RSX) ;get duplicate RSX count inc a ;increment count ld (Dup_RSX),a ;save count cp 1 ;see if first RSX jr nz,Not_Found ;jump if not first pop hl ;get flag pointer ld (First_Flag),hl ;save address of first RSX's flag jr Next_Address Not_Found: pop hl ;get bdos pointer Next_Address: pop hl ld de,Address_Off ;offset to address of next RSX add hl,de ld e,(hl) ;get address of next RSX inc hl ld d,(hl) ex de,hl jr Next_RSX ;look for next RSX Last_RSX: ld a,(Dup_RSX) ;get RSX count cp 1 ;see if one only jr nz,Extra_RSX ;jump if too many RSX's ld de,Mesg Return: ld c,Display call Bdos jp WarmBoot Extra_RSX: ld hl,(First_Flag) ;get flag pointer ld (hl),0ffh ;set flag to remove RSX ld de,Mesg1 jr Return RSX_Name: db 'CPM2' Name_Length equ $-RSX_Name Dup_RSX: db 0 First_Flag: dw 0 Mesg: db cr,lf,'Entering CP/M 2.2 compatibility mode.',cr,lf db 'Revision ',((Rev and 0f0h) shr 4)+Asc0,'.',(Rev and 0fh)+Asc0 db cr,lf,'$' Mesg1: db cr,lf,'CP/M 2.2 compatibility mode is already enabled.',cr,lf,'$' end