Tiny Basic - version for PAL-1 that works to help debugging an emulator

156 views
Skip to first unread message

John Kennedy

unread,
Oct 6, 2022, 7:26:04 PM10/6/22
to PAL 6502 computer
Hi. I am looking for a definitive version of Tiny Basic that works on the PAL-1 - preferably in paper tape format. I am trying to get TB running on my KIM emulator app, and with all the various versions out there, I've yet get one to work properly.

I am hoping that if I can run it on the PAL-1, I can compare the PAL running with my emulation and discover where I have messed up.

So far I've got a version of TB that launches at 0200, gives me the : prompt and lets me enter a few lines of BASIC to run. However, when I do a LIST or my BASIC program has a loop, then everything hangs up.

Jim McClanahan

unread,
Oct 6, 2022, 8:48:54 PM10/6/22
to John Kennedy, PAL 6502 computer
Have you looked at Klaus's 6502 function test suite? It exercises all instructions and tends to make debugging an emulated processor a bit easier to validate.

I've tinkered with Tiny BASIC some and with the interpreted language between BASIC and the 6502, it can be picky. (I don't remember what I was chasing down, but it was one of the processor flags being set wrong by a change I'd made that tanked things.)

Can you print an integer in immediate mode? That would narrow it to likely the print integer code or the memory parsing for lines.

Good luck!
Jim W4JBM

--
You received this message because you are subscribed to the Google Groups "PAL 6502 computer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pal6502+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pal6502/e433ef16-1b29-4488-8545-fd1654130dcdn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Kennedy

unread,
Oct 6, 2022, 10:18:46 PM10/6/22
to PAL 6502 computer
I have so I don’t necessarily think it’s the 6502 emulation that is failing. 

John Kennedy

unread,
Oct 6, 2022, 11:07:36 PM10/6/22
to PAL 6502 computer
Oh yes - I can print an integer :)

Jim McClanahan

unread,
Oct 7, 2022, 3:07:12 PM10/7/22
to PAL 6502 computer
I think the most "authentic" versions of Tiny BASIC are at Hans' site:


It has been a while, but if I remember right the program start and end addresses are explicitly stored in Page Zero locations and if they are corrupted, thing fall apart. That is different than MS BASIC where the codes is stored as more of a "linked list" of lines where there is a pointer to the next line along with the line number as a prefix to the line of code itself. Most of my work with Tiny BASIC has been on my R6511 system (which introduces an entire new set of limitations because of the stack being down in Page Zero).

So if LIST is going off into never never land, I would tend to suspect that Page Zero is getting corrupted somehow or that 16 bit subtraction (done in two steps, but using the Carry Flag) isn't working right.

Thanks,
Jim

John Kennedy

unread,
Oct 8, 2022, 1:33:49 PM10/8/22
to PAL 6502 computer
Thanks Jim! I will try to get it running on both the PAL-1 and my app (and maybe even a real KIM-1!) and compare Zero page to see if anything jumps out.
Any subtraction is always fun on the 6502, but I was almost sure I had it working!

-John

John Kennedy

unread,
Oct 8, 2022, 3:55:47 PM10/8/22
to PAL 6502 computer
I've tried three different version of Tiny Basic that I've found in paper tape format hex files, and none work on my PAL-1 when loaded with "L".

Does anyone have a link to a papertape format (not bin) that they can confirm works on their PAL-1?

thanks

-John 

John Kennedy

unread,
Oct 8, 2022, 8:13:24 PM10/8/22
to PAL 6502 computer
If anyone has their PAL-1 set to receive code over serial, here's the TinyBasic I'm testing. Does it work for you? Runs from 0200.

