PGM   MOVE
         REL
LIBWORD  EQU   23456
SECWORD  EQU   12345
SG       EQU   270
G.MOVES  EQU   SG+31*2
MOVEMOD  DW    MOVEEND-MOVEMOD/2
         DW    SECWORD
         DB    17,"movemod  5-Oct-81"
********************************************************
*                                                      *
*    MOVEBYTES(SOURCE,DESTINATION,COUNT)               *
*                                                      *
*    Moves a buffer, source and destination are byte   *
*    addresses, count is a byte count.                 *
*                                                      *
********************************************************
         DW    LIBWORD
         DB    7,"moves  "
MOVES    MOV   SI,BX
         XCHG  DI,AX           save global pointer
         XOR   BX,BX           holds odd count flag
         SHR   CX              make word count
         RCL   BX              make non-zero if odd count
         CLD
         MOV   DX,DS
         CLI
         MOV   ES,DX
*
         REP                   repeat word move
         MOVW
*
         OR    BX,BX
         JE    LEAVE
         MOVB                  move odd byte
LEAVE    STI
         MOV   DI,AX
         RETS
*
         EVEN
         DW    0
         DW    G.MOVES/2
         DW    MOVESI-MOVEMOD
         DW    G.MOVES/2
MOVEEND  EQU   $
*
         DSEG
DMOVE    DW    DMOVEEND-DMOVE/2
MOVESI   DW    MOVES
         DW    0
DMOVEEND END