Screen set 1 character 32 and 96 are both space.

Basic and Machine Language

Moderator: Moderators

User avatar
darkatx
Vic 20 Afficionado
Posts: 470
Joined: Wed Feb 04, 2009 2:17 pm
Location: Canada

Post by darkatx »

Mike wrote:
darkatx wrote:my aversion of the NEW command. I just don't use it ... ever
It can also recover the program after a RESET...
Of course with cross-developing the work flow has changed a lot so the occasions where an OLD routine might save your day indeed have become sparse. :wink:
I was thinking that very thing about maybe trying to recover after a reset as I typed the above...but like you mentioned before, cross-developing has changed things.. :)

Still a cool trick.
Learning all the time... :)
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Post by tokra »

I remember back in 1985/86 I found some OLD-command in a magazine which I found so useful I wrote it in my little notebook which I still have. This read:

Code: Select all

POKE BasicStart+2,1:SYS50483:POKE46,PEEK(35):POKE45,PEEK(781)+2:CLR
I even memorized this back then. Looks pretty close to what tlr wrote...
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

tlr wrote:You should be able to cut the JMP $C474
I just tried it out. Sadly, it doesn't quite work. Here's the remainder of SYS, when the return-address of the SYS call is preserved with JMP $C659:

Code: Select all

.E141  6C 14 00  JMP ($0014) ; call user routine with $E144 - 1 on stack
.E144  08        PHP         ; <- re-entry point
.E145  8D 0C 03  STA $030C
.E148  8E 0D 03  STX $030D
.E14B  8C 0E 03  STY $030E
.E14E  68        PLA
.E14F  8D 0F 03  STA $030F
.E152  60        RTS
Normally, the RTS at $E152 would return to the end of the interpreter loop at $C7EA, which in turn executes JMP $C7AE to execute the next BASIC statement. Alas, that RTS has its return address being purged ...

Nevertheless, your other ideas avoid the problematic CHR$(34) code, which should result in a much shorter PRINT statement. :)
tokra wrote:I remember back in 1985/86 I found some OLD-command in a magazine which I found so useful I wrote it in my little notebook which I still have. This read:

Code: Select all

POKE BasicStart+2,1:SYS50483:POKE46,PEEK(35):POKE45,PEEK(781)+2:CLR

I even memorized this back then. Looks pretty close to what tlr wrote...
... and when it gives an ?ILLEGAL QUANTITY error, one can use this one instead:

Code: Select all

POKE BasicStart+2,1:SYS50483:POKE46,PEEK(35)+1:POKE45,PEEK(781)-254:CLR
Anyway, here's the updated version of the screen code version, which also doesn't need any abbreviations to fit on one logical line:

Image

Code: Select all

PRINT"{CLR,RVS ON}){RVS OFF}A{RVS ON}(Q{RVS OFF}+{SPACE}3{RVS ON,SHIFT-E}J
{RVS OFF,SHIFT-POUND}B{RVS ON}E{RVS OFF}-{RVS ON}%{RVS OFF}#{SPACE,SHIFT-U,
RVS ON,SHIFT-F,RVS OFF,SHIFT-L,C=-H,RVS ON,SHIFT-D}":SYS256*PEEK(648)
Post Reply