;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; 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      : utlMscMc.h
;
; Macro Names    : UTL_COPY_BUFFER              - Copies the data pointed by IYReg to 
;                                                   the located pointed by HLReg.
;                  UTL_COPY_IYREG_TO_HLREG      - Copies the data pointed by IYReg to 
;                                                   the located pointed by HLReg.
;                   
;                  UTL_COPY_IYREG_TO_IXREG      - Copies the data pointed by IYReg to 
;                                                   the location pointed by IXReg.
;                  
;                  UTL_COMPARE_4BYTE_BUFFER     - Compares the data in a 4 byte buffer, 
;                                                   and sets the SC flags to indicate 
;                                                   if one data set is <,>, or = to the 
;                                                   other.
;                   
;                  UTL_COMPARE_HLREG_WITH_IXREG - Compares two structures as pointed by 
;                                                   HLReg and IXReg.
;
;                  UTL_COMPARE_HLREG_WITH_IYREG - Compares two structures as pointed by 
;                                                   HLReg and IYReg.
;
;                  
;                  
;                  
;
; Purpose        : Miscellaneous utility.
;
; Change History : 
;
;               06/03/2000 RVD - Created utlbmac.h for m841
;
;   M851 Development:
;
;               02/12/2002 FSU - Modified for M851 development.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_COPY_BUFFER / UTL_COPY_IYREG_TO_HLREG
;
; Description : Copies the data pointed by IYReg to the location pointed by
;                 HLReg.
;
; Assumptions : None
;
; Usage       : UTL_COPY_BUFFER / UTL_COPY_IYREG_TO_HLREG
;               
; Input(s)    : BReg  - number of bytes to copy.
;               IYReg - lowest address of the source structure
;               HLReg - lowest address of the destination structure
;
; Output(s)   : IYReg - points to the next byte after the source structure
;               HLReg - points to the next byte after the destinations structure
;               BReg  - '0'
;
;               ( Destroyed: None )
;
; Macro Change History : 
;
;               06/21/2000 RVD - Created Macro
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

UTL_COPY_BUFFER MACRO

                car     kresCopyNBytes

        CALLS   SUBROUTINE , 'kresCopyNBytes'

        ENDM


UTL_COPY_IYREG_TO_HLREG     MACRO

                car     kresCopyNBytes

        CALLS   SUBROUTINE, 'kresCopyNBytes'

        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_COPY_IYREG_TO_IXREG
;
; Description : Copies the data pointed by IYReg to the location pointed by
;                 IXReg.
;
; Assumptions : None
;
; Usage       : UTL_COPY_IYREG_TO_IXREG
;               
; Input(s)    : BReg  - number of bytes to copy.
;               IYReg - lowest address of the source structure
;               IXReg - lowest address of the destination structure
;
; Output(s)   : IYReg - points to the next byte after the source structure
;               IXReg - points to the next byte after the destinations structure
;               BReg  - '0'
;
;               ( Destroyed: None )
;
; Macro Change History : 
;
;               03/04/2002 FSU - Created Macro
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

UTL_COPY_IYREG_TO_IXREG     MACRO

                car     utlCopyIYRegToIXReg

        CALLS   SUBROUTINE, 'utlCopyIYRegToIXReg'

        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_COMPARE_4BYTE_BUFFER
;
; Description : Compares the data in a 4 byte buffer, and sets the SC flags
;                 to indicate if one data set is <,>, or = to the other.
;
; Assumptions : Both datasets are stored in a consecutive 4 byte buffer, order 
;                 least significant to most significant. Data is unsigned.
;
; Usage       : UTL_COMPARE_4BYTE_BUFFER
;               
; Input(s)    : HLReg - points to most significant byte of data to be compared to.
;               IXReg - points to most significany byte of data we are comparing.
;
; Output(s)  :  HLReg = IXReg ; bZeroFlag = TRUE  , bCarryFlag = FALSE
;               HLReg < IXReg ; bZeroFlag = FALSE , bCarryFlag = TRUE
;               HLReg > IXReg ; bZeroFlag = FALSE , bCarryFlag = FALSE
;
;               ( Destroyed: HLReg, IXReg, BAReg )
;
; Macro Change History : 
;
;               02/26/2002 FSU - Created for M851.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

UTL_COMPARE_4BYTE_BUFFER     MACRO

                car     utlCompare4ByteBuffer

        CALLS   SUBROUTINE, 'utlCompare4ByteBuffer'

        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_COMPARE_HLREG_WITH_IXREG
;
; Description:  Compares two structures as pointed by HLReg and IXReg.
;
; Assumptions:  None
;
; Usage       : UTL_COMPARE_HLREG_WITH_IXREG
;               
; Input(s):     HLReg and IXReg should point to the higher significant byte
;                  where comparison should start.   
;               BReg should contain how many byte fields are to be compared.
;
; Output(s)  :  HLReg = IXReg ; bZeroFlag = TRUE  , bCarryFlag = FALSE
;               HLReg < IXReg ; bZeroFlag = FALSE , bCarryFlag = TRUE
;               HLReg > IXReg ; bZeroFlag = FALSE , bCarryFlag = FALSE
;
;               ( Destroyed: HLReg, IXReg, BAReg )
;
; Macro Change History : 
;
;               12/07/2001 RBR - Created Macro for M851
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

UTL_COMPARE_HLREG_WITH_IXREG     MACRO

                car     utlCompareHLRegWithIXReg

        CALLS   SUBROUTINE, 'utlCompareHLRegWithIXReg'

        ENDM


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Macro Name  : UTL_COMPARE_HLREG_WITH_IYREG
;
; Description : Compares two structures as pointed by HLReg and IYReg.
;
; Assumptions : None
;
; Usage       : UTL_COMPARE_HLREG_WITH_IYREG
;               
; Input(s)    : HLReg and IYReg should point to the higher significant byte
;                  where comparison should start.   
;               BReg should contain how many byte fields are to be compared.
;
; Output(s)   : HLReg = IYReg ; bZeroFlag = TRUE  , bCarryFlag = FALSE
;               HLReg < IYReg ; bZeroFlag = FALSE , bCarryFlag = TRUE
;               HLReg > IYReg ; bZeroFlag = FALSE , bCarryFlag = FALSE
;
; Destroyed   : HLReg, IYReg, BReg
;
; Macro Change History : 
;
;               12/07/2001 RBR - Created Macro for M851
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

UTL_COMPARE_HLREG_WITH_IYREG     MACRO

                car     utlCompareHLRegWithIYReg

        CALLS   SUBROUTINE, 'utlCompareHLRegWithIYReg'

        ENDM




