;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Copyright (c) 2002 TIMEX Corporation.
; 
; This document is the property of, and contains information proprietary to
; TIMEX Corporation.  It is to be returned upon request.  Reproduction by any
; means, disclosure, or use of its contents for other than the expressed
; purpose for which it is loaned, without the written consent of TIMEX
; Corporation, is strictly prohibited.
;
; File Name      : utlEdtMc.h
;
; Macro Names    : UTL_SETUP_VARS_FOR_EDITING             - Sets up the variables used for editing 
;                                                             a message.
;
;                  UTL_FILL_SCROLL_BUFFER_WITH_SPACE      - Fills up the scroll buffer with space 
;                                                             character.
;
;                  UTL_DISPLAY_MSG_AND_REQ_BLINK          - Displays a part of the message that has 
;                                                             the character to be edited.
;                                                           The cursor character will be displayed on 
;                                                             the position of the character to be edited.
;
;                  UTL_MOVE_CURSOR_FORWARD_AND_REQ_BLINK  - Move to the next character to be edited 
;                                                             if its not yet the last character.
;                                                           Display cursor on the position of the 
;                                                             character to be edited.
;                                                           Request blinking on the character to be edited.
;
;                  UTL_MOVE_CURSOR_BACKWARD_AND_REQ_BLINK - Move to the previous character to be edited 
;                                                             if its not yet the first character.
;                                                           Display cursor on the position of the character 
;                                                             to be edited.
;                                                           Request blinking on the character to be edited.
;
;                  UTL_POINT_TO_PREV_CHAR_AND_REQ_BLINK   - Point to the previous character (refer to lcd 
;                                                             character table on whats the previous 
;                                                             character with respect to the character to
;                                                             be changed) and request blinking on that
;                                                             character.
;
;                  UTL_POINT_TO_NEXT_CHAR_AND_REQ_BLINK   - Point to the next character (refer to lcd 
;                                                             character table on whats the next character 
;                                                             with respect to the character to be changed)
;                                                             and request blinking on that character.
;
;                  UTL_POINT_TO_PREV_CHAR                 - Point to the previous character (refer to lcd 
;                                                             character table on whats the previous character 
;                                                             with respect to the character to be changed).
;
;                  UTL_POINT_TO_NEXT_CHAR                 - Point to the next character (refer to lcd 
;                                                             character table on whats the previous 
;                                                             character with respect to the character to
;                                                             be changed).
;                  
;                  UTL_CLEANUP_EDIT_BUFFER                - Trims the trailing spaces.
;
;
;                  UTL_TRIM_SENTINEL_CHAR                 - Trims the trailing sentinel character.  The last 
;                                                             sentinel character is not included.
;
;				   UTL_CHANGE_CHAR_TO_SPACE			      - Change the current character into a space character.
;
;				   
;
; Purpose        : Utility message editing utility.
;
; Note           : The message to be edited should be stored in the LCDScrollBuffer 
;                    prior to using these routines.
;
; Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;               05/30/2002 FSU - ECR# 851-20020515-239 
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_SETUP_VARS_FOR_EDITING  
;
; Description : Sets up the variables used for editing a message.
;               ( This includes the sentinel character )
;
; Assumptions : LCDScrollBuffer should contain the message to be edited. 
;               
; Usage       : UTL_SETUP_VARS_FOR_EDITING
;               
; Input(s)    : BReg - Number of characters allocated for the message.
;
; Output(s)   : None
;
;               (Destroyed: None)
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_SETUP_VARS_FOR_EDITING  MACRO

                car     utlSetupVarsForEditing
                                
        CALLS   SUBROUTINE , 'utlSetupVarsForEditing'
       
        ENDM
              

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_FILL_SCROLL_BUFFER_WITH_SPACE
;
; Description : Fills up the scroll buffer with space character.
;
; Assumptions : The record to be edited is an unused record.
;               
; Usage       : UTL_FILL_SCROLL_BUFFER_WITH_SPACE
;               
; Input(s)    : None
;
; Output(s)   : None
;
;               ( Destroyed: None )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_FILL_SCROLL_BUFFER_WITH_SPACE   MACRO

                car     utlFillScrollBufferWithSpace
                                
        CALLS   SUBROUTINE , 'utlFillScrollBufferWithSpace'
       
        ENDM                    

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_MOVE_CURSOR_FORWARD_AND_REQ_BLINK 
;
; Description : Move to the next character to be edited if its not yet the last character.
;               Display cursor on the position of the character to be edited.
;               Request blinking on the character to be edited.
;
; Assumptions : LCDScrollBuffer should contain the message to be edited.
;               
; Usage       : UTL_MOVE_CURSOR_FORWARD_AND_REQ_BLINK
;               
; Input(s)    : None
;
; Output(s)   : bCarryFlag = 0 if moving the cursor forward is valid.
;                            1 if moving the cursor forward is invalid.
;               
;               ( Destroyed: IXReg, BAReg, HLReg, IYReg )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_MOVE_CURSOR_FORWARD_AND_REQ_BLINK   MACRO

                car     utlMoveCursorForwardAndReqBlink
                                
        CALLS   SUBROUTINE , 'utlMoveCursorForwardAndReqBlink'
       
        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_MOVE_CURSOR_BACKWARD_AND_REQ_BLINK
