• Please review our updated Terms and Rules here

DEC Basic question

Qbus

Veteran Member
Joined
Feb 23, 2011
Messages
963
Location
Salisbury Maryland
In a never ending quest to make three hundred and fifty pounds of PDP-11 and RL drives mimic what can be done on a programmable calculator I have reached another impasse.
At this point I have the system working and can load RT-11 and DEC Basic from my sys drive and last night using basic I type the three hundred and twenty lines of code in Basic to enter “Rock, Paper, Scissors” and the program runs with no issues. After playing around with that I saved the program naming it TEST using the Basic SAVE command and if I go back into RT-11 I can see the file in the directory as TEST.BAS but apparently I do not know how to open that file in Basic. Thought it was a simple as starting Basic and entering LOAD TEST.BAS but that’s not it because it comes up as a SYNTAX ERROR, the READ command appears more promising but not getting any love from the system using READ TEST or READ TEST.BAS I had my old version of the DEC paper tape Basic instructions but that’s not much use because it only refers to paper tape operations. Think I have a newer DEC Basic reference manual here at work and will look at that today but thought I would also ask here. And while on the subject is there a code compiler in RT-11 or in the DEC Basic package that will convert a Basic program to machine code that can be run directly without loading Basic first? Or a way to run Basic with it opening an existing program all within the same command? Something like BASIC\TEST.BAS?
Wanted to play around with this last night but after saving the file my “0” drive died and spent the next hour working on that, the reliability of my RL-01 drives is starting to be an issue. May have to put more effort into the SCSI project over on the Qbus system but somehow that don’t compare to the huge old dual drive Unibus system.
 
I'm not familiar with DEC basic under rt11, but if it's anything like RSTS, you might try:

OLD TEST

And see what happens...
 
From within BASIC, OLD TEST loads the suggested file while RUN TEST will load and then execute suggested file. Note that if the filename starts with NH, it is necessary to use RUNNH instead of RUN. You may want to use the No Header variants (RUNNH or LISTNH) even for files not starting with NH or never start a filename with NH to prevent errors.

For some of the BASICs, the compile and linking are built in. Within BASIC, COMPILE TEST then LINK TEST would give an object file. Exit BASIC. At prompt, R TEST would run the object file. Some BASICs lack the builtin Linker and won't create the object file that can be run outside of BASIC. If you have the matching manual to your BASIC, look for a section covering LINK which should correctly explain how to do this.
 
OLD works for loading an existing file from the directory in DEC Basic also stumbled across the set of manuals for DEC Basic online and will be starting to read them soon but like most things in PDP-11 land nothing ever goes as planned. Started having new issues with the 11/34 this weekend with the system not being able to load RT-11 and stopping when it gets to the memory test, I have a show memory command in the RT-11 start up routine. May have an issue in my system memory or my RL controller but am not cetin where yet. The other Qbus system is up and running and have been doing work over on that but spent most of the weekend playing around with trying to get the 34 back up and running.
 
Can't help too much, but -

I only have pdp 11/05 papertape basic. on my pdp8 I have OS/8 BASIC that loads from an RK05. You load it from the dot prompt:

RUN RKA0:BASIC - for example, if BASIC.SV is located on the first partition of the fisrt RK05 disk pack.

I don't recall of the top of my head but I think you can load BASIC and a program simulaneously, or write a batch program to do it. The BASIC programs themselves, in OS8 end in .BA. Normally you'd load BASIC, answer "OLD", and when asked to enter a filename to load, you'd enter RKA1:MYPROG (if the program MYPROG.BA was on RKA1 partition).

So, my thought is that you might want to try a colon rather than a slash.

thm_BASIC_screen.jpg

Simple example where BASIC program called CHEERSA is initiated

Bill
 
Last edited:
I can provide copies of Basic for RT-11 but only for the arcane formats that I am running at this time. RX-02 format 8”and RL-01 or 02 disk packs. Provided you ship me a RL disk pack and I will copy my systems to it along with Basic. Working on adding a SCSI drive to the 11/23 but that’s way down the to-do list, also have a Nuclear Data card and drive set for 5.25 that may be a RX50 or RX33 format but that’s further down the to-do list then the SCSI interface.
 