;150100AD401718300EAD401710FB200E01A9FF20A01E386006CC
;1802004C85024CBD024C5A1E4CA01E4C00015F1800800486C3900506EC
;18021886C391C260B1C2A0006062036403D80305043304FD039F05092C
;18023042093F097A05FC0695059F059F05BD08C1088A089B08E90807F4
;18024861055105410852084F086208E707CD0406059F051506A70505B7
;180260B704BF048306A1049F059F05A8064F094D090707AA02370506C0
;180278BD021B09B10820415420807009A90085208522A90B85218507D0
;18029023A001B122AA49FF9122D122088A9122E622D002E62328F00B19
;1802A8EA88D8A5206D130285249865218525989120C89120A522850AD2
;1802C0C68526A52385C78527208706AD8302852AAD8402852BA9800AA5
;1802D885C1A93085C0A20086BE86C2CA9AD820F90420F2024CE6020D25
;1802F08365C930B07BC908900C0AAABD1F0248BD1E0248084065C109F0
;180308AAB1C148B50091C168950060208706A921200902A52A38ED0981
;1803208302AAA52BED840220A005A5BEF012A97E852AA902852B200A28
;180338A104A628A52920A005A907200902208706A52685C6A527850848
;180350C74CCC02A27CE4C190BAA6C1E6C1E6C11860C6BDA5BDF0AC1007
;180368A5BC852AA5BD852B60C940B0434820F9046D830285BC68480B49
;18038029076D840285BD682908D0DCA5BCA62A852A86BCA5BDA62B0B9A
;180398852B86BDA5C6E90185C6B002C6C7C524A5C7E52590AAA5BC0E7F
;1803B091C6C8A5BD91C660484A4A4A4A290EAA68C960291FB002090AE8
;1803C8E018F007652A85BC98652B85BD4CFC02A52C85B8A52D85B90C74
;1803E0202504201404512AAA20F9048AF0F10AF012A5B8852CA5B90AA1
;1803F8852D4C6403202504C90DD0F660202504C95BB0EEC94190EA0B4C
;1804100A208705A000B12CE62CD002E62DC90D1860201404B12CC90882
;18042820F0F7C93A181002C9306020250490C284BC84BDA5BCA6BD0BB1
;18044006BC26BD06BC26BD1865BC85BC8A65BD06BC2A85BD2014040A32
;180458290F65BC85BC9865BD85BD202504B0D44C800520FC06A5BC0B2B
;18047005BDF048A520852CA521852D206D05F012A528C5BCA529E50B09
;180488BDB008201404D0FB4C7C04A52845BCD004A52945BD6020A60A80
;1804A00420F90410F8E6BF30034C0902C6BF60C922F0FB20A604200AB9
;1804B81404D0F44C1403A92020A604A5BF298730E5D0F360A27B200B2F
;1804D05603E6C1E6C1E6C138B503F5009500B504F50150044980090B89
;1804E801300AD0041500F002560256025602900CA000B12AE62AD00819
;18050002E62B090060A5BEF028201404D0FB206D05F01B204C05200845
;1805180C02B009A5C4852AA5C5852B60AD8302852AAD8402852B4C099E
;180530140385BF4C4903A520852CA521852D206D05F0EBA52A85C409B3
;180548A52B85C5A90185BE60206B04F0BEA5BC8528A5BD85294C140B87
;1805600320FD0820F408207404D0EA6020140485282014048529050743
;180578286020FC06208005A5BD208705A5BCA6C1CA950086C1E4C00C04
;180590D00D4C1403A6C1E08010F7B500E6C16085BD86BC4CB805A60CAA
;1805A8C1B5011008204108A92D20A60420FC06A91F85B885BAA92A0996
;1805C085B985BBA6BCA4BD38E6B88AE910AA98E927A8B0F4C6B98A101E
;1805D869E8AA986903A890F48A38E6BAE964B0FA8810F6C6BB690A0EFB
;1805F090FA093085BCA92085BDA2FB86C3B5BD05BDC920F009A0300DE8
;18060884BD05BD20A604A6C3E8D0E860A52D48A52C48A520852CA50BAA
;18062021852DA524A625205B06F003205B06A52C38E5B6A52DE5B709AC
;180638B042206D05F03DA628A52920A005A92020A604200C02B02C0805
;180650201404D0F32083064C2F0685B6E6B6D001E886B7A4C1C0800C05
;180668F018206B04A52CA62D38E902B001CA852C4C480968852C68092E
;180680852D60A5BF30FBA90D200902AD1102297F85BFF0072064090950
;180698C6BFD0F9A90A4C6109AC120284BFB00BA930852C85C0842D0BAB
;1806B020800545808580200602A000A6C0297FF0F1C97FF0EDC9130BF5
;1806C8F0DAC90AF0D3CD1002F009CD0F02D00AE030D016A62C84BF0CE1
;1806E0A90DE4C13008A90720A6044CB3069500E8E8CA86C0C90DD00C2B
;0806F8BA2083062095058503A8
;180700BC20950585BD6020D608206B0408206D0685B886B9A5BC8509C1
;180718B6A5BD85B7A20028D00B206D05CACACA201404D0FA8428840B52
;1807302920D608A90DD12CF011E8E8E8E8C8D12CD0FAA5B68528A50E06
;180748B78529A5B885BCA5B985BD18A0008AF06E1029652E85B8A50C58
;1807602FE90085B9B12E91B8A62EE424D006A52FC525F04AE8862E0C43
;180778D002E62FE6B8D0E5E6B9D0E1652485B8852E98652585B9850E7F
;1807902FA52EE5C6A52FE5C79005C62A4C1403B124912EA624D0020AF4
;1807A8C625C624A62ED002C62FCA862EE4BCD0E7A62FE4BDD0E1A50ED8
;1807C0B88524A5B98525A5280529F017A52891BCC8A52991BCC8840C93
;1807D8B620140408A4B691BC28D0F24CCC02205403B5032980F0020A62
;1807F0A9FF85BC85BD487502950268487503950368550185BB10030A61
;180808204308A011B5001501D0034C140338A5BCF50048A5BDF5010873
;1808204845BD300A6885BD6885BC384C32086868183602360326BC0810
;18083826BD88D0D9A5BB100DA6C13898F500950098F501950160200B4E
;1808504108205403B50075029502B5017503950360205403A010B506F5
;1808680285BCB50385BD1602360326BC26BD900D18B502750095020853
;180880B5037501950388D0E660209505AAB500B401C6C1A6C194000B54
;1808984C8705A27D205603B50148B50048209505AA6895006895010882
;1808B06020FD08A5BC852AA5BD852B60A22CD002A22EB500C980B00BF5
;1808C80DB501D009A52C852EA52D852F60A52CA42E842C852EA52D09C6
;1808E0A42F842D852FA00060A52885BCA52985BD209C03A5C685260B2B
;1808F8A5C7852760B1C685BC200809B1C685BDE6C6D002E6C7A5220E24
;180910C5C6A523E5C7B0E44C140320240985BC984C820520FC06A50AE7
;180928BC85B620FC06A5BD85B7A4BC20FC06A6B7A5B6186CBC00200C9A
;180940420920F9044C8705862DE00060A00284BCA02984BDA000B109D1
;180958BCC908D0034C680360200902A9FF2C11023002A9004C09020734
;180970243A912710E159C52A5610112C8B4C45D4A080BD30BCE0130A2F
;1809881D9447CF8854CF30BCE0101116805355C230BCE0141690500ADE
;1809A0D283494ED4E57188BBE11D8FA221586F83AC225583BA24930CCB
;1809B8E0231D30BC20489149C630BC313430BC84544845CE1C1D3809CE
;1809D00D9A494E5055D4A010E7243F209127E15981AC30BC1311820A73
;1809E8AC4DE01D895245545552CEE0151D85454EC4E02D984C49530B63
;180A00D4EC24000000000A801F2493231D30BCE15080AC598552550874
;180A18CE380A86434C4541D22B845245CD1DA080BD381485AD30D30A45
;180A30176481AB30D385AB30D3185A85AD30D319542F30E285AA300AE3
;180A48E21A5A85AF30E21B542F98524EC40A8080120A09291A0A1A0836
;180A60851813098012010B313061720B04020305031B1A190B09060391
;180A780A00001C172F8F5553D280A830BC312A312A80A92E2FA2120813
;180A902FC12F80A830BC80A92F83AC38BC0B2F80A8522F84BD09020A8F
;180AA82F8EBC84BD09932F84BE09052F09912F80BE84BD09062F8409D8
;0A0AC0BC09952F09042F0000000299
;0000600060

