% Hey Emacs, this is -*- LaTeX -*- mode!
%
% STAR reference card, LaTeX formatted
%

\input{psadobe}
\documentstyle{report}
\makeatletter
\topmargin 10pt
\setlength{\topmargin}{-0.25in}
\setlength{\oddsidemargin}{0.50in}
\setlength{\textwidth}{5.25in}
\setlength{\textheight}{8.10in}

\makeatother

\include{stardefs}

\begin{document}

%% \special{psraw0 0.2 0.2 scale}

\noindent
{\bf \Saturn {} instruction set}
\medskip

\begin{tabbing}

xxxxx\=xxxxxxxxxxxxxxxx\=xxxxxxxxxxxxxxx\=\kill
\instr3 {ADD} \f \sd {} 
\instr6 {ADD} {[.A]} {\const , \ar } {} 
\instr3 {ADD} {[.A]} {\const , \Dn } {}
\instr3 {ADD} {[.A]} {P+1, C} {}
\instr4 {AND} \f \sd {i, iii}
\instr5 {BRBC} {} {\mask , HST, \dest } {}
\instr5 {RETBC} {} {\mask , HST} {}
\instr5 {BRB\sclr} {} {\bit , ST, \dest } {}
\instr5 {RETB\sclr} {} {\bit , ST} {}
\instr7 {BRB\sclr} {} {\bit , \ac, \dest} {}
\instr7 {RETB\sclr} {} {\bit, \ac} {}
\instr3 {BRC\sclr} {} {\dest} {}
\instr5 {BR\eqne} {[.1]} {P, \nib, dest} {}
\instr5 {BR\arref} \f {\sd, \dest} {i}
\instr5 {RET\arref} \f \sd {i}
\instr5 {BR\znz} \f {\ar, \dest} {}
\instr4 {BUSCB} {} {} {}
\instr3 {BUSCC} {} {} {}
\instr4 {BUSCD} {} {} {}
\instr3 {UNCNFG} {} {} {}
\instr3 {CONFIG} {} {} {}
\instr3 {SHUTDN} {} {} {}
\instr3 {RESET} {} {} {}
\instr3 {SREQ} {} {} {}
\instr3 {MOVE} {[.A]} {ID, C} {}
\instr{4/5/7} {CALL} {[.\{34A\}]} \dest {}
\instr{2/3} {CLR} \f \ar {}
\instr2 {CLR} {[.1]} P {}
\instr{2+n} {CLR} {[.\{245\}]} \Dn {}
\instr2 {CLR} {[.X]} {ST} {}
\instr3 {CLRB} {} {\bit, ST} {}
\instr3 {CLRB} {} {\mask, HST} {}
\instr5 {CLRB} {} {\bit, \ac} {}
\instr3 {DEC} {[.A]} \Dn {}
\instr2 {DEC} {[.1]} P {}
\instr{2/3} {DEC} \f \ar {}
\instr3 {IN} {[.4]} \ac {}
\instr2 {INC} {[.1]} P {}
\instr3 {INC} {[.A]} \Dn {}
\instr{2/3} {INC} \f \ar {}
\instr4 {INTOFF} {} {} {}
\instr4 {INTON} {} {} {}
\instr5 {RSI} {} {} {}
\instr{4/6/7} {JUMP} {[.\{34A\}]} \dest {}
\instr4 {JUMP} {[.A]} \ac {}
\instr4 {JUMP} {[.A]} {@\ac} {}
\instr{2/3} {MOVE} \f \sd {i, iii}
\instr{3/4} {MOVE} \f {\ac, @\Dn} {iv}
\instr{3/4} {MOVE} \f {@\Dn, \ac} {iv}
\instr4 {MOVE} {.\{1--16\}} {\ac, @\Dn} {}
\instr4 {MOVE} {.\{1--16\}} {@\Dn, \ac} {}
\instr3 {MOVE} {[.\{A4\}]} {\ac, \Dn} {}
\instr{3/6} {MOVE} {[.W\ndf]} {\ac, \Rn} {}
\instr{3/6} {MOVE} {[.W\ndf]} {\Rn, \ac} {}
\instr{2+n} {MOVE} {.P\{1--16\}} {\int, C} {}
\instr{5+n} {MOVE} {.P\{1--16\}} {\int, A} {}
\instr{2+n} {MOVE} {.\{245\}} {\int, \Dn} {}
\instr2 {MOVE} {[.1]} {\nib, P} {}
\instr4 {MOVE} {[.1]} {P, C.\nib} {}
\instr4 {MOVE} {[.1]} {C.\nib, P} {}
\instr2 {MOVE} {[.X]} {ST, C} {}
\instr2 {MOVE} {[.X]} {C, ST} {}
\instr{2/3} {NEG} \f \ar {}
\instr{2/3} {NOT} \f \ar {}
\instr4 {OR} \f \sd {i, iii}
\instr3 {OUT} {.\{SX\}} C {}
\instr2 {POP} {[.A]} C {}
\instr2 {PUSH} {[.A]} C {}
\instr2 {RET} {} {} {}
\instr2 {RET\setclr} {} C {}
\instr5 {RET\znz} \f \ar {}
\instr2 {RETI} {} {} {}
\instr2 {RETSETXM} {} {} {}
\instr3 {RLN} {[.W]} \ar {}
\instr5 {SETB} {} {\bit, \ac} {}
\instr3 {SETB} {} {\bit, ST} {}
\instr2 {SETDEC} {} {} {}
\instr2 {SETHEX} {} {} {}
\instr3 {SLB} {.\{W\ndf\/\}} \ar {}
\instr{2/3} {SLN} {.\{A\ndf\/\}} \ar {}
\instr{3/5} {SRB} {.\{W\ndf\/\}} \ar {}
\instr{2/3} {SRN} {.\{A\ndf\/\}} \ar {}
\instr{2/3} {SUB} {.\{A\ndf\/\}} \sd {i, iii}
\instr6 {SUB} \f {\const, \ar} {}
\instr{2/3} {SUBN} {\{A\ndf\/\}} \sd {i, iii}
\instr3 {SUB} {[.A]} {\const, \Dn} {}
\instr4 {SWAP} {[.A]} {\ac, PC} {}
\instr{2/3} {SWAP} {.\{A\ndf\/\}} \sd {i, iii}
\instr3 {SWAP} {[.\{A4\}]} {\ac, \Dn} {}
\instr{3/6} {SWAP} {[.\{W\ndf\/\}]} {\ac, \Rn} {}
\instr4 {SWAP} {[.1]} {P, C.\nib} {}
\instr2 {SWAP} {[.X]} {C, ST} {}