;
; Description : Move to the previous character to be edited if its not yet the first character.
;               Display cursor on the position of the character to be edited.
;               Request blinking on the character to be edited.
;
; Assumptions : LCDScrollBuffer should contain the message to be edited.
;               
; Usage       : UTL_MOVE_CURSOR_BACKWARD_AND_REQ_BLINK
;               
; Input(s)    : None
;
; Output(s)   : bCarryFlag = 0 if moving the cursor backward is valid.
;                            1 if moving the cursor backward is invalid.
;               
;               ( Destroyed: IXReg, BAReg, HLReg, IYReg )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_MOVE_CURSOR_BACKWARD_AND_REQ_BLINK  MACRO

                car     utlMoveCursorBackwardAndReqBlink
                                
        CALLS   SUBROUTINE , 'utlMoveCursorBackwardAndReqBlink'
       
        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_DISPLAY_MSG_AND_REQ_BLINK 
;
; Description : Displays a part of the message that has the character to be edited.
;               The cursor character will be displayed on the position of the 
;                 character to be edited.
;
; Assumptions : LCDScrollBuffer should contain the message to be edited.
;               
; Usage       : UTL_DISPLAY_MSG_AND_REQ_BLINK
;               
; Input(s)    : None
;               
; Output(s)   : None
;               
;               ( Destroyed: IXReg, BAReg, HLReg, IYReg )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

UTL_DISPLAY_MSG_AND_REQ_BLINK   MACRO

                car     utlDisplayMsgAndRequestBlink
                                
        CALLS   SUBROUTINE , 'utlDisplayMsgAndRequestBlink'
       
        ENDM



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_POINT_TO_PREV_CHAR_AND_REQ_BLINK
;
; Description : Point to the previous character (refer to lcd character table on
;                 whats the previous character with respect to the character to
;                 be changed)
;               Displays the new character and request blinking.
;
; Assumptions : LCDScrollBuffer should contain the message to be edited.
;               
; Usage       : UTL_POINT_TO_PREV_CHAR_AND_REQ_BLINK
;               
; Input(s)    : BReg - Number to be subtracted to the current charater definition
;                        to point to the next desired character.  This
;                        would look like it is accelerated.
;               
; Output(s)   : None
;
;               ( Destroyed: BAReg, HLReg, IXReg, IYReg )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_POINT_TO_PREV_CHAR_AND_REQ_BLINK    MACRO

                car     utlPointToPrevCharAndRequestBlink
                                
        CALLS   SUBROUTINE , 'utlPointToPrevCharAndRequestBlink'
       
        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_POINT_TO_NEXT_CHAR_AND_REQ_BLINK 
