Title 'Morrow MD-HD CPM3 command file (9_Aug_84)' ; Morrow MD-HD CPM3 command file ; Rev 1.0 ; Copyright 1984 ; ; This .com file removes the CPM2 rsx. ; .z80 Rev equ 10h Bdos equ 5 Display equ 9 Get_Ver equ 0ch WarmBoot equ 0 Cr equ 0dh Lf equ 0ah Flag_Off equ 8 Address_Off equ 4 Last_Off equ 12h aseg org 100h Cpm3: ld c,Get_Ver ;get version call Bdos ld a,0f0h ;version mask and l ;mask version cp 30h ;check version jp nz,Cpm2 ;jump if not already CP/M 3 ld de,Mesg1 ld c,Display call Bdos jp WarmBoot Cpm2: ld de,Mesg ld c,Display call Bdos 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 jp z,WarmBoot ;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 pop hl ;get flag pointer ld (hl),0ffh ;set remove flag pop hl ;get bdos pointer jr Next_Address ;look for next RSX Not_Found: pop hl ;get bdos pointer pop hl Next_Address: 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 RSX_Name: db 'CPM2' Name_Length equ $-RSX_Name Mesg: db cr,lf,'Leaving CP/M 2.2 compatibility mode.' db cr,lf,'Normal CP/M 3 operation restored.',cr,lf,'$' Mesg1: db cr,lf,'Normal CP/M 3 operation is already enabled.',cr,lf,'$' end