REM > SOURCE2 REM Load Acorn CPM tracks from disk REM 25-Feb-1992 : Initial version - MOS 0.55 doesn't have MULTI7F : A%=0:X%=1:os%=(USR&FFF4 AND &FF00)DIV256:IFos%=6 AND PAGE>&8000:PRINT"Running Z80...":LOADATN "OS_GetEnv" TO A$:OSCLI"Z80 "+MID$(A$,INSTR(A$," ",1+INSTR(A$," "))):END IF?&FFF7=&6C:A$=$&600 ELSE A$="" unix%=os%=8:quit%=?&80<>0:?&80=0 ON ERROR REPORT:PRINT" at line ";ERL:END asm$="^.AsmZ80_402" DIM mcode% &800:start%=&100:ver$="0.01":name$="CPM" : IF?&FFF7<>&C3:OSCLI"Key0 "+A$+"|M"+name$+"|M":OSCLI"FX138,0,192":CHAINasm$ : OSWORD=&FFF1:CLICOM=&FFB9:PR_TEXT=&FFB3:OSNEWL=&FFE7 : FOR P=0 TO 1 P%=start%:O%=mcode% [OPT P*3+4 JR NZ,P%+3:POP AF :\ Realign stack CALL PR_TEXT DEFM "Looking for CPM on drive 0...":NOP LD HL,Load_00:CALL LoadSectors LD HL,&EB00:LD DE,&EAF0 LD BC,&F0:LDIR :\ Move code to remove DFS data LD HL,&EBF0:LD DE,&EBE0 LD BC,&600:LDIR :\ Move CALL Load_CCP_BDOS LD A,(&D400) :\ Get first byte of CCP CP &C3:JP Z,&EA00 :\ A jump, so enter BIOS at COLD_E CALL OSNEWL JP CLICOM :\ Not a jump, so exit to CLI : .Load_CCP_BDOS LD HL,Load_08:Call LoadSectors :\ Load 00/8-00/9 -> &D400-&D5FF LD HL,Load_10:CALL LoadSectors :\ Load 01/0-01/9 -> &D600-&DFFF LD HL,Load_20 :\ Load 02/0-02/9 -> &E000-&E9FF .LoadSectors LD A,&7F:JP OSWORD : .Load_00 DEFB 0 :\ Drive 0 DEFW &E9F0:DEFW 0 :\ Addr=&E9F0 DEFB 3:DEFB &53 :\ READ DEFB 0:DEFB 0 :\ Sector 00/0 DEFB &28 :\ Eight sectors DEFB &FF : .Load_08 DEFB 0 :\ Drive 0 DEFW &D400:DEFW 0 :\ Addr=&D400 DEFB 3:DEFB &53 :\ READ DEFB 0:DEFB 8 :\ Sector 00/8 DEFB &22 :\ Two sectors DEFB &FF : .Load_10 DEFB 0 :\ Drive 0 DEFW &D600:DEFW 0 :\ Addr=&D600 DEFB 3:DEFB &53 :\ READ DEFB 1:DEFB 0 :\ Sector 01/0 DEFB &2A :\ Ten sectors DEFB &FF : .Load_20 DEFB 0 :\ Drive 0 DEFW &E000:DEFW 0 :\ Addr=&E000 DEFB 3:DEFB &53 :\ READ DEFB 2:DEFB 0 :\ Sector 02/0 DEFB &2A :\ Ten sectors DEFB &FF : ]NEXT : IFunix%:name$=name$+",240" A$="*Save "+name$+" "+STR$~mcode%+" "+STR$~O%+" FFFF0000 "+STR$~(&FFF20000 OR start%) PRINT A$:IFquit%:OSCLI A$:*Quit