;; Emacs Mode Selection Info: -*-mode: ASM; coding: iso-latin-1-dos;-*- * ;; ******************************************************************************************** ;; File Name: DisDataP1.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: DisWon1, DisYN, DisAnother, DisKeyPress, Draw1, Draw2, Draw2, ;; ClearBoard, ClearName, DisTurn, DisPageError, DisX1, DisX2, DisX3, DisX4, ;; DisX5, DisX6, DisX1_6, DisX7, DisX8, DisX9, DisX7_9, DisO1, DisO2, DisO3, DisO4, ;; DisO5, DisO6, DisO1_6, DisO7, DisO8, DisO9, DisO7_9, DisHorLine, DisVertLine, ;; DisVertHorLine, DisX, DisO, DisXHor, DisOHor, DisBlank, DisGB1, DisGB2, DisGB2, ;; DisGBN1, DisGBN2, DisGBN3, DisGBMSG1, DisGBMSG2, DisString4, Continue4, ;; LowerEOS4, NotEOS4, NoRollover4, EndOfString4, D_HorLine, D_VertHorLine, ;; D_VertLine, D_OHor, D_X, D_O, D_XHor, D_Blank, D_GB1, D_GB2, D_GB3, D_GBN1, ;; D_GBN2, D_GBN3, D_GBMSG1, D_GBMSG2, D_Turn, D_CLR_Board, D_CLR_Name, D_PageError, ;; D_Draw1, D_Draw2, D_Draw3, D_KeyPress, D_Another, D_YN, D_Won1 ;; Routines used: DisSetLineCol, DisplayModeCMND, DisplayModeData, WaitForDisplay ;; ******************************************************************************************** ;; ******************************************************************************************** ;; This subroutine displays canned strings ;; DisWon1 fim UTILITY_1_P,L3C1 ; Set the display to line 1 & column 1 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Won1) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisYN fim UTILITY_1_P,L3C1 ; Set the display to line 3 & column 1 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_YN) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisAnother fim UTILITY_1_P,L2C1 ; Set the display to line 2 & column 1 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Another) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisKeyPress fim UTILITY_1_P,L4C10 ; Set the display to line 4 & column 10 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 DisString4 ; Go to routine to display the string Draw1 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_Draw1) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string Draw2 fim UTILITY_1_P,L2C1 ; Set the display to line 2 & column 1 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Draw2) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string Draw3 fim UTILITY_1_P,L3C1 ; Set the display to line 3 & column 1 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Draw3) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string ClearBoard fim ARRAY_PTR_P,lo(D_CLR_Board) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string ClearName fim ARRAY_PTR_P,lo(D_CLR_Name) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisTurn fim UTILITY_1_P,L3C1 ; Set the display to line 3 & column 1 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_Turn) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string 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 DisString4 ; Go to routine to display the string DisGB1 fim UTILITY_1_P,L1C16 ; Set the display to line 1 & column 16 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_GB1) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisGB2 fim UTILITY_1_P,L2C16 ; Set the display to line 2 & column 16 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_GB2) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisGB3 fim UTILITY_1_P,L3C16 ; Set the display to line 2 & column 16 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_GB3) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisGBN1 fim UTILITY_1_P,L1C12 ; Set the display to line 2 & column 16 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_GBN1) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisGBN2 fim UTILITY_1_P,L2C12 ; Set the display to line 2 & column 16 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_GBN2) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisGBN3 fim UTILITY_1_P,L3C12 ; Set the display to line 2 & column 16 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_GBN3) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisGBMSG1 fim UTILITY_1_P,L1C1 ; Set the display to line 2 & column 16 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_GBMSG1) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string DisGBMSG2 fim UTILITY_1_P,L2C1 ; Set the display to line 2 & column 16 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_GBMSG2) ; Get pinter to the string to be displayed jun DisString4 ; Go to routine to display the string org DISDATA_LOCATION + 0200H ; Start the routine & data on a page boundary DisString4 jms DisplayModeCMND jms WaitForDisplay ; Wait for display jms DisplayModeData ; Set display to data mode Continue4 fin SCRATCH_1_P ; Get a byte of the string clb ldm 0Fh ; Load delimiter charactor lower nibble sub SCRATCH_1_L ; Get the lower nibble into accumulator jcn Z,LowerEOS4 ; Check if lower nibble is zero jun NotEOS4 ; Lower nibble not zero, then display it LowerEOS4 clb ldm 0Fh ; Load delimiter charactor upper nibble sub SCRATCH_1_H ; Lower nibble is zero, now check upper nibble jcn Z,EndOfString4 ; Upper nibble zero, go to return NotEOS4 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,NoRollover4 ; Increment string pointer & check for roll over inc ARRAY_PTR_H ; String pointer rolled over, increment upper nibble NoRollover4 jun DisString4 ; Continue to out more bytes to display EndOfString4 bbl REPORT_SUCCESS ; All done, go back D_GB1 data 00h,01h,00h,01h,00h,0FFh ; Display game board line #1 D_GB2 data 00h,01h,00h,01h,00h,0FFh ; Display game board line #2 D_GB3 data 07h,02h,07h,02h,07h,0FFh ; Display game board line #3 D_GBN1 data "1","2","3",0FFh ; Display game board numbering line #1 D_GBN2 data "4","5","6",0FFh ; Display game board numbering line #2 D_GBN3 data "7","8","9",0FFh ; Display game board numbering line #3 D_GBMSG1 data "Use 1-9",0FFh ; Display game board instruction line #1 D_GBMSG2 data "to select.",0FFh ; Display game board instruction line #2 D_Turn data "Your turn, ",0FFh ; Display player turn D_CLR_Board data " ",0FFh ; Clear player turn name D_CLR_Name data " ",0FFh ; Clear board D_PageError data "PAGE ERROR!!!",0FFh ; Display page error D_Draw1 data "Game has",0FFh ; Display draw line #1 D_Draw2 data "ended in a",0FFh ; Display draw line #2 D_Draw3 data "draw!!!",0FFh ; Display draw line #3 D_KeyPress data "",0FFh ; Display keypress to continue D_Another data "Another game?",0FFh ; Display keypress to continue D_YN data "Press Y or N",0FFh ; Display keypress to continue D_Won1 data "HAS WON!!!",0FFh ; Display keypress to continue