Manipulating the keyboard buffer
Posted: Sat Jul 01, 2023 4:57 am
Hi
I'm having trouble making this work - it's taken from a very similar program by Ian Sinclair for the C64 in BASIC V2.
The program is designed to delete a block of lines from a BASIC program.
The only changes I've made are to the poke locations for the keyboard buffer etc. These changed poke locations were found by digging through the appropriate .SYM files that come with the emulator.
When you run the program with
the screen clears, asks you to enter the start & stop line numbers of lines in your BASIC code you wish to delete, and it deletes them for you by clearing the screen, and then repeatedly putting 4 RETURN chars in to the keyboard buffer, printing the line number of the next line to delete, keeping it as blank, and then below it printing a new entry for line 63940 and below that the command
then the SYS 50876 calls the routine in the BASIC ROM that is effectively a warm start that executes the commands in the keyboard buffer.
Any pointers or other help gratefully accepted.
I'm having trouble making this work - it's taken from a very similar program by Ian Sinclair for the C64 in BASIC V2.
The program is designed to delete a block of lines from a BASIC program.
The only changes I've made are to the poke locations for the keyboard buffer etc. These changed poke locations were found by digging through the appropriate .SYM files that come with the emulator.
When you run the program with
Code: Select all
RUN 63900
Code: Select all
GOTO 63940
Code: Select all
63900 CLS:INPUT "ENTER START,STOP LINE NOS:",S,F:CLS
63910 PRINT CHR$(19)S:S=S+10:IF S>F+10 THEN 63960
63920 PRINT "63940 S=";S;" :F=";F:PRINT "GOTO 63940"
63930 POKE 43008,19:FOR N=43009 TO 43011:POKE N,13:POKE 43018,4:NEXT:SYS 50876
63940 REM DUMMY LINE
63950 GOTO 63910
63960 POKE 43018,0:CLS:END