;
; Description : Point to the next character (refer to lcd character table on
;                 whats the next character with respect to the character to
;                 be changed)
;               Displays the new character and request blinking.
;
; Assumptions : LCDScrollBuffer should contain the message to be edited.
;               
; Usage       : UTL_POINT_TO_NEXT_CHAR_AND_REQ_BLINK
;               
; Input(s)    : BReg - Number to be added to the current charater definition
;                        to point to the next desired character.  This
;                        would look like it is accelerated.
;               
; Output(s)   : None
;               
;               ( Destroyed: BAReg, HLReg, IXReg, IYReg )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_POINT_TO_NEXT_CHAR_AND_REQ_BLINK    MACRO

                car     utlPointToNextCharAndRequestBlink
                                
        CALLS   SUBROUTINE , 'utlPointToNextCharAndRequestBlink'
       
        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_POINT_TO_PREV_CHAR 
;
; Description : Point to the previous character (refer to lcd character table on
;                 whats the previous character with respect to the character to
;                 be changed)
;
; Assumptions : None
;               
; Usage       : UTL_POINT_TO_PREV_CHAR
;               
; Input(s)    : IYReg - Base address of the message where the character will be edited.
;               LReg  - Offset from the base address of the character to be edited.
;               BReg  - Number to be subtracted to the current charater definition
;                         to point to the next desired character.  This
;                         would look like it is accelerated.
;               
; Output(s)   : AReg - New character.
;               The new character is stored on the position pointed by (IYReg + LReg).
;
;               ( Destroyed: None )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_POINT_TO_PREV_CHAR  MACRO

                car     utlPointToPrevChar
                                
        CALLS   SUBROUTINE , 'utlPointToPrevChar'
       
        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_POINT_TO_NEXT_CHAR 
;
; Description : Point to the next character (refer to lcd character table on
;                 whats the previous character with respect to the character to
;                 be changed)
;
; Assumptions : None
;               
; Usage       : UTL_POINT_TO_NEXT_CHAR
;               
; Input(s)    : IYReg - Base address of the message where the character will be edited.
;               LReg  - Offset from the base address of the character to be edited.
;               BReg  - Number to be added to the current charater definition
;                         to point to the next desired character.  This
;                         would look like it is accelerated.
;               
; Output(s)   : AReg - New character.
;               The new character is stored on the position pointed by (IYReg + LReg).
;
;               ( Destroyed: None )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_POINT_TO_NEXT_CHAR  MACRO

                car     utlPointToNextChar
                                
        CALLS   SUBROUTINE , 'utlPointToNextChar'
       
        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_CLEANUP_EDIT_BUFFER 
;
; Description : Trims the trailing spaces.
;
; Assumptions : LCDScrollBuffer should contain the message to be edited.
;               
; Usage       : UTL_CLEANUP_EDIT_BUFFER
;               
; Input(s)    : None
;               
; Output(s)   : None
;               
;               ( Destroyed: None )
;
; Macro Change History : 
;
;               02/12/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_CLEANUP_EDIT_BUFFER MACRO

                car     utlCleanupEditBuffer
                                
        CALLS   SUBROUTINE , 'utlCleanupEditBuffer'
       
        ENDM





;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_TRIM_SENTINEL_CHAR
;
; Description : Trims the trailing sentinel character.  The last sentinel
;                 character is not included.
;
; Assumptions : LCDScrollBuffer should contain the message to be edited.
;               
; Usage       : 
;               
; Input(s)    : None
;               
; Output(s)   : None
;               
;               ( Destroyed: None )
;
; Macro Change History : 
;
;               04/15/2002 FSU - Created for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_TRIM_SENTINEL_CHAR  MACRO

                car     utlTrimSentinelCharacter
                                
        CALLS   SUBROUTINE , 'utlTrimSentinelCharacter'
       
        ENDM

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_CHANGE_CHAR_TO_SPACE
;
; Description : Change the current character into a space character.
;
; Assumptions : LCDScrollBuffer should contain the message to be edited.
;
; Input(s)    : None
;               
; Output(s)   : None
;               
;               ( Destroyed: None )
;
; Macro Change History : 
;
;               05/17/2002 FSU - Created for M851 Development.
;                                Refer to ECR# 851-20020515-239 
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
UTL_CHANGE_CHAR_TO_SPACE  MACRO

                car     utlChangeCharToSpace
                                
        CALLS   SUBROUTINE , 'utlChangeCharToSpace'
       
        ENDM
