;; Emacs Mode Selection Info: -*-mode: ASM; coding: iso-latin-1-dos;-*- * ;; ******************************************************************************************** ;; File Name: DisDataP2.inc ;; Auther: John L. Weinrich ;; Date: 04/17/03 ;; Useage 4004 TIC-TAC-TOE Game ;; Description: ;; ;; This is an include file that contains the display data routine. ;; ;; ;; See "4004 FPGA Design" and "4004 Software Design " documents for more detail information. ;; ;; Registers used: ARRAY_PTR_P, UTILITY_1_P, SCRATCH_1_L, SCRATCH_1_H, SCRATCH_1_P ;; Memory used: None. ;; Entrance parameters: None. ;; Exit parameters: Accumulator, success, failure ;; Labels used: Continue1, LowerEOS1, NotEOS1, NoRollover1, EndOfString1, DisString1, ;; DisPageError, DisBit0, DisBit1, DisOptSw0_, DisOptSw1_, DisOptSw_0, DisOptSw_1, ;; DisSWVer, DisKeyPress, DisHWVer, DisBIT, DisDisPass, DisDisFail, DisMemPass, ;; DisMemFail, DisRNGPass, DisRNGFail, D_RAMTestPass, D_RAMTestFail, D_DisplayPass, ;; D_DisplayFail, D_RNGPass, D_RNGFail, D_ModeP1, D_ModeP2, D_ModeP3, D_BIT, ;; D_KeyPress, D_OptSw, D_Bit0, D_Bit1, D_SWVer, D_HWVer, D_PageError ;; Routines used: DisSetLineCol, DisplayModeCMND, DisplayModeData, WaitForDisplay ;; ******************************************************************************************** ;; ******************************************************************************************** ;; This subroutine displays canned strings ;; DisPageError fim UTILITY_1_P,L1C1 ; Set the display to line 1 & column 1 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_PageError) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisBit0 fim ARRAY_PTR_P,lo(D_Bit0) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisBit1 fim ARRAY_PTR_P,lo(D_Bit1) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisOptSw jms DisSetLine3 ; Set display to line 3 & column 1 fim ARRAY_PTR_P,lo(D_OptSw) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisOptSw0_ fim UTILITY_1_P,L3C7 ; Set the display to line 3 & column 8 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Bit0) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisOptSw1_ fim UTILITY_1_P,L3C7 ; Set the display to line 3 & column 8 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Bit1) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisOptSw_0 fim UTILITY_1_P,L3C8 ; Set the display to line 3 & column 9 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Bit0) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisOptSw_1 fim UTILITY_1_P,L3C8 ; Set the display to line 3 & column 9 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Bit1) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisSWVer fim UTILITY_1_P,L3C10 ; Set the display to line 3 & column 12 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_SWVer) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisKeyPress fim UTILITY_1_P,L4C10 ; Set the display to line 4 & column 11 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_KeyPress) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisHWVer jms DisSetLine4 ; Set display to line 4 & column 1 fim ARRAY_PTR_P,lo(D_HWVer) ; Get pointer to the string to be displayed jun DisString1 ; Go to routine to display the string DisBIT jms DisSetLine1 ; Set display to line 1 & column 1 fim ARRAY_PTR_P,lo(D_BIT) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisDisPass jms DisSetLine2 ; Set display to line 2 & column 1 fim ARRAY_PTR_P,lo(D_DisplayPass) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisDisFail jms DisSetLine2 ; Set display to line 2 & column 1 fim ARRAY_PTR_P,lo(D_DisplayFail) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisMemPass fim UTILITY_1_P,L2C8 ; Set the display to line 2 & column 8 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_RAMTestPass) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisMemFail fim UTILITY_1_P,L2C8 ; Set the display to line 2 & column 8 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_RAMTestFail) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisRNGPass fim UTILITY_1_P,L2C14 ; Set the display to line 2 & column 8 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_RNGPass) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisRNGFail fim UTILITY_1_P,L2C14 ; Set the display to line 2 & column 8 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_RNGFail) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string org DISDATA_LOCATION + 0300H ; Start the routine & data on a page boundary DisString1 jms DisplayModeCMND jms WaitForDisplay ; Wait for display jms DisplayModeData ; Set display to data mode Continue1 fin SCRATCH_1_P ; Get a byte of the string xch SCRATCH_1_L ; Get the lower nibble into accumulator jcn Z,LowerEOS1 ; Check if lower nibble is zero jun NotEOS1 ; Lower nibble not zero, then display it LowerEOS1 xch SCRATCH_1_H ; Lower nibble is zero, now check upper nibble jcn Z,EndOfString1 ; Upper nibble zero, go to return NotEOS1 fin SCRATCH_1_P ; Upper nibble not zero, get byte again xch SCRATCH_1_H ; Get the upper nibble into accumulator fim SRC_P,DISPLAY_HIGH_PORT ; Get address to display upper nibble port src SRC_P ; Send out display upper nibble address wrr ; Write the display upper nibble to display xch SCRATCH_1_L ; Get the lower nibble into accumulator fim SRC_P,DISPLAY_LOW_PORT ; Get address to display lower nibble port src SRC_P ; Send out display lower nibble address wrr ; Write the display lower nibble to display isz ARRAY_PTR_L,NoRollover1 ; Increment string pointer & check for roll over inc ARRAY_PTR_H ; String pointer rolled over, increment upper nibble NoRollover1 jun Continue1 ; Continue to out more bytes to display EndOfString1 bbl REPORT_SUCCESS ; All done, go back D_RAMTestPass data "RAM:P",0 ; Display RAM pass string D_RAMTestFail data "RAM:F",0 ; Display RAM fail string D_DisplayPass data "DISP:P",0 ; Display display pass string D_DisplayFail data "DISP:F",0 ; Display display fail string D_RNGPass data "RNG:P",0 ; Display RNG pass string D_RNGFail data "RNG:F",0 ; Display RNG fail string D_ModeP1 data "Select Game Mode:",0 ; Display Game mode prompt1 D_ModeP2 data "(1) 4004 vs Player",0 ; Display Game mode prompt2 D_ModeP3 data "(2) Player vs Player",0 ; Display Game mode prompt2 D_BIT data "BUILTIN TEST RESULTS",0 ; Display BIT Test tile D_KeyPress data "",0 ; Display keypress to continue D_OptSw data "OPTSW:??",0 ; Display option switch D_Bit0 data "0",0 ; Display a 0 D_Bit1 data "1",0 ; Display a 1 D_SWVer data "S/W:V1.0",0 ; Display software version number D_HWVer data "H/W:V?",0 ; Display hardware version number D_PageError data "PAGE ERROR!!!",0FFh ; Display page error