(FILECREATED "26-May-85 17:31:40" {DSK}<DSK>HTHOMPSON>DSL>BUSEXTENDER.;4 5534
changes to: (VARS BUSEXTENDERCOMS)
(FNS \MISC2.UFN \MISC1.UFN)
previous date: "15-May-85 19:53:09" {DSK}<DSK>HTHOMPSON>DSL>BUSEXTENDER.;3)
(* Copyright (c) 1984, 1985 by Xerox Corporation. All rights reserved.)
(PRETTYCOMPRINT BUSEXTENDERCOMS)
(RPAQQ BUSEXTENDERCOMS ((FNS BX.INPUT BX.OUTPUT BX.READSTATUS)
(MACROS BX.INPUT BX.OUTPUT)
(* to generate errors on non-1109s)
(FNS \MISC1.UFN \MISC2.UFN)))
(DEFINEQ
(BX.INPUT
[LAMBDA (ADDR) (* ht: "15-May-85 19:48")
(* * return the datum at the BX address = SUA.4-7,,fY.1)
(* * ht put the expansion for \DEVICE.INPUT in by hand instead of defining a macro on the grounds that this way if
the opcode ever changes only BUSMASTER/EXTENDER users are screwed, not random folk who happen to have compiled
something which includes a \DEVICE.INPUT)
((OPCODES MISC1 1)
(IPLUS (LLSH (LOGAND ADDR 30)
3)
(if (LOGAND ADDR 1)=0
then 10
else 9])
(BX.OUTPUT
[LAMBDA (DATUM ADDR) (* ht: "15-May-85 19:48")
(* * write the datum to the BX address = SUA.4-7,,fY.1)
(* * ht put the expansion for \DEVICE.OUTPUT in by hand instead of defining a macro on the grounds that this way if
the opcode ever changes only BUSMASTER/EXTENDER users are screwed, not random folk who happen to have compiled
something which includes a \DEVICE.OUTPUT)
((OPCODES MISC2 2)
DATUM
(IPLUS (LLSH (LOGAND ADDR 30)
3)
(if (LOGAND ADDR 1)=0
then 11
else 0])
(BX.READSTATUS
[LAMBDA NIL (* jmh " 8-Sep-84 15:50")
(* * return FPI.0-3 -- get them from PPort -- have to enable them onto PPort first)
(\DEVICE.OUTPUT 0 14)
(LOGAND 15 (LRSH (\DEVICE.INPUT 7)
4])
)
(DECLARE: EVAL@COMPILE
(PUTPROPS BX.INPUT DMACRO [ARGLIST (PROG (ADDRARG LISTOFADDRVAL ADDRVAL)
[* * The point of this macro is that almost all of the code
of the function can be computed at compile time if the
argument is known at compile time -- The function is --
(\DEVICE.INPUT (IPLUS (LLSH (LOGAND ADDR 30)
3)
(if (ZEROP (LOGAND ADDR 1))
then 10 else 9]
(* * ht put the expansions for \DEVICE.INPUT in by hand
instead of defining a macro on the grounds that this way
if the opcode ever changes only BUSMASTER/EXTENDER users
are screwed, not random folk who happen to have compiled
something which includes a \DEVICE.INPUT)
(SETQ ADDRARG (CAR ARGLIST))
(RETURN (if [AND (SETQ LISTOFADDRVAL (CONSTANTEXPRESSIONP
ADDRARG))
(SMALLP (SETQ ADDRVAL (CAR LISTOFADDRVAL]
then
[BQUOTE ((OPCODES MISC1 1)
,
(IPLUS (LLSH (LOGAND ADDRARG 30)
3)
(if (ZEROP (LOGAND ADDRARG 1))
then 10 else 9]
else
(BQUOTE ((OPCODES MISC1 1)
(IPLUS (LLSH (LOGAND , ADDRARG 30)
3)
(if (ZEROP (LOGAND , ADDRARG 1))
then 10 else 9])
(PUTPROPS BX.OUTPUT DMACRO [ARGLIST (PROG (DATUMARG ADDRARG LISTOFADDRVAL ADDRVAL)
[* * The point of this macro is that almost all of the code
of the function can be computed at compile time if the
argument is known at compile time -- The function is --
(\DEVICE.OUTPUT DATUM
(IPLUS (LLSH (LOGAND ADDR 30)
3)
(if (ZEROP (LOGAND ADDR 1))
then 11 else 0]
(* * ht put the expansions for \DEVICE.OUTPUT in by hand
instead of defining a macro on the grounds that this way
if the opcode ever changes only BUSMASTER/EXTENDER users
are screwed, not random folk who happen to have compiled
something which includes a \DEVICE.OUTPUT)
(SETQ DATUMARG (CAR ARGLIST))
(SETQ ADDRARG (CADR ARGLIST))
(RETURN (if [AND (SETQ LISTOFADDRVAL (CONSTANTEXPRESSIONP
ADDRARG))
(SMALLP (SETQ ADDRVAL (CAR LISTOFADDRVAL]
then
[BQUOTE ((OPCODES MISC2 2)
, DATUMARG ,
(IPLUS (LLSH (LOGAND ADDRARG 30)
3)
(if (ZEROP (LOGAND ADDRARG 1))
then 11 else 0]
else
(BQUOTE ((OPCODES MISC2 2)
, DATUMARG
(IPLUS (LLSH (LOGAND , ADDRARG 30)
3)
(if (ZEROP (LOGAND , ADDRARG 1))
then 11 else 0])
)
(* to generate errors on non-1109s)
(DEFINEQ
(\MISC1.UFN
[LAMBDA (ARG ALPHA) (* ht: "26-May-85 17:20")
(if ALPHA=1
then (ERROR "Attempt to access bus extender option on a machine which does not support it")
else (RAID "Unimplemented MISC1 op" ALPHA])
(\MISC2.UFN
[LAMBDA (ARG0 ARG1 ALPHA) (* ht: "26-May-85 17:22")
(if ALPHA=2
then (ERROR "Attempt to access bus extender option on a machine which does not support it")
else (RAID "Unimplemented MISC2 op" ALPHA])
)
(PUTPROPS BUSEXTENDER COPYRIGHT ("Xerox Corporation" 1984 1985))
(DECLARE: DONTCOPY
(FILEMAP (NIL (525 2090 (BX.INPUT 535 . 1160) (BX.OUTPUT 1162 . 1800) (BX.READSTATUS 1802 . 2088)) (
4859 5447 (\MISC1.UFN 4869 . 5158) (\MISC2.UFN 5160 . 5445)))))
STOP