;  DDTapeMc.mu -- top-level microprogram for Alto's with DD tape controllers
;  Copyright Xerox Corporation 1980

; Last modified March 3, 1981  12:07 PM by Tim Diebert

#AltoConsts23.mu;	Get from [Maxc2]<ALTOSOURCE>AltoConsts23.mu

; Predefinitions for task starting locations and emulator-level
; subroutine entry points.

%0, 1777, 0, EXITRAM;		Emulator task start
%0, 1777, 5, Tape;			Tape Read task start
%0, 1777, 6, WriteTask;		Tape Write task start
%0, 1777, 20, START;		(See below)
%0, 1777, 22, LOC22;		SetBLV subroutine

%0, 1777, 37, TRAP1;		RamTrap Location for BcplRunTime

; There is a hack in the read microcode that causes the reset location
; for task 16 to be used.  This means that it is not possible to run
; task 16 (= Diablo disk word task) in the Ram.


; Lock out the Ram Utility Area

%7, 1777, 774, RU774, RU775, RU776, RU777, RU1000, RU1001, RU1002, RU1003;

RU774:	NOP;
RU775:	NOP;
RU776:	NOP;
RU777:	NOP;
RU1000:	NOP;
RU1001:	NOP;
RU1002:	NOP;
RU1003:	NOP;

; Stuff lifted from EmulatorDefs.mu:
; Standard R-registers usable by the emulator task

$AC3		$R0;	Accumulators
$AC2		$R1;
$AC1		$R2;
$AC0		$R3;
$NWW		$R4;	New wakeups waiting (communication between tasks)
$SAD		$R5;	Temporary private to emulator
$PC		$R6;	Program Counter for emulated Nova
$XREG		$R7;	Temporary private to emulator.
;			Contains instruction LCY 8 upon dispatch to TRAP1.
$XH		$R10;	Temporary private to emulator
$MTEMP	$R25;	Temporary usable by any task
$DWAX		$R35;	Temporary private to emulator
$MASK		$R36;	Temporary private to emulator

$LREG		$R40;	Another name for the M-register


;***THIS INSTRUCTION WILL CAUSE THE BOOT-LOCUS-VECTOR TO BE
;*** SET TO THE VALUE IN AC0 AT THE NEXT BOOT

LOC22:	RMR←AC0,:EXITRAM;


;***THIS CODE IS CAREFULLY PLACED IN THE RAM
;***FOR AN EMULATOR "NO-OP BOOT".
;***THE LSB OF THE BOOT-LOCUS-VECTOR MUST BE 0 FOR THIS TO WORK
;
EXITRAM: SWMODE;	GO TO LOCATION 20 IN THE RAM, AND THEN
START:	:START;		RETURN TO LOCATION 20 IN THE ROM



#DDTapeDefs.mu;
#DDTapeReadTask.mu;
#DDTapeWriteTask.mu;

#DDTapeRamTrap.mu;	From [MAXC2]<AltoSource>BcplRuntimeSource.dm
#GetFrame.mu;		From [MAXC2]<AltoSource>BcplRuntimeSource.dm
#BcplUtil.mu;		From [MAXC2]<AltoSource>BcplRuntimeSource.dm
#IfsPupChecksum.mu;	From [IVY]<Ifs>IfsPupChecksum.mu
#BlockEq.mu;		From [MAXC2]<AltoSource>CopyDisk.dm