Please have a look at John Wilson's DUMP procedure and utility, HEX2DSK. Takes a little time, but it's ideal for making images of disks that can be shipped via internet. His instructions are for RSX, but I think there's a similar utility for RT. (?)
 
Hello,
Aside from excellent RSX11M suggestion, would it be possible to "dump" this on 8" diskettes ?? On how many will that fit ?
I may (*) , then, assume duplication for others ....

(*) PLS see my next post for "condition required" ;-)
 
Dumping DEC media on original systems over a serial port to a PC is one thing, but creating them is quite another. (See comments in other thread)

For a transfer path back to real hardware, I was thinking accessing the dumped "Image" on an emulated system like E11, then transferring the data to another media like a tape image for use in a TU58 emulator to put back into a real system.

I think Lou has had success with direct 8" access on PC, but I don't know the particulars.

Dumping an RL pack doesn't take that long and would be preferred. Frankly, I'd keep RX01/02 media strictly for read-only and try to migrate to other less perishable types for every day use.

Your mileage may vary.
 
My comments are going to be specific to RT-11, because that's all I feel comfortable using on the 11. Others can speak up if any of this carries over the other OSs.

I think emulated TU58 / PUTR is THE way that absolutely anyone can get something off the internet and into their 11. It's also a good way to go the other direction. When I was first starting out with my first trashpicked machine (with an RD51 that was screaming loud) that was how I backed up what I had, which to me was very important because that machine had RT-11 V5.3 and Basic-11 and Fortran IV and a number of special routines for Data Translation A/D D/A hardware that was in there. I have fat fingered the TU58 bootstrap on the 11/04, and keyed it into an 11/23. It will work on anything.

An alternate route may be Kermit. I use that on the pdp-8 under OS/8. However on the 11, emulated TU58 works so well, I think it's the better route.

A bit faster is RX01 sneakernet. I do have a PC set up with a Shugart SA860 and PUTR that can read and write RX01 with RT-11 / XXDP / OS/8 filesystems. See here: http://www.vintage-computer.com/vcforum/album.php?albumid=2&attachmentid=2381. Similarly, that machine can do RX50 and RX33 so those are also sneakernet candidates. As Don has pointed out, it can only do RX01 (and not RX02) for precisely the reason he mentioned. RX01 seems to be the least reliable media (ok, maybe TU60 cassettes or TK50 carts are even less reliable, but those are novelties and not practical for data transfer today.) When it works, it works fine for a while, but some low quality floppies are absolute crap while others appear to hang in for a while. Formatting standard non-dec 8" floppies will drive you to have a PC setup or a DSD440 that can format in the drive. The real DEC RX01/02 drives cannot low-level format floppies. Dec RX01-K media was preformatted. The DSD440 is nice because you can exercise the floppy easily after formatting with the on board diagnostics. Both my DSD440s are again broken and will be another winter project. As a final comment on RX01 media, I have made them into flippies by punching an additional sector hole in the jacket. Similarly I have made double sided media into RX01 flippies by punching two new sector holes in the jacket. We could easily start a whole entire thread just devoted to RX01 (and I'm up for it.)

We now can transfer RL02 images back to the 11 (and real RL02) with Reinhard's emulator. It still has an error writing a disk image from its RAM memory back to SDcard (one track on the RL02 pack image gets screwed up), but it works fine the other direction from a PUTR image (processed with my utility) back to his image and loaded on his emulator. As yet another winter project I intend to troubleshoot this last problem with Reinhard's emulator.

Moving up the high-end chain, moving files by ethernet works good also. The appropriate DEUNA/DELQA/DELUA/etc. and the Kent State RT-11 FTP package works great. With a PC set up as an FTP server you can move files back and forth easily. It even works on my lowly 11/04 with 32kW of core.

Recently I think the highest end but highest performance mode is SCSI zipdisk sneakernet. Of course it requires the least obtainable hardware. The ATA internal zip drive on the PC works fine under PUTR.

I have experience with all of the above and each has its merits.

