
 1000  *---------------------------------
 1010  *      BLTU -- FROM THE APPLESOFT ROM
 1020  *      $D393 THROUGH $D3D5
 1030  *---------------------------------
 1040  *      ON ENTRY:
 1050  *          Y,A AND HIGHDS CONTAIN DESTINATION END + 1
 1060  *          LOWTR CONTAINS LOWEST ADDRESS OF SOURCE
 1070  *          HIGHTR CONTAINS HIGHEST SOURCE ADDRESS + 1
 1080  *---------------------------------
 1090  *      PAGE-ZERO VARIABLE NAMES FROM "THE APPLE ORCHARD"
 1100  *      VOL. 1, NO. 1, PAGES 12-18.
 1110  STREND .EQ $6D,6E   TOP OF ARRAY STORAGE
 1120  HIGHDS .EQ $94,95   BLTU'S DESTINATION POINTER
 1130  HIGHTR .EQ $96,97   BLTU'S SOURCE END POINTER
 1140  LOWTR  .EQ $9B,9C   BLTU'S SOURCE START POINTER
 1150  *---------------------------------
 1160  REASON .EQ $D3E3    CHECK IF ENOUGH MEMORY
 1170  *---------------------------------
 1180  BLTU   JSR REASON   BE SURE (Y,A) < FRETOP
 1190         STA STREND   NEW TOP OF ARRAY STORAGE
 1200         STY STREND+1
 1210         SEC          COMPUTE # OF BYTES TO BE MOVED
 1220         LDA HIGHTR
 1230         SBC LOWTR
 1240         STA $5E      SAVE PARTIAL PAGE AMOUNT
 1250         TAY          ALSO IN Y
 1260         LDA HIGHTR+1
 1270         SBC LOWTR+1
 1280         TAX          NUMBER OF WHOLE PAGES IN X
 1290         INX
 1300         TYA          # BYTES IN PARTIAL PAGE
 1310         BEQ .4       NO PARTIAL PAGE
 1320         LDA HIGHTR   BACK UP HIGHTR BY PARTIAL PAGE #
 1330         SEC
 1340         SBC $5E
 1350         STA HIGHTR
 1360         BCS .1
 1370         DEC HIGHTR+1
 1380         SEC
 1390  .1     LDA HIGHDS   BACK UP HIGHDS BY PARTIAL PAGE #
 1400         SBC $5E
 1410         STA HIGHDS
 1420         BCS .3
 1430         DEC HIGHDS+1
 1440         BCC .3       ...ALWAYS
 1450  .2     LDA (HIGHTR),Y
 1460         STA (HIGHDS),Y
 1470  .3     DEY
 1480         BNE .2       LOOP TO END OF THIS 256 BYTES
 1490         LDA (HIGHTR),Y  MOVE ONE MORE BYTE
 1500         STA (HIGHDS),Y
 1510  .4     DEC HIGHTR+1    DOWN TO NEXT BLOCK OF 256
 1520         DEC HIGHDS+1
 1530         DEX          PAGE COUNT
 1540         BNE .3
 1550         RTS