\end{tabbing}

\bigskip \noindent
{\bf \Star {} pseudo-instructions}
\medskip

\begin{tabbing}

xxxx\=xxxxxxxxx\=xxxxxxxxxxxx\=\kill

\pseudo{} {} {ALIGN} {\exprint{}}
\pseudo{2n} {} {ASCII} {\exprstr1, \exprstr2, \dots\ \exprstr{n}}
\pseudo{2(n+1)} {} {ASCIZ} {\exprstr1, \exprstr2, \dots\ \exprstr{n}}
\pseudo{} {} {ASECT} {[\name{}]}
\pseudo{2n} {} {BYTE} {\exprint1, \exprint2, \dots\ \exprint{n}}
\pseudo{} {} {CSECT} {[\name{}]}
\pseudo{mn} {} {DATA.$m$} {\exprint1, \exprint2, \dots\ \exprint{n}}
\pseudo{} {} {DEF} {\name{}, \expr{}}
\pseudo{} {} {DEFINE} {\name{}, \expr{}}
\pseudo{} {} {DOBLOCK} {\name{}, \exprstr{}}
\pseudo{16n} {} {DOUBLE} {\exprreal1, \exprreal2, \dots\ \exprreal{n}}
\pseudo{} {} {DSECT} {[\name{}]}
\pseudo{} {} {ELSE} {}
\pseudo{} {} {END} {}
\pseudo{} {} {ENDIF} {}
\pseudo{} {} {ERROR} {\exprstr{}}
\pseudo{} {} {EVEN} {}
\pseudo{} {} {EXIT} {}
\pseudo{} {} {FLOATING} {\exprint{low}, \exprint{high}}
\pseudo{} {} {HIDE} {\name{1}, \name{2}, \dots\ \name{n}}
\pseudo{} {} {IF} {\exprint{}}
\pseudo{} {} {LIBCALL} {\name{}}
\pseudo{} {} {LSECT} {[\name{}]}
\pseudo{} {\name{l}:} {MACRO} 
  {\name{m}\hspace{18pt}\name{arg1}, \name{arg2}, \dots\ \name{arg{\sl n}}}
\pseudo{} {} {ODD} {}
\pseudo{} {} {ORG} {\exprint{}}
\pseudo{} {} {ORIGIN} {\exprint{}}
\pseudo{} {} {PSECT} {[\name{}]}
\pseudo{} {} {RADIX} {\exprint{}}
\pseudo{} {} {RESTORE} {\name{1}, \name{2}, \dots\ \name{n}}
\pseudo{} {} {SAVE} {\name{1}, \name{2}, \dots\ \name{n}}
\pseudo{} {} {STATIC} {\exprint{low}, \exprint{high}}

\end{tabbing}

\bigskip \noindent
{\bf \hp-48\sx{} Standard Macro Library (\tt hp48.star)}
\medskip

\begin{tabbing}

xxxx\=xxxxxxxxx\=xxxxxxxxxxxxx\=\kill