GN L

unread,
Oct 8, 2022, 10:38:39 PM10/8/22
to John Kennedy, PAL 6502 computer
Just tested the version in your mail and it worked.

I tried a random program on Tiny Basic Handbuch (Hofacker), it works as expected, short video on twitter https://twitter.com/LiuGN/status/1578937731107155968

John Kennedy

unread,
Oct 8, 2022, 11:27:05 PM10/8/22
to PAL 6502 computer
Excellent! Once I get this version loaded onto on my own PAL-1, then..

1. If it works, great! I can compare it and my emulator side-by-side and see where I went wrong.

or

2. If it doesn't work, boo - 

Either..

2.1 the method I'm using to send hex to my PAL is broken 

or

2.2  my PAL has a hardware issue

Tomorrow should be an interesting day! :)

GN Liu

unread,
Oct 9, 2022, 8:48:59 AM10/9/22
to PAL 6502 computer
Here is the test program~
arithmetische_reihe.bas

Jim McClanahan

unread,
Oct 9, 2022, 9:45:30 AM10/9/22
to PAL 6502 computer
I  have been poking around in the source code for Tiny BASIC a bit. A while back I spent some time getting it to run to my liking on an R6511 system. Getting rid of the NULLs it sends, it also sends a Control-Q at the command prompt (to re-enable output on old system if you had stopped it by pressing Line Feed--basically a reminent of using a real punch on a teletype machine to save paper), and the Rubout character to match backspace.

