// EtherBootCaller.bcpl -- Calls EtherBootLoader
// Copyright Xerox Corporation 1983
// Last modified June 30, 1983  9:23 PM by Boggs

external
[
// outgoing procedure
EtherBoot

// incoming statics
bootLoaderPacket; mayDayPacket
]

//-----------------------------------------------------------------------------------------
let EtherBoot(bfn, nil, pdh, dPort, sPort; numargs na) be
//-----------------------------------------------------------------------------------------
// bfn is the boot file number to request in the mayday packet.
// returnOnFail has been deimplemented.
// pdh is the Ethernet host to which the mayday is sent (default is 0: broadcast).
// dPort is put in the mayday Pup; it overrides pdh.
// sPort is put in the mayday Pup.
[
mayDayPacket!5 = bfn
if na gr 2 then
   [
   mayDayPacket!0 = pdh lshift 8
   mayDayPacket!6 = pdh
   ]
if na gr 3 then MyMoveBlock(mayDayPacket+6, dPort, 3)
if na gr 4 then MyMoveBlock(mayDayPacket+9, sPort, 3)
(table [ 61000b; 1401b ])()  //disable interrupts
for i = 0 to 255 do 1!i = bootLoaderPacket!i  //can't call a procedure!
goto 6
]

//-----------------------------------------------------------------------------------------
and MyMoveBlock(dest, src, cnt) be for i = 0 to cnt-1 do dest!i = src!i
//-----------------------------------------------------------------------------------------