\pseudo{} {} {ADDR} {\exprint{}, \{\ac, \Dn\}}
\pseudo{10} {} {ADDRESS} {[\exprint{}]}
\pseudo{10+ws} {} {BINARY} {[\exprint{value}], [\exprint{ws}]}
\pseudo{7} {} {CHARACTER} {[\exprint{}]}
\pseudo{n} {} {CODE} {}
\pseudo{37} {} {COMPLEX} {[\exprreal{re}], [\exprreal{im}]}
\pseudo{} {} {ENDLIST} {}
\pseudo{} {\name{}:} {EQU} {\exprint{}}
\pseudo{7+2n} {} {GLOBAL} {[\exprstr{}]}
\pseudo{16} {} {HEADER} {[\exprstr{}]}
\pseudo{} {} {LISTBLOCK} {}
\pseudo{7+2n} {} {LOCAL} {[\exprstr{}]}
\pseudo{} {} {NLISTBLOCK} {}
\pseudo{21} {} {REAL} {[\exprreal{}]}
\pseudo{5n} {} {RPL} {}
\pseudo{10} {} {SHORT} {[\exprint{}]}
\pseudo{10+2n} {} {STRING} {[\exprstr{}]}
\pseudo{10} {} {SYSBIN} {[\exprint{}]}
\pseudo{} {} {WARNING} {\exprstr{}}
\pseudo{8} {} {XLIB} {[\exprint{major}], [\exprint{minor}]}

\end{tabbing}

\eject
\noindent {\bf Special forms} \medskip

\begin{tabbing}

xxxx\=xxxxxxxx\=xxxxxxxx\=xxxxxxxxxx\=\kill

\>  \name{l}:\> MACRO \>  
  \name{m}\hspace{18pt}\name{arg1}, \name{arg2}, \dots\ \name{arg{\sl n}} \\
\>\>		\hspace{1em}{\it macro body} \\
\>\>		ENDMACRO \\
\\
\>\>		IF \exprint{test} \\
\>\>		\hspace{1em}{\it then-clause} \\
\>\>		ELSE \\
\>\>		\hspace{1em}{\it else-clause} \\
\>\>		ENDIF \\
\\
\>\>		LISTBLOCK \\
\>\>		\hspace{1em}{\it listings enabled} \\
\>\>		ENDLIST \\
\\
\>\>		NLISTBLOCK \\
\>\>		\hspace{1em}{\it listings disabled} \\
\>\>		ENDLIST \\
\\
\>\>		RPL \\
\>\>		\hspace{1em}{\it implicit data.a block} \\
\>\>		\hspace{1em}{\it underscore (\_) escapes} \\
\>\>		ENDRPL \\
\\
\>\>		CODE \\
\>\>		\hspace{1em}{\it \saturn {} machine code block} \\
\>\>		ENDLIST \\

\end{tabbing}


\bigskip\noindent {\bf Legend} \medskip

\begin{tabbing}

xxxxxxx\=xxxxxxxxxxxx\=\kill
\> \nib\> Nibble number; {\tt 0}--{\tt 15} \\
\> \bit\> Bit number; {\tt 0}--{\tt 15} \\
\> \const\> Small constant; {\tt 1}--{\tt 16} \\
\> \int\> Integer \\
\> \mask\> HST bit mask; see table \\
\> \ar\> Arithmetic register; {\tt A}, {\tt B}, {\tt C}, or {\tt D} \\
\> \ac\> Register {\tt A} or {\tt C} \\
\> \Dn\> Address register; {\tt D0} or {\tt D1} \\
\> \Rn\> Temporary register; {\tt R0}, {\tt R1}, {\tt R2}, {\tt R3}, or
 {\tt R4} \\
\> \arref\> Arithmetic condition; \arcond \\
\> {\it i-v}\> Combinatorial constraints of \sd \\
\> \name{} \> Symbol name \\
\> \expr{} \> Expression \\
\> \exprint{} \> Integer expression \\
\> \exprreal{} \> Real expression \\
\> \exprstr{} \> String expression \\

\end{tabbing}

\eject
\noindent {\bf Arithmetic register combinations} 
\medskip

\def\spcem{\hspace{1em}}

\halign{&\tt\spcem #\spcem\cr
	\omit\hfill&\sd&\sd&\sd&\sd\cr
	\noalign{\smallskip\hrule\smallskip}
	\omit\hfill\it i&B,A&C,B&A,C&C,D\cr
	\omit\hfill\it ii&A,A&B,B&C,C&D,D\cr
	\omit\hfill\it iii&A,B&B,C&C,A&D,C\cr}


\bigskip\bigskip\noindent
{\bf Instruction suffixes}
\medskip

\halign{&\tt\spcem #\spcem\cr
	\omit&\ndf&\ndf&\ndf&\ndf&\ndf&\ndf&\ndf&\ndf\cr
	\noalign{\smallskip\hrule\smallskip}
	\omit\hfill\it iv&P&WP&XS&X&S&M&B&W\cr
	\omit\hfill\it v&A\cr}

\bigskip\bigskip\noindent
{\bf Hardware status bits}
\medskip

\halign{&\hfill\tt\hspace{1ex} #\hspace{1ex}\hfill\cr
	\mask&\mask&\mask&\mask\cr
	\noalign{\smallskip\hrule\smallskip}
	XM&SB&SR&MP\cr}

\end{document}
