;; Emacs Mode Selection Info: -*-mode: ASM; coding: iso-latin-1-dos;-*- * ;; ******************************************************************************************** ;; File Name: LED.inc ;; Auther: John L. Weinrich ;; Date: 01/31/03 ;; Useage 4004 TIC-TAC-TOE Game ;; Description: ;; ;; This file is an include file containing LED control routines. ;; ;; See "4004 FPGA Design" and "4004 Software Design " documents for more detail information. ;; ;; Registers used: SRC_P ;; Memory used: MISC_RAM_SHADOW ;; Entrance parameters: None. ;; Exit parameters: Accumulator, success, failure ;; Labels used: DoneLEDOff, DoneLEDOn, DoneLEDRed, DoneLEDGreen ;; Routines used: None. ;; ******************************************************************************************** ;; ******************************************************************************************** ;; This subroutine sets Done LED to off ;; DoneLEDOff ldm RAM_BANK_0 ; Select RAM bank 0 dcl ; Send out RAM bank selection fim SRC_P,MISC_RAM_SHADOW ; Select MISC port RAM shadow charactor src SRC_P ; Tell RAM of selection rdm ; Get MISC port shadow data from RAM ral ; Select the Done LED on/off bit in MISC port ral ; Rotate on/off bit to carry stc ; Set done LED on/off bit to off rar ; Restore nibble, de-select done LED on/off bit rar ; Rotate on/off bit back wrm ; Write MISC port shadow back to RAM fim SRC_P,MISC_PORT ; Select MISC port src SRC_P ; Tell MISC port it is selected wrr ; Update the MISC port to shadow setting bbl REPORT_SUCCESS ; All done, return ;; ******************************************************************************************** ;; This subroutine sets Done LED to on ;; DoneLEDOn ldm RAM_BANK_0 ; Select RAM bank 0 dcl ; Send out RAM bank selection fim SRC_P,MISC_RAM_SHADOW ; Select MISC port RAM shadow charactor src SRC_P ; Tell RAM of selection rdm ; Get MISC port shadow data from RAM ral ; Select the Done LED on/off bit in MISC port ral ; "" "" clc ; Set done LED on/off bit to on rar ; Restore nibble, de-select done LED on/off bit rar ; "" "" wrm ; Write MISC port shadow back to RAM fim SRC_P,MISC_PORT ; Select MISC port src SRC_P ; Tell MISC port it is selected wrr ; Update the MISC port to shadow setting bbl REPORT_SUCCESS ; All done, return ;; ******************************************************************************************** ;; This subroutine sets Done LED to red ;; DoneLEDRed ldm RAM_BANK_0 ; Select RAM bank 0 dcl ; Send out RAM bank selection fim SRC_P,MISC_RAM_SHADOW ; Select MISC port RAM shadow charactor src SRC_P ; Tell RAM of selection rdm ; Get MISC port shadow data from RAM rar ; Select the Done LED red/green bit in MISC port rar ; "" "" stc ; Set done LED red/green bit to red ral ; Restore nibble, de-select done LED red/green bit ral ; "" "" wrm ; Write MISC port shadow back to RAM fim SRC_P,MISC_PORT ; Select MISC port src SRC_P ; Tell MISC port it is selected wrr ; Update the MISC port to shadow setting bbl REPORT_SUCCESS ; All done, return ;; ******************************************************************************************** ;; This subroutine sets Done LED to green ;; DoneLEDGreen ldm RAM_BANK_0 ; Select RAM bank 0 dcl ; Send out RAM bank selection fim SRC_P,MISC_RAM_SHADOW ; Select MISC port RAM shadow charactor src SRC_P ; Tell RAM of selection rdm ; Get MISC port shadow data from RAM rar ; Select the Done LED red/green bit in MISC port rar ; "" "" clc ; Set done LED red/green bit to green ral ; Restore nibble, de-select done LED red/green bit ral ; "" "" wrm ; Write MISC port shadow back to RAM fim SRC_P,MISC_PORT ; Select MISC port src SRC_P ; Tell MISC port it is selected wrr ; Update the MISC port to shadow setting bbl REPORT_SUCCESS ; All done, return