; ; *** Tape SAVE and LOAD for Tiny BASIC *** ; ; For $0200-loaded Tiny BASIC ; by Dave Hassler, Dec. 2022, with the idea and ; essential structure shamelessly lifted from KB9. :^) ; ; 1) SAVE. From within TinyBASIC, in 'immediate' mode (no line number), ; type Z=USR(6048) but DO NOT hit the key. Set up your ; recording device, press 'record' on that, then hit the ; key. When it's finished at $0000, hit the 'G' key, and you'll be ; returned to TinyBASIC with the program still in memory. ; ; 2) LOAD. From within TinyBASIC, type Z=USR(6080), hit , ; then start your cassette or other playback device. A successful ; load will put you back in the KIM monitor at location $0000. ; Just hit the 'G' key, and you'll be returned to TinyBASIC with ; the loaded program ready to RUN. ; ; Why make the file ID 'A4'? Tom Pittman's initials are TP, or ; $54 and $50 in ASCII. Add them together, and.... 'homage'. ; ; It's easily relocated for TB $2000 or other reasons, Some possible ; improvements could include: ; a) pass a file ID number via the USR function. ; b) have the jump to DUMPT point to Hypertape, stored...elsewhere. ; ; [I have also provided a version of the Save&Load routine that ; works with a relocated Hypertape loading at $0115. ; That will work with TinyBASIC, as the KIM-1 TB verson uses ; $0100-14. This will leave room on the stack for 20 RTSs and ; RETURNs, which should be OK. The real problem, to me, is ; that it sacrifices the other main "hiding place" for ; machine code, but what can you do? Maybe reserve some RAM ; at the top of TB?] * = $0000 .BYTE $4C $CC $17 * = $17A0 SAVE LDA $20 ; get and store program start addr for save LDX $21 STA $17F5 STX $17F6 LDA $24 ; get and store program end addr for save LDX $25 STA $17F7 STX $17F8 LDA #$A4 ; set file ID # and store STA $17F9 LDA #$00 ; clear all processor flags STA $F1 JMP $1800 ; jump to DUMPT (or Hypertape) LOAD LDA #$A4 ; set file ID and store STA $17F9 LDA #$00 ; clear all processor flags STA $F1 JMP $1873 ; jump to LOADT STORND LDA $17ED ; when returned, this will store the LDX $17EE ; loaded file's end addr. STA $24 STX $25 JMP $0203 ; ...and back to TinyBASIC ; ******************************* ; ; PAPERTAPE AND APPLE HEX FOLLOW: ; ; ******************************* ;0300004CCC170132 ;1817A0A520A6218DF5178EF617A524A6258DF7178EF817A9A48DF90D2E ;1817B817A90085F14C0018A9A48DF917A90085F14C7318ADED17AE0BC0 ;0917D0EE17852486254C0302039A ;0000040004 0000: 4C CC 17 17A0: A5 20 A6 21 8D F5 17 8E 17A8: F6 17 A5 24 A6 25 8D F7 17B0: 17 8E F8 17 A9 A4 8D F9 17B8: 17 A9 00 85 F1 4C 00 18 17C0: A9 A4 8D F9 17 A9 00 85 17C8: F1 4C 73 18 AD ED 17 AE 17D0: EE 17 85 24 86 25 4C 03 17D8: 02