If you are intercepting the character in and out jumps, the problem in Tiny BASIC is probably the code that was added to the KIM version to look for a "BREAK" (since we can't poll for Control-C without a UART).

This is actually that one line blob of stuff that gets loaded at $0100.

If that is really the problem, putting a $60 (RTS) at $0100 should make things run. (That would basically cause an immediate return without trying to check for the BREAK condition.) I tried this on the real KIM and things still work fine (just no longer looking for BREAK).

The source is at:


The bit of stuff at $0100 is actually at the bottom and conditionally assembled only for the KIM version.

Thanks,
Jim W4JBM

John Kennedy

unread,
Oct 9, 2022, 10:50:32 AM10/9/22
to PAL 6502 computer
Making progress :-)

Clearly the issue is more likely my KIM emulation rather than 6502 emulation.

Are there any more times when the "KIM-ness" required changing the source code?

But of course what I should be doing is making sure my emulation actually responds like a KIM.

Screenshot 2022-10-09 at 7.48.47 AM.png

Jim McClanahan

unread,
Oct 9, 2022, 11:13:23 AM10/9/22
to John Kennedy, PAL 6502 computer
I actually didn't look closely enough at the code. It needs to clear the carry flag before it returns to ensure it works. So at $0100 you need $18 (CLC) and at $0100 you need the $60 (RTS). That should tell it that it hasn't encountered a break condition. I'll have to double check but I assume it's checking for a break every line it lists plus every time it gets ready to go to the next line.

Thanks,
Jim W4JBM

--
You received this message because you are subscribed to the Google Groups "PAL 6502 computer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pal6502+u...@googlegroups.com.

John Kennedy

unread,
Oct 9, 2022, 11:21:56 AM10/9/22
to PAL 6502 computer
Screenshot 2022-10-09 at 8.21.18 AM.png

Jim McClanahan

unread,
Oct 9, 2022, 12:06:33 PM10/9/22
to John Kennedy, PAL 6502 computer
Great work!

So it is the code added to check for someone pressing the BREAK key. In the emulator you will either have to "dummy" a value for the RIOT register to show that nothing is on the serial port or (if you wanted to get fancy) actually intercept the keyboard for something like a Control-C and return the register so that it actually will let you interrupt things.

It looks like it is just testing bit 7 (which will set the NEGative flag if set) for the byte at $1740 (the RIOT). If it is set, then nothing is going on with the serial port. (+5 volts is the idle level for serial TTL. It gets pulled down to 0 volts for the start bit, and then the remaining bits in the character are +5V for a 1 and 0V for a 0.) So if you always return something like $80 when anything checks memory location $1740, it would seem that the serial line was idle. (Which fixes Tiny BASIC. I do wonder if there might be anything else that wants to wait until a key is really pressed.)

The BREAK key on a terminal was different than most of the character keys. It does not send a character. Instead it pulls the serial line to the 0 level (the same as the start bit--everything flips around in polarity if you add RS-232 into the mix). It seems like the Hazeltines used to send it for 2 seconds and the VT-101 was something like a half second. In this case, as long as it is low when the routine looks at the RIOT, it assumes you want to int erupt the listing or the running program.

I have to admit that life is a lot easier if you have an ACIA/UART in the mix instead of bit banging and I/O line.

Thanks,
Jim W4JBM

Hans Otten

unread,
Oct 10, 2022, 2:40:33 AM10/10/22
to PAL 6502 computer
What I do in my emulator:

- TTYIN bit 7 of $7140 returns 1: which means, no character coming in
- if CTL/C is typed in, I pull bit 7 low, to indicate a break. When $1740 is read, it is set back to 1.
- CTL/C is also delivered as input for the program to read.

