Hi Jochen,
I was looking at a book by Creative Computing "More BASIC Computer
Games", David H. Ahl, 1979. And was thinking of typing in some of
them for old times sake. The BASIC used for these programs is the
Microsoft BASICA. The version I have is from the MS_DOS 6.22
installation diskettes. Now for a dumb question about MASMBASIC.
How compatible are these two BASICs? Or, how easy would it be to use
MASMBASIC to run a BASICA program? My most used computer here doesn't
run MASMBASIC or I would look at it here.
Notes:
1. I can run BASICA, but this is to share with someone with Windows
10, which cannot run DOS programs natively. And I don't know if I can
do a software installation on his system,
2. I am, at best, a slow typist. So if this happens at all, it will
probably be a limited excursion. Mostly to reacquaint myself with using
BASIC.
3. Along with #2, these games look a bit contrived. So probably not
much of a loss if I give up early on in this enterprise.
Alternate version of the question; what is the best free BASIC to
run BASICA programs in a Windows 10 console?
Regards,
Steve
Hi Steve,
Can you post an example (not a Hello World, something bigger)?
MasmBasic is closer to GfaBasic, but it might not be difficult to write a translator. It seems BASICA is roughly the same as GW-BASIC (https://en.wikipedia.org/wiki/GW-BASIC#Features), right?
Quote from: jj2007 on May 18, 2024, 05:36:14 AMHi Steve,
Can you post an example (not a Hello World, something bigger)?
Here is one of the games. Typed in, partly debugged, and starts to
run. It may have more errors though. I also put in some INPUT statements
to avoid the scrolling from allowing one to read things. Not yet worked
out for all text.
QuoteMasmBasic is closer to GfaBasic, but it might not be difficult to write a translator. It seems BASICA is roughly the same as GW-BASIC (https://en.wikipedia.org/wiki/GW-BASIC#Features), right?
If I remember, GW-BASIC was newer and could compile to an executable.
BASICA is only an interpreter. They were compatible for all the programs
I tried at the time. Equals long ago though.
Regards,
Steve
Attached a translated file - a very early version, just to give you an idea... lots of manual fixes needed. I won't have much time to work on it.
Source and exe of the translator in the second attachment. Drag any *.bas file over the exe to translate it to MyTest.asm
I found a package which combine qbasic with dosbox,for old basic programs designed to run on slow few MHz CPU ,to keep speed down to make old games playable
Other way is like jochen pacman example ,put code in timer that updates each frame 1/60 ,otherwise running changing screen coordinates @3ghz makes game unplayable, because objects on screen seem to move at lightspeed
The big advantage is a very slow init data on original computer ,is made in milliseconds or less
My 16 bit dos coding started with emulate similar apple 2 vector graphics, few bits / vector
Hi,
Will look at the attachments.
A fix to a technical error: The BASIC mentioned in the book is
"Microsoft BASIC". BASICA was in the IBM PC as a ROM. QBASIC was
the one supplied with MS-DOS. All are similar.
Regards,
Steve N.
IBM ROM BASIC (https://www.ardent-tool.com/tech/ROM_BASIC.html)
Version 2 - throw some code at it (i.e. drag the *.bas over the exe) and let me know what you think. There is still lots of manual work to do, but it starts to look acceptable.
Before (excerpt, first 40 lines of 225):
10 PRINT TAB(33); "WUMPUS"
20 PRINT TAB(13); "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
22 PRINT
24 PRINT
26 PRINT
30 PRINT "INSTRUCTIONS (Y-N);"
40 INPUT I$
50 IF I$ = "N" THEN 60
55 GOSUB 1000
60 REM- SET UP CAVE (DODECAHEDRAL NODE LIST
70 DIM S(20, 3)
80 FOR J = 1 TO 20
90 FOR K = 1 TO 3
100 READ S(I, K)
110 NEXT K
120 NEXT J
130 DATA 2,5,8,1,3,10,2,4,12,3,5,14,1,4,6
140 DATA 5,7,15,6,8,17,1,7,9,8,10,18,2,9,11
150 DATA 10,12,19,3,11,13,12,14,20,4,13,15,6,14,16
160 DATA 15,17,20,7,16,8,9,17,19,11,18,20,13,16,19
170 DEF FNA (X) = INT(20 * RND(1)) + 1
180 DEF FNB (X) = INT(3 * RND(1)) + 1
190 DEF FNC (X) = INT(4 * RND(1)) + 1
200 REM- LOCATE L ARRAY ITEMS
210 REM- 1-YOU,2-WUMPUS,3&4-PITS,5&6-BATS
220 DIM L(6), M(6)
230 FOR J = 1 TO 6
240 L(J) = FNA(0)
260 M(J) = L(J)
270 NEXT J
280 REM- CHECK FOR CROSSOVERS (IE L(1)=L(2) ETC)
290 FOR J = 1 TO 6
300 FOR K = 1 TO J
310 IF J = K THEN 330
320 IF L(J) = L(K) THEN 240
330 NEXT K
340 NEXT J
350 REM- SET# ARROS
360 A = 5
370 REM- RUN THE GAME
375 PRINT "HUNT THE WUMPUS"
380 REM- HAZARD WARNINGS & LOCATIONS
390 GOSUB 2000
After:
Print At(33) "WUMPUS"
Print At(13) "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY"
Print
Print
Print
Print "INSTRUCTIONS (Y-N);"
Input I$
.if#== I$ = "N" //jmp @60
call @1000
@60:
;- SET UP CAVE (DODECAHEDRAL NODE LIST
Dim S(20, 3) As DWORD
For_ J = 1 TO 20
For_ K = 1 TO 3
Read S(I, K)
Next K
Next
Data 2,5,8,1,3,10,2,4,12,3,5,14,1,4,6
Data 5,7,15,6,8,17,1,7,9,8,10,18,2,9,11
Data 10,12,19,3,11,13,12,14,20,4,13,15,6,14,16
Data 15,17,20,7,16,8,9,17,19,11,18,20,13,16,19
# FNA (X) = INT(20 * RND(1)) + 1
# FNB (X) = INT(3 * RND(1)) + 1
# FNC (X) = INT(4 * RND(1)) + 1
;- LOCATE L ARRAY ITEMS
;- 1-YOU,2-WUMPUS,3&4-PITS,5&6-BATS
Dim L(6), M(6) As DWORD
@230:
For_ J = 1 TO 6
@240:
L(J) = FNA(0)
M(J) = L(J)
Next
;- CHECK For_ CROSSOVERS (IE L(1)=L(2) ETC)
For_ J = 1 TO 6
For_ K = 1 TO J
.if#== J = K //jmp @330
.if#== L(J) = L(K) //jmp @240
@330:
Next K
Next J
;- SET# ARROS
@360:
A = 5
;- RUN //jmp GAME
Print "HUNT THE WUMPUS"
;- HAZARD WARNINGS & LOCATIONS
@390:
@390:
call @2000
Version 3 attached.
Version 4
I must say that the *.bas code is a really ugly example of spaghetti code - it hurts the eye. GfaBasic in the 1980ies was a thousand times better.
I would check what the code does and rewrite it from scratch.
Hi Jochen,
Quote from: jj2007 on May 20, 2024, 08:18:43 AMI must say that the *.bas code is a really ugly example of spaghetti code - it hurts the eye.
Well, that book has seventy to eighty odd more of the same ilk.
Not to mention using rather small text. That hurts my eyes.
Cheers,
Steve
Quote from: FORTRANS on May 20, 2024, 10:27:06 PMWell, that book has seventy to eighty odd more of the same ilk.
It was actually a short period before structured BASIC arrived, but long enough to destroy BASIC's reputation forever.
I agree on annoying spaghetti code,gosub 2000 for example but compiled its might instead hidden on different call memory address 2000 instead
Small text has pre computer solution : reading glasses,but if you are lucky someone has scanned in all old computer magazines that had basic code as PDF
Edit
I don't know if archived compute magazine have any basic game of interest ?
Copy and paste code simpler than tedious type in basic code in editor ?
Quote from: FORTRANS on May 18, 2024, 04:44:42 AM....
Alternate version of the question; what is the best free BASIC to
run BASICA programs in a Windows 10 console?
Regards,
Steve
PC Basic will probably work for most BasicA programs https://robhagemans.github.io/pcbasic/ (https://robhagemans.github.io/pcbasic/)
btw, Capture2Text might help if the source code is a scanned image https://capture2text.sourceforge.net/#download (https://capture2text.sourceforge.net/#download)
I see random generated area in wumpus code!wish for find old basic or other language code that random generates whole world
Or for example random generates two different villages,with 2 different random seeds
32 bit code access to fill few GB with milky way galaxy ?
Since we're tossing out our opinions of BASIC here, mine is still pretty much the same as it's always been.
BASIC was actually my very first encounter with computers of any sort (and I learned on a mainframe!). It was very well suited for that job, introducing newbies to computer programming. That was the intention of its creators, Kemeny and Kurtz, to be a teaching tool, not necessarily a high-level language suitable for commercial and scientific usage.
Beyond that, I've never considered it a "serious" programming language, and still don't. Oh, sure there's PowerBASIC, all tarted up to look like a "real" language, but it still isn't really, in my opinion. I mean, why use it when there are much better alternatives available that aren't like hammering a square peg into a round hole?
However, my opinion ain't gonna stop millions of people from using all kinds of weird languages. Different strokes for different folks, I guess.
BTW, I hasten to add that I exempt MasmBasic from this opinion, because it's not really BASIC. JJ, wouldn't you agree? I mean, it has a lot of BASIC-like constructs, but it's really an assembly-language framework that allows some familiar BASIC operators and statements.
If it were really a BASIC dialect then you wouldn't be having all that difficulty porting a real BASIC program over to MasmBasic, now would you? It should be able to digest a BASIC program more or less as-is.
It (MasmBasic) is however a pretty marvelous thing all of its own. It's sui generis. (Look that up.)
Quote from: NoCforMe on May 21, 2024, 06:16:00 AMI exempt MasmBasic from this opinion, because it's not really BASIC. JJ, wouldn't you agree?
MasmBasic is inspired by GfaBasic. The latter was lightyears ahead of SpaghettiBasic aka GW-Basic. I don't know PowerBasic well, but when I tested it years ago, I felt it was clumsier than GfaBasic. But it is still far away from SpaghettiBasic, and it's blazing fast because coded in Assembly. Only MasmBasic is faster than PowerBasic (most commands, that is).
MasmBasic is Assembly with embedded BASIC. By definition, whatever gets digested by an assembler who then spits out a Windows executable is
Assembly.
It continues a tradition introduced by Mr. Steve Hutchesson many years ago: cls, print, left$, right$, chr$, trim$, str$, hex$, switch, write, input, inkey and many more are BASIC commands. Check \masm32\macros\macros.asm :cool:
Well, hats off to Hutch.
Hats off to hutch
I feel comfortable with using all those macros in mask rather than c style coding
Well old way was speed up basic code by port it to asm,result in machine code in data statements that are called from basic
I got newer ti basic and z80 asm capable calculator with cross development from PC with help of USB cable
So I can write basic code anywhere if I get an idea to code and later port to x86 ,sometimes also SIMD
Quote from: daydreamer on May 21, 2024, 03:37:35 PMHats off to hutch
I feel comfortable with using all those macros in mask rather than c style coding
Well old way was speed up basic code by port it to asm,result in machine code in data statements that are called from basic
I got newer ti basic and z80 asm capable calculator with cross development from PC with help of USB cable
So I can write basic code anywhere if I get an idea to code and later port to x86 ,sometimes also SIMD
One reason to choose C was, that somewhere in 80's i didn't want any spaghetti code, i wanted some static specs for programming language, that i will use rest of my life. I never have to regret that.
It is very good to know programmers backgrounds and how they behave.
TurboBasic was important language at that time, as it gave possibility to compiled code, that save code. Also TurboPascal was at one point a good language for me.
Quite funny to read some comments, when many knows in this site many people, who have been a very long time in programming world, since real PC programming started.
I used Commodore VIC 20 basic for my homeworks in technical school, so many understand, how people started to use personal computers, when those got available.
Timo
When i went engineer school,was full of computers in many computer room
They changed the rules for tests so we where allowed ti82 grapical and programmable calculators,so me and my friends bought those calculators
Without them you had small formula books which also contained lookup tables for trigo,exp,log
Found second ti82 i had few years ago,and found info on internet about newest ti version supported z80 programs and cross developing tools on pc with usb cable
Quote from: daydreamer on May 22, 2024, 02:15:20 AMTimo
When i went engineer school,was full of computers in many computer room
They changed the rules for tests so we where allowed ti82 grapical and programmable calculators,so me and my friends bought those calculators
Without them you had small formula books which also contained lookup tables for trigo,exp,log
Found second ti82 i had few years ago,and found info on internet about newest ti version supported z80 programs and cross developing tools on pc with usb cable
in technical lab was an ABC computer, that only teachers used.
Advanced BASIC Computer (https://en.wikipedia.org/wiki/ABC_80)
ABC 800 (https://en.wikipedia.org/wiki/ABC_800)
Same time in Finland:
(https://i.postimg.cc/xqtCC1zt/mikromikko2.jpg) (https://postimg.cc/xqtCC1zt)
Later i might add a photo of MikroMikko, what it looks like today, when i find one from my storage :smiley:
Some people like this photo, as it was beginning of 32-bit computing :
(https://i.postimg.cc/0zgq5TcV/Compaq386s.jpg) (https://postimg.cc/0zgq5TcV)
Since we're reminiscing, here's my setup from ca. 1988, when a '386 was a big deal:
Notice my mascots on top of the case.
(https://i.postimg.cc/TKb0dQZq/386-Flag.jpg) (https://postimg.cc/TKb0dQZq)
Not sure what that little Mac was doing there; I have no memory of ever using it.
I did have a very nice Panasonic flatbed scanner, seen at right. (My company developed an early OCR program, which I actually started--in assembly language!)
Thanks timo, David for showing interesting photos
While most friends got foreign gaming computers,Atari,Amiga etc
Except ,one of my friends bought ABC 802 for his student room
Quote from: daydreamer on May 23, 2024, 04:43:42 AMExcept ,one of my friends bought ABC 802 for his student room
Hmm, cute li'l computers (https://www.pugo.org/collection/computer/117/).
(Z80-based, no less)