Personal Computer News


Memory Move Routine Already There

 
Published in Personal Computer News #065

Memory Move Routine Already There

After spending a couple of hours writing a general purpose memory routine in 6502 machine code for the Oric 1, I discovered that there is already one in existence in the ROM at #EC0C.

Three parameters are needed to use it. First comes the address of the start of the source (the memory to be moved); this is DOKEd to #200. Next the address to which it is to be moved, which is DOKEd to #202. Then the number of bytes to move is DOKEd to #204. Now a CALL#EC0C will move the memory.

10 CLS
20 REM FILL FIRST THREE LINES WITH A'S
30 FOR I=48040 TO 48040+119
40 POKE I,65
50 DOKE#200,48040: REM START ADDRESS
60 DOKE#204,120: REM MOVE 120 BYTES
70 DOKE#202,48440: REM MOVE TO HERE
80 CALL#EC0C

The program below demonstrates this by moving three lines of As starting at the top of the screen down to the tenth line of the screen. The routine could be used to move the normal character set and put in one of your choice and then with the help of a subroutine move from one set to the other.

Another use would be for moving objects rapidly around the screen.

C. Hamilton, Belfast

C. Hamilton