Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QBasic from the Hell
#31
http://sourceforge.net/projects/qbcc
b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?
Reply
#32
Ah.. mucho gracias! Is this project totally dead now?
Reply
#33
Quote:Na_th_an:

If the variables are not adding together or the mouse is stucking in the upper
- left corner, and the FUNCTIONs are being merged with DEFINT before every run
are typical whereabouts of DOS16 coding, then sorry... I could never imagine
that in DOS the variables not have to add together...

That never happened to me in 10 years of QBasic/QB coding in the DOS16 platform. As I told you, maybe it's time to check if your QB version is corrupt.

Quote:If i had problems with DOS then i would not start any topic of it but move to
a 32 bit language. But so far i programmed in Turbo C and NASM (The DOS - 16
version), so i know what are the limits of DOS and what are the faults of QB...

Ditto. The faults of DOS are simple: the memory is not protected, so your program can write anywhere. That can screw up things. If you do such things, as the QB runtime is there caring for what you do, the results are not a crash but a malfunction. QB has bugs, but they are not that terrible. As I told you, I've been coding in QBasic/QB for more than 10 years now and I have coded all sort of stuffs from games to applications, pushing the memory/speed/efficiency limits to the maximum, and I never had such nasty problems. And when I had a problem that resembled one of the cases you've mentioned, I found after a while that it was 'cause of my own faulty code that did stuff that shouldn't.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#34
Quote:Ah.. mucho gracias! Is this project totally dead now?
Yep has been for years, i considered restarting it a while ago, but i caught myself before i did. Last file is from 4 years ago, and i dont think it even uses alllegro 4..
b]Hard Rock[/b]
[The Stars Dev Company] [Metal Qb flopped] [The Terror]
Stop Double Posts!
Whats better? HTML or Variables?
Reply
#35
I looked at the code... excuse my French, but it sucks. I had a helluva time getting it to compile at all, and once I did, it didn't work the same way as the original binaries, which didn't work anyway.

IMO, it'd be better to start anew rather than hack up this mess of a compiler, which is what I'm going to do. Mine will generate C (or maybe C++) like QBCC, but with a full-fledged bison-based core and a cleaner standard library that doesn't use Allegro. Unless, of course, OBDS gets done soon and I can just hack up a DOS32 standard library and code generator. Smile
Reply
#36
I know that in DOS i can write anywhere including on the OS or other things.
But DOS says that which memory locations can be used. I created a really huge
program in C built up from more than ten modules having an EXE larger than
90Kb (This is a very big program at Turbo C), but i never ran in problems like
at QBasic.

The problem was rised this way (As i said before):

I had a module in which i had this line in a FUNCTION:

tmp& = array1&(i%) + array2&(j%)

Then i added some new parts somewhere else to this program, and then it failed.
I could not believe, so i tested many times:

tmp& = array1&(i%)
tmp& = tmp& + array2&(j%)

worked, but the code above did not. Originally it worked, and when running
from the IDE this problem not rises.
So simply adding the arrays together WORKED both compiled and not compiled in
the original form. After inserting some new parts the first way FAILED in the
compiled form, but WORKED in the IDE. When replacing only that piece of code
to the second form, it both WORKED compiled and in the IDE.

I do not really think that this happened because of DOS is not protected...


The mouse bug: I must tell it again: look in my previous posts. I really tested
it on all those configurations, and it failed (Not only my current version of
QB, but all including a v4.0 and an another copy of v4.5).
So if something is corrupt here it is the Hungarian government which built the
same bug in all of the computers arriving to Hungary for some heavy bundles of
money... (Just joking Smile )



Compilers... I think BASIC should be never written based on C but based on
ASM... If someone writes BASIC based on C it is something like building up
Linux based on Windows 95. The BASIC language has a completely different
style to C, but it is near to ASM in structure. So building a BASIC compiler
should be started on ASM, not C (I do not say that the compiler itself must
be written in ASM, but it should compile BASIC directly to ASM. I think writing
a BASIC "compiler" using NASM would be a very good idea).
fter 60 million years a civilization will search for a meteorite destroying most of the living creatures around this age...

There must be a better future for the Cheetahs!

http://rcs.fateback.com/
Reply
#37
Writing a BASIC compiler that actually generates well-optimized ASM is a lot harder than writing a BASIC-to-C translator and then letting the C compiler guys write the optimizer. Smile
Reply
#38
are there any decent basic -> c translators?
Reply
#39
Quote:I know that in DOS i can write anywhere including on the OS or other things.
But DOS says that which memory locations can be used. I created a really huge
program in C built up from more than ten modules having an EXE larger than
90Kb (This is a very big program at Turbo C), but i never ran in problems like
at QBasic.

The problem was rised this way (As i said before):

I had a module in which i had this line in a FUNCTION:

tmp& = array1&(i%) + array2&(j%)

Then i added some new parts somewhere else to this program, and then it failed.
I could not believe, so i tested many times:

tmp& = array1&(i%)
tmp& = tmp& + array2&(j%)

worked, but the code above did not. Originally it worked, and when running
from the IDE this problem not rises.
So simply adding the arrays together WORKED both compiled and not compiled in
the original form. After inserting some new parts the first way FAILED in the
compiled form, but WORKED in the IDE. When replacing only that piece of code
to the second form, it both WORKED compiled and in the IDE.

I do not really think that this happened because of DOS is not protected...

I will try that ASAP.

Quote:The mouse bug: I must tell it again: look in my previous posts. I really tested
it on all those configurations, and it failed (Not only my current version of
QB, but all including a v4.0 and an another copy of v4.5).
So if something is corrupt here it is the Hungarian government which built the
same bug in all of the computers arriving to Hungary for some heavy bundles of
money... (Just joking Smile )

Maybe your mouse code leaves some stuff uncared of. It's like when you BREAK your program when you are using some keyboard handlers and it's like if SHIFT was pressed all the time. What mouse code are you using? Anyhow, that's just the IDE; nothing to do with the compiler.


Quote:Compilers... I think BASIC should be never written based on C but based on
ASM... If someone writes BASIC based on C it is something like building up
Linux based on Windows 95. The BASIC language has a completely different
style to C, but it is near to ASM in structure. So building a BASIC compiler
should be started on ASM, not C (I do not say that the compiler itself must
be written in ASM, but it should compile BASIC directly to ASM. I think writing
a BASIC "compiler" using NASM would be a very good idea).

AFAIK, QB's routines are written in assembly, plus BC itself generates pure assembly. The IDE was written in C, I think.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#40
Quote:AFAIK, QB's routines are written in assembly, plus BC itself generates pure assembly. The IDE was written in C, I think.
Yup; try BC /A sometime and specify a .LST file; you'll get the exact ASM that BC is producing. Very good for optimization. Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)