\contentsline {section}{\numberline {1}Introduction}{W0-3} \contentsline {section}{\numberline {2}I/O ports and the 68230 parallel interface/timer chip}{W0-3} \contentsline {subsection}{\numberline {2.1}The interface card}{W0-4} \contentsline {subsection}{\numberline {2.2}The 68230 parallel interface/timer chip}{W0-4} \contentsline {subsection}{\numberline {2.3}Register addresses in the 68230 PI/T on the Flight-68k}{W0-5} \contentsline {subsection}{\numberline {2.4}How the interface card is connected to the parallel chip}{W0-5} \contentsline {section}{\numberline {3}The keypad}{W0-7} \contentsline {subsection}{\numberline {3.1}Scanning the keypad}{W0-7} \contentsline {subsubsection}{\numberline {3.1.1}The method}{W0-8} \contentsline {subsection}{\numberline {3.2}Debouncing the keys}{W0-9} \contentsline {subsection}{\numberline {3.3}How to detect if any key has been pressed}{W0-10} \contentsline {section}{\numberline {4}68000 Assembly language}{W0-11} \contentsline {subsection}{\numberline {4.1}labels, opcodes, operands and comments}{W0-11} \contentsline {subsection}{\numberline {4.2}Comments in programs}{W0-11} \contentsline {subsection}{\numberline {4.3}Integer numbers in programs}{W0-12} \contentsline {subsection}{\numberline {4.4}Registers in the 68000}{W0-12} \contentsline {subsubsection}{\numberline {4.4.1}Flags in the status registers}{W0-12} \contentsline {subsection}{\numberline {4.5}Addressing modes}{W0-13} \contentsline {subsubsection}{\numberline {4.5.1}Direct addressing mode}{W0-14} \contentsline {subsubsection}{\numberline {4.5.2}Immediate addressing mode}{W0-14} \contentsline {subsubsection}{\numberline {4.5.3}Address register indirect with displacement addressing mode}{W0-14} \contentsline {subsubsection}{\numberline {4.5.4}Address register indirect with index addressing mode}{W0-15} \contentsline {subsection}{\numberline {4.6}Tables in MC68000 assembly language}{W0-16} \contentsline {subsection}{\numberline {4.7}Loops: the \texttt {dbf} instruction}{W0-16} \contentsline {subsection}{\numberline {4.8}The \texttt {cmp} instruction}{W0-17} \contentsline {subsection}{\numberline {4.9}What if you find an instruction you do not know?}{W0-17} \contentsline {section}{\numberline {5}Subroutines}{W0-17} \contentsline {section}{\numberline {6}The stack}{W0-19} \contentsline {subsection}{\numberline {6.1}The push operation}{W0-19} \contentsline {subsubsection}{\numberline {6.1.1}An example of a push operation}{W0-19} \contentsline {subsection}{\numberline {6.2}The pop operation}{W0-20} \contentsline {subsubsection}{\numberline {6.2.1}An example of a pop operation}{W0-20} \contentsline {section}{\numberline {7}Preserving registers: transparency}{W0-21} \contentsline {section}{\numberline {8}Subroutine calls, parameters and return values}{W0-21} \contentsline {section}{\numberline {9}Subroutine calls and the stack}{W0-22} \contentsline {subsection}{\numberline {9.1}The \texttt {bsr} and \texttt {jsr} instructions}{W0-22} \contentsline {subsection}{\numberline {9.2}The \texttt {rts} instruction}{W0-22} \contentsline {subsection}{\numberline {9.3}The subroutine must leave the stack as it found it}{W0-23} \contentsline {section}{\numberline {10}An example showing a subroutine call}{W0-23} \contentsline {section}{\numberline {11}The include file, \texttt {flight.i} and the macros}{W0-24} \contentsline {subsection}{\numberline {11.1}The \texttt {Init} macro}{W0-25} \contentsline {subsection}{\numberline {11.2}The \texttt {Delay} macro}{W0-25} \contentsline {subsection}{\numberline {11.3}The \texttt {WriteSs} macro}{W0-25} \contentsline {subsection}{\numberline {11.4}The \texttt {Transl} macro}{W0-25} \contentsline {subsection}{\numberline {11.5}The \texttt {ShowNum} macro}{W0-26} \contentsline {subsection}{\numberline {11.6}The \texttt {WNKeyPr} macro}{W0-26} \contentsline {subsection}{\numberline {11.7}The \texttt {WKeyPr} macro}{W0-26} \contentsline {subsection}{\numberline {11.8}Equates}{W0-26} \contentsline {section}{\numberline {12}The \texttt {trap} instruction and monitor routines}{W0-27} \contentsline {section}{\numberline {13}The general procedure for editing, assembling, downloading and running an assembly language program}{W0-27} \contentsline {subsection}{\numberline {13.1}Editing the program}{W0-28} \contentsline {subsection}{\numberline {13.2}Assembling the program}{W0-28} \contentsline {subsection}{\numberline {13.3}Downloading your program}{W0-29} \contentsline {subsection}{\numberline {13.4}Running the program}{W0-29}