Works great for all programs, including KB9, interrupting a running a program with CRL/C.

Not for Focal, that required some magic and a special setting ..

The tricks programmers had to go through to do TTY I/O and break on a KIM-1, expecting a real Teletype with tape punch reader attached.

I agree with Jim, a real serial device is such a great asset. On my wish list for a PAL- expansion board.  

The ACIA's 6850 I added to my KIM-1 made it so much better responding and also much faster.

In my emulator there is an ACIA present at $1600, so my programs adapted for an ACIA work.  In fact, all serial I/O is routed internally to this emulated ACIA.

John Kennedy

unread,
Oct 10, 2022, 3:46:32 PM10/10/22
to PAL 6502 computer
What's weird is that it doesn't run on my PAL-1
I can load other programs, e.g. Lunar Lander, but TinyBasic either hangs (if I don't set the 17xx vectors) or returns immediately to the KIM serial prompt (if I do).
This is with or without expansion memory connect.

On Saturday, October 8, 2022 at 7:38:39 PM UTC-7 liuga...@gmail.com wrote:

GN L

unread,
Oct 11, 2022, 5:37:21 AM10/11/22
to John Kennedy, PAL 6502 computer
I saw your latest version can run the TinyBASIC normally, congratulations!

The $0200 version Tiny Basic can run on PAL-1 base board, without expansions, seems the Tiny Basic occupied memory up to $0AC9. Maybe changing some slower transfer speed helps?
> --
> You received this message because you are subscribed to the Google Groups "PAL 6502 computer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pal6502+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pal6502/b0992a52-4f80-4a12-8107-cbdd77480546n%40googlegroups.com.

GN L

unread,
Oct 11, 2022, 5:37:26 AM10/11/22
to John Kennedy, PAL 6502 computer
I saw your latest version can run the TinyBASIC normally, congratulations!

The $0200 version Tiny Basic can run on PAL-1 base board, without expansions, seems the Tiny Basic occupied memory up to $0AC9. Maybe changing some slower transfer speed helps?

> --
> You received this message because you are subscribed to the Google Groups "PAL 6502 computer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pal6502+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pal6502/b0992a52-4f80-4a12-8107-cbdd77480546n%40googlegroups.com.

Jim McClanahan

unread,
Oct 12, 2022, 10:12:29 AM10/12/22
to John Kennedy, PAL 6502 computer
I thought I had copied and pasted this and that it ran, but then I got to wondering if maybe something I had worked with earlier had left something in memory that made it work. (Long story, but it happened when I was working with Apple Integer BASIC.)

So I just powered up the KIM, did a copy & paste of the punch data, and a 0200 G. Tiny BASIC fired up and I was able to enter, list, and run a program.

The symptoms you describe are strange. The only thing I can really think of to suggest is doing a comparison of what's in memory to the PUNch file. If other programs didn't run either, I'd tend to suspect hardware. But since other programs run, and since I know that Tiny BASIC runs with that punch file on my system, I tend to think software.

The one other thing you might want to do is run a memory test. Since all of this is in low memory, I could see a remote possibility of something like one of the address lines to RAM maybe having a cold solder joint or something. (I, for example, A10 is just floating on the onboard RAM, you might see memory "mirror" itself with the same 1K stored in the upper or lower part of any 2K segment.)  And if it was something like that, it would only affect larger programs that were in the lower memory space. That is kind of an obscure problem and I would think you would have seen other symptoms by now, but (it has become cliche now) we ran A LOT of memory tests. :-)

But the real bottom line is that the code is good. If memory is working and if the program is loading, it should run.

Thanks,
Jim

--
You received this message because you are subscribed to the Google Groups "PAL 6502 computer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pal6502+u...@googlegroups.com.

John Kennedy

unread,
Oct 12, 2022, 7:33:49 PM10/12/22
to PAL 6502 computer
Screen Shot 2022-10-12 at 4.32.49 PM.png

Well it's working now so I'll take it :-)

Dimitri

unread,
Oct 13, 2022, 11:45:59 AM10/13/22
to PAL 6502 computer
I agree with Jim, a real serial device is such a great asset. On my wish list for a PAL- expansion board.  

The ACIA's 6850 I added to my KIM-1 made it so much better responding and also much faster.

In my emulator there is an ACIA present at $1600, so my programs adapted for an ACIA work.  In fact, all serial I/O is routed internally to this emulated ACIA.