I always wanted to try CHD's RX01 emulator: http://www.chdickman.com/rx02/ . I am a fan of Chuck's other work and would like to build this emulator, and his ATA interface also someday. I don't have any PCs running unix, so that's my hurdle on the RX emulator.

Lou
 
Last edited:
Lou, I'm just going to solve the problem but it is not easy.
In the meantime, I'm working with Windows 8 and Quartus Version 12.1 / Version 13
The Problem is to get the Dual Ported Ram (DPR) with 2 clocks implemented in QSYS although
I am already working with clock-britches. If you want to have more details, please send me a PM. Reinhard
 
Got all the bugs worked out in adopting the Atari Basic version game of Rock, Scissors and Paper into a form of RT-11/ DEC Basic that runs flawlessly on my 11/23 The newer versions of Basic allow you to group commands within one line but was not able to get that form of syntax to work using the DEC Basic so ended up building more IF and GOTO statements, also the random number generator X=INT(RND) was a bit different but got all that stuff working now. Between me and my twenty year old daughter that I dragged out to the shop last night think we played well over a hundred games and the system never hung or got stuck once. Copied the program over to a couple disk packs so once I get the 11/34 back up and running will try it on that but cannot imagine any reason why it won’t work just the same over on that system. Next big project at least software wise will be adapting lunar lander for DEC Basic.
 
Don’t know how but wonder if I can attach a word file to a post and that way show the program in a form that anyone can load and run.
 
http://vintagecomputer.net/basicprgs/CreativeComputing/lunar.bas

Code:
10 print tab(33);"lunar"
20 print tab(15);"creative computing morristown, new jersey" 
25 print:print:print
30 print "this is a computer simulation of an apollo lunar" 
40 print "landing capsule.": Print: Print
50 print "the on-board computer has failed (it was made by" 
60 print "xerox) so you have to land the capsule manually."
70 print: Print "set burn rate of retro rockets to any value between" 
80 print "0 (free fall) and 200 (maximum burn) pounds per second." 
90 print "set new burn rate every 10 seconds.": Print 
100 print "capsule weight 32,500 lbs; fuel weight 16,500 lbs."
110 print: Print: Print: Print "good luck"
120 l=0
130 print: Print "sec","mi + ft","mph","lb fuel","burn rate":print 
140 a=120:v=1:m=33000:n=16500:g=1e-03:z=1.8
150 print l,int(a);int(5280*(a-int(a))),3600*v,m-n,:input k:t=10 
160 if m-n<1e-03 then 240
170 if t<1e-03 then 150
180 s=t: If m>=n+s*k then 200
190 s=(m-n)/k
200 gosub 420: If i<=o then 340
210 if v<=0 then 230
220 if j<0 then 370
230 gosub 330: Goto 160
240 print "fuel out at";l;"seconds":s=(-v+sqr(v*v+2*a*g))/g
250 v=v+g*s: L=l+s
260 w=3600*v: Print "on moon at";l;"seconds - impact velocity";w;"mph" 
274 if w<=1.2 then print "perfect landing!": Goto 440 
280 if w<=10 then print "good landing (could re better)":goto 440 
282 if w>60 then 300
284 print "craft damage... You're stranded here until a rescue" 
286 print "party arrives. Hope you have enough oxygen!" 
288 goto 440
300 print "sorry there nere no survivors. You blow it!"
310 print "in fact, you blasted a new lunar crater";w*.227;"feet deep!"
320 goto 440
330 l=l+s: T=t-s: M=m-s*k: A=i: V=j: Return
340 if s<5e-03 then 260
350 d=v+sqr(v*v+2*a*(g-z*k/m)):s=2*a/d
360 gosub 420: Gosub 330: Goto 340
370 w=(1-m*g/(z*k))/2: S=m*v/(z*k*(w+sqr(w*w+v/z)))+.05:gosub 420
380 if i<=0 then 340
390 gosub 330: If j>0 then 160
400 if v>0 then 370
410 goto 160
420 q=s*k/m: J=v+g*s+z*(-q-q*q/2-q^3/3-q^4/4-q^5/5)
430 i=a-g*s*s/2-v*s+z*s*(q/2+q^2/6+q^3/12+q^4/20+q^5/30):return
440 print:print:print:print "try again??": Goto 70
 
