
 1000  *SAVE S.GENERAL MOVER
 1010  *--------------------------------
 1020  *   BRUN the program to set it up as
 1030  *      a control-Y monitor command.
 1040  *--------------------------------
 1050  *   Use like the Monitor M-command:
 1060  *      A1 -- Source start address
 1070  *      A2 -- Source end address
 1080  *      A4 -- Destination start address
 1090  *--------------------------------
 1100         .OP 65816
 1110         .OR $300
 1120  *--------------------------------
 1130  A1     .EQ $3C,3D
 1140  A2     .EQ $3E,3F
 1150  A4     .EQ $42,43
 1160  BLKSIZ .EQ $00,01
 1170  *--------------------------------
 1180  CONTROL.Y.SETUP
 1190         LDA #$4C
 1200         STA $3F8
 1210         LDA #GENERAL.MOVER
 1220         STA $3F9
 1230         LDA /GENERAL.MOVER
 1240         STA $3FA
 1250         RTS
 1260  *--------------------------------
 1270  GENERAL.MOVER
 1280         PHA
 1290         PHY
 1300         PHX
 1310  *--------------------------------
 1320         CLC          65816 MODE
 1330         XCE
 1340         REP #$30     16-BIT MODE
 1350  *--------------------------------
 1360         SEC          Compute block length - 1
 1370         LDA A2
 1380         SBC A1
 1390         STA BLKSIZ
 1400  *--------------------------------
 1410         LDA A1
 1420         CMP A4       Determine direction of move
 1430         BCC .1       ...UP
 1440         JSR MOVE.DOWN
 1450         BRA .2       ...ALWAYS
 1460  .1     JSR MOVE.UP
 1470  *--------------------------------
 1480  .2     SEC          RETURN TO 6502 MODE
 1490         XCE
 1500         PLX
 1510         PLY
 1520         PLA
 1530         RTS
 1600  *--------------------------------
 1610  MOVE.DOWN
 1620         LDX A1       Source start address
 1630         LDY A4       Destination start address
 1640         LDA BLKSIZ   # Bytes - 1
 1650         MVN 0,0
 1660         RTS
 1670  *--------------------------------
 1680  MOVE.UP
 1690         CLC
 1700         LDA A4
 1710         ADC BLKSIZ
 1720         TAY          Destination end address
 1730         LDX A2       Source end address
 1740         LDA BLKSIZ   # Bytes - 1
 1750         MVP 0,0
 1760         RTS