Apologies for hijacking this thread, but given Hans' comments, would something like the following be of interest:

serial.png

I have only just ordered an MC6850 from eBay, so won't be able to test anything much until that arrives. Meanwhile, the adventurous among you can find the (untested!) schematic and magazine article on which it is based on github:  https://github.com/dimitrit/pal1rs232

Very happy for any questions/comments/etc - in particular I'd be interested in people's views on the DB9 connector. Is it helpful to have an onboard connector, or would a 2x3 (or 1x5) pin header be more useful? I'm in two minds myself. Also, the base address for this board is either $16E8 or $16EA (selectable using JP1), rather than Hans' $1600. The reason is that I started at $16FF (and going down) for my other (mostly imaginary) expansion boards.

Thanks,
D.

Jim McClanahan

unread,
Oct 13, 2022, 3:00:59 PM10/13/22
to PAL 6502 computer

I would definitely be interested in a serial card. I've ordered some 6552 dual ACIAs and was thinking that one could use some of the logic for the second RIOT to build something fairly simple.

I'll go a step further than removing the DB-9... I'd just bring things to a header at TTL levels. Then you could plug in one of the serial adapters that takes direct USB, an RS-232 level adapter, or even one of the bluetooth serial modules. Getting rid of RS-232 or "outsourcing" the work to a cheap module makes life easier IMHO.

Thanks,
Jim W4JBM

John Kennedy

unread,
Oct 13, 2022, 3:31:34 PM10/13/22
to PAL 6502 computer
How did one load and save large TinyBasic programs into a KIM back in the day? Typing something like Adventure in http://www.sunrise-ev.com/photos/1802/TFBOTBAS.HTM#chapter6 would be painful.

Hopefully a Basic program lives in a specific block of memory that could be loaded in via serial / paper tape format once TinyBasic is itself loaded?


John Kennedy

unread,
Oct 13, 2022, 3:32:12 PM10/13/22
to PAL 6502 computer
Oo interesting. Would the KIM's monitor program be patched to use it?

Jim McClanahan

unread,
Oct 13, 2022, 4:59:46 PM10/13/22
to John Kennedy, PAL 6502 computer
Patching the ROM software would be fairly simple for most programs. It would probably also mean patching the ROM on the motherboard.

You might kind of have to make the decision to move away from the "stock" KIM.

I don't see a problem updating the ROM(s) if a "standard" ACIA approach was clear.

Thanks,
Jim W4JBM

Ronny Ribeiro

unread,
Oct 13, 2022, 5:57:25 PM10/13/22
to PAL 6502 computer
I would love to have this board on my PAL. And I agree with Jim: ditch the DB9 connector for a TTL header to connect directly to one of this ubiquitous USB-Serial adapters:
photo_2022-10-13_18-52-00.jpg
Cheers!
Ronny

Dimitri

unread,
Oct 14, 2022, 7:04:24 AM10/14/22
to PAL 6502 computer
Thank you for your suggestions - I have updated the schema to allow an "alternative build", in which the DB9 connector and MAX232 and related components can be omitted and where the TTL signals are accessible from a pin socket.
serial-alt.png
I also noticed an issue with the schematic (now updated on github). There may well be others, but I won't be able to do any testing until my eBay orders arrive and I find some spare time.

Thanks,
D.

John Kennedy

unread,
Oct 14, 2022, 10:16:52 AM10/14/22
to PAL 6502 computer
TinyBasic doesn't have load or save, right? To load you would send ASCII over serial to be "typed in".. how could you save?

Dimitri

unread,
Oct 14, 2022, 11:13:57 AM10/14/22
to PAL 6502 computer
Back in the day you would simply LIST the program with your teletype paper tape in punch mode.  The program could then be loaded from tape later.

I haven't looked at the 6502 version of Tiny Basic, but in the 8080 and my Z80 implementation, BASIC programs are kept in memory as plain text (rather than tokenized as in other BASICs). The SAVE statement that I added to my CP/M  implementation (TastyBasic), simply saves the contents of the memory between program beginning and end pointers to a file. LOAD then restores memory from a file and updates the end of text pointer. 

Assuming the 6502 implementation of Tiny Basic manages program text in a similar fashion it should very simple to add SAVE and LOAD statements. The bigger question is to what kind of file system?

D.
Reply all
Reply to author
Forward
0 new messages