Last edited:
This is Billdeg's post wrapped as a "CODE" segment. (See the forum's Advanced editor - the "#" button) Should work for most source code postings. Interested parties can select it right from their screens, and past it into a file.



Code:
10 print tab(33);"lunar"
20 print tab(15);"creative computing morristown, new jersey" 
25 print:print:print
30 print "this is a computer simulation of an apollo lunar" 
40 print "landing capsule.": Print: Print
50 print "the on-board computer has failed (it was made by" 
60 print "xerox) so you have to land the capsule manually."
70 print: Print "set burn rate of retro rockets to any value between" 
80 print "0 (free fall) and 200 (maximum burn) pounds per second." 
90 print "set new burn rate every 10 seconds.": Print 
100 print "capsule weight 32,500 lbs; fuel weight 16,500 lbs."
110 print: Print: Print: Print "good luck"
120 l=0
130 print: Print "sec","mi + ft","mph","lb fuel","burn rate":print 
140 a=120:v=1:m=33000:n=16500:g=1e-03:z=1.8
150 print l,int(a);int(5280*(a-int(a))),3600*v,m-n,:input k:t=10 
160 if m-n<1e-03 then 240
170 if t<1e-03 then 150
180 s=t: If m>=n+s*k then 200
190 s=(m-n)/k
200 gosub 420: If i<=o then 340
210 if v<=0 then 230
220 if j<0 then 370
230 gosub 330: Goto 160
240 print "fuel out at";l;"seconds":s=(-v+sqr(v*v+2*a*g))/g
250 v=v+g*s: L=l+s
260 w=3600*v: Print "on moon at";l;"seconds - impact velocity";w;"mph" 
274 if w<=1.2 then print "perfect landing!": Goto 440 
280 if w<=10 then print "good landing (could re better)":goto 440 
282 if w>60 then 300
284 print "craft damage... You're stranded here until a rescue" 
286 print "party arrives. Hope you have enough oxygen!" 
288 goto 440
300 print "sorry there nere no survivors. You blow it!"
310 print "in fact, you blasted a new lunar crater";w*.227;"feet deep!"
320 goto 440
330 l=l+s: T=t-s: M=m-s*k: A=i: V=j: Return
340 if s<5e-03 then 260
350 d=v+sqr(v*v+2*a*(g-z*k/m)):s=2*a/d
360 gosub 420: Gosub 330: Goto 340
370 w=(1-m*g/(z*k))/2: S=m*v/(z*k*(w+sqr(w*w+v/z)))+.05:gosub 420
380 if i<=0 then 340
390 gosub 330: If j>0 then 160
400 if v>0 then 370
410 goto 160
420 q=s*k/m: J=v+g*s+z*(-q-q*q/2-q^3/3-q^4/4-q^5/5)
430 i=a-g*s*s/2-v*s+z*s*(q/2+q^2/6+q^3/12+q^4/20+q^5/30):return
440 print:print:print:print "try again??": Goto 70

Just open your Word copy, select all the text and right-click COPY, then paste it into a forum post with CODE tags around it. [See above]
 
I will try to see if I can figure it out and post the program. The version of Digital Basic I have for RT-11 has issues with complex strings and have had to disassemble them to separate lines of instructions. Have been looking at the old basic games over on Atariachives.org and using there code as a starting point but almost nothing from that site will run on my PDP-11 without modification. When I get them to work they are in the simplest form but they are stable, don’t stop and are easy to understand. Probably make the programmers who live for lines of cryptic and complex code that make several things happen in a signal line furious but for the simple minded like me very satisfying.
 
The amusing thing about the AtariArchives (David Ahl) Basic games was most of them started on DEC hardware, got translated to micro Basic, and then have to be rewritten back for PDP use. I found it annoying that they didn't keep most of the routines in DEC Basic constructs that would also run on other Basics back when I had a PDP-11. At least the Ahl titles are relatively simple to unroll multiple statement lines. Wait to you hit the early 80s micro basic programs with else statements that involve lots of Peeks and Pokes; those will be an exercise in frustration.
 
Back
Top