; Reboot.asm ; Starts the machine again. ; ; Whatever put the first instruction in memory does it again, and everything after that ; follows: the boot slot is read, the loader runs, and whatever the configuration names - ; or whatever Once asked for - is what starts. ; ; ---- Why this writes a port ---- ; ; A reset has to work when the system does not. Something that could only be asked for ; through SWI would be unavailable in exactly the case that wants it most, and a program ; that owns the whole machine has no system to ask. So the machine takes it directly, the ; way it takes everything else: a byte out of a port. ; ; It is still a program rather than a shell word, because it is not the shell's business ; and because a word built into the shell is not callable by anything else. ; ; ---- What survives ---- ; ; The disk, and everything written to it. That is what warm means: the machine starts ; again, the world it starts into does not. Nothing here flushes anything, because nothing ; on this machine is held back - a file is on the disk when the write returns. ; ; Written by Anachronaut #Include services.asm #Program #Base 0x4000 start: SETD.0 Saying SWI osPrintString INIA 0x01 OUTA 0x13 ; Not reached. The machine has started over by the time the next instruction would run, ; so anything here is a statement about a machine that no longer exists - but a program ; whose last instruction is an output is one byte from running into whatever follows it, ; and that is not a habit worth keeping. RSTA SWI osExit #Data #Base 0x2000 Saying: "starting again "