VOGONS


Reply 60 of 75, by curvedline

User metadata
Rank Newbie
Rank
Newbie

puhaaaaaaa
unbelievable!
so system engineers could extract the core part and dissect and add it to their own, i just witnessed something that i thought impossible
this means you dont really need to use the assembler to make programs from the start, use true basic and once done, convert the core parts to the assembler or C scripts, once thoughts were well lined up, just write with the HIGH level compiling programs with like TB, then turn them into the LOW level scripts to ADD more basic controls

is it possible to extract sines and cosines and etc as to know how they actually add and subtract and things together to make a complete research function? if so, i can not send a demo program to certain organizations in an attempt to win a nobel prize(basically it means I just sent my discovery before a publication)

i will make a 26 line timer, you can extract properly. or if you prefer a 1 menu title and 24 line timer i will make that one too.
i need the 2 sec to check to know if the sound and volume is turned on and up before it starts
i need this timer to control how long i can turn on a heater or for cooking or especially filling water in a yard tub WHILE playing games or watching some youtubes

wait a minute, i just checked
unsigned Times[] = {
10, 20, 30, 45, 60, 90,
120, 180, 240, 300, 360, 420, 480, 540, 600,
900, 1200, 1500, 1800, 2100, 2400, 2700, 3000, 3300, 3600, 0 };

you can just add or remove some numbers for your own favorite
in this case, how about adding {home}{end}{PgUP}{PgDN} these 4 keys to navigate faster
and you like arrow keys not working when the timer is going?
timer -N20 doesnt beep 20 times, it beeped 8 times. what does 20 mean here?
timer -N2 beeps once
nicely done and super talent!

i want to learn how to compile this timer.c

Last edited by curvedline on 2025-02-12, 06:15. Edited 3 times in total.

Reply 61 of 75, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-11, 08:34:
puhaaaaaaa unbelievable! so system engineers could extract the core part and dissect and add it to their own, i just witnessed s […]
Show full quote

puhaaaaaaa
unbelievable!
so system engineers could extract the core part and dissect and add it to their own, i just witnessed something that i thought impossible
this means you dont really need to use the assembler to make programs from the start, use true basic and once done, convert the core parts to the

The only "extracting" I did from your program was to run in on a second monitor and try to make mine look like
it as I wrote it. I didn't extract any code, or have to write anything in assembler.. I just coded in C ... my compiler
has libraries to do "screen IO with colors" etc...

I also have VGA graphics libs, but for simple system tool, I tend to stick to the standard DOS text .. yes, I could use 43
lines, but that would let out some standard DOS screen environments - sticking with 25 lines make stuff work "most
anywhere" ... I could have done two columns to have more items, but I was trying to make it look as much like the
original as possible (and things like "2s" option I didn't mind at all dropping is that something I doubt I'd ever use)

I get that TrueBasic is an easier way to do some things ... but sounds like it's not a true compiler and packs the core
of the basic interpreter into your program when you make a .EXE - A true compiler converts the source code you
type into executable code instructions. Any "libraries" you use in your program are linked into the output,
meaning you only get the code to perform what you intended.

For years I made my living selling programs I've written, and I think the most popular one was my C compiler. I created
it to be able to write C code and have it run on very small "embedded" systems - often processors that ran from
their own ROM, having as little as 1k of space for that code... so I didn't want to be including a "big blob" of other
code to allow it to run (let alone be paying a license fee to be able to sell it).

I also "grew up" with systems that weren't PC's and has (sometimes a lot) less than 640k memory.
Some of my early systems maxed out at 32k (or less) maximum program size...
So, yes I do tend to be overly sensitive/critical of simple programs that have a large code size.

is it possible to extract sines and cosines and etc as to know how they actually add and subtract and things together to make a complete research function? if so, i can not send a demo program to certain organizations in an attempt to win a nobel prize(basically it means I just sent my discovery before a publication)

If some wants it bad enough and with enough effort, "most anything" can be reverse engineered. But for large stuff,
it can be very time consuming/expensive. I've not looked into it, but I suspect from the way you describe it, TrueBasic is
just providing a module to run your tokenized BASIC program ... depending on the system, it may be fairly easy to
extract that tokenized BASIC program and convert it back into source code... But I haven't looked into it, and can't
say for sure what would be involved,
-- but in this case, I just wrote a whole new program that looks a bit like yours ... none of your original code was "extracted".

i will make a 26 line timer, you can extract properly....

Don't worry about it, I generally don't use/need someone else's code ... I do something fewer and fewer people seem to
do these days when wanting a program to do any certain thing ... I write it!

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 62 of 75, by DaveDDS

User metadata
Rank Member
Rank
Member

FWIW - I played a bit more with my TIMER...

Specifying seconds on command line is easier
Offers two columns of times, ranging from 5seconds to 5 hours
Slightly better timing on beeps
Cleaned up screens, less garish colors etc.

I've updated <mysite>/Drop/TIMER.ZIP

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 63 of 75, by curvedline

User metadata
Rank Newbie
Rank
Newbie

i uploaded a word game i made and 3 of my scrolling programs, you might get surprised
https://mega.nz/file/bR5QFQoK#UOr5W5ZSh2Oy2Wb … s-53TIimHA8qEUU

about timer it was getting better,
but for me i like to see the menu while its going. seeing it makes me ponder easily more as to what next plan i can make.

>I get that TrueBasic is an easier way to do some things ... but sounds like it's not a true compiler and packs the core
>of the basic interpreter into your program when you make a .EXE -

> A true compiler converts the source code you
>type into executable code instructions. Any "libraries" you use in your program are linked into the output,
>meaning you only get the code to perform what you intended.

if linking makes computation slow, like GW Basic?
but TB is 15% faster than pascal, and maybe faster than C programs, i had a math competition with C once, but the result was same or TB was faster by maybe 0.05 sec however, TB can not do the single precision, can only do the double precision, while C user used a single precision against me, DOS TB is known to be the fastest compiler i know, all users said so back in the day, i would say DOS TB has exactly the same as assembler's computation speed power, they said TB was made by assembler or C(but i forgot at the moment), but TB naturally uses any subroutines that assembler makes, not errorlevels like batches but the whole variables and everything. i couldnt compare it with Fortran, because Fortran didnt have a DOS fortran, to me the thing that it was designed by Albert Einstein's math assistant was more than good enough to brag about.. and finally TB is a more structured compiler than anything know..
if then
if selected
for step next
do loop
do until loop
do while loop
do loop until
do loop while
do while loop until
do until loop while

if GOTO is used in a script that is an anti-structure

Last edited by curvedline on 2025-02-14, 03:09. Edited 1 time in total.

Reply 64 of 75, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-12, 10:35:

if linking makes computation slow, like GW Basic?

"linking" is typically joining several object modules into a single executable program.
Typically used when the programmer has multiple compiled/assembled sources which
each only represents part of the whole thing, and more commonly to join the code produced
from a program with various "libraries" that it references.
It really has nothing to do with final program speed, other than usually programs
which are not linked are being run by an interpreter.

but TB is 15% faster than pascal, and maybe faster than C programs...

I've never used TB and don't really know much about it.
I kinda assumed it was a more typical "basic interpreter" because of the large size
of the .EXE it created.

Many interpreted languages convert the source code you give it into a simpler "tokenized"
format ... basically converting the language keywords into easier to detect "special
numbers" - so when running, the interpreter doesn't have to spend lots of time scanning
and parsing the text source program.

and many "so called" compilers for such commonly interpreted languages simply tokenize
the source, and link it to a module which "interprets" that token code and makes
it "run" with out initial user interaction - but basically that has to include everything but
the interactive shell and tokenizer - from the description (and the size of the .EXE),
I thought this was probably what TB was doing!

I have quite a different perspective than most programmers. mainly because most
of my career was focused on very small "embedded" processors, and because I've
written a few interpreters, compilers, assemblers and other development tools.

In particular, I tend to think more about size and execution efficiency, examples:

I never use floating point types unless I actually need them (most BASICs - at
least the simpler ones use floating point for everything).
Many of the small processors I worked with a lot don't have native
instructions for floating point and the "libraries" to FP in software
would often be larger than the available code space - let alone MUCH
slower!

I use unsigned types for simple counters and +only calculations.
Some of the very-small processors have more trouble dealing with
signed values, and it limits by slightly more than 1/2 the range of
numbers you can represent in your +only calculation.

One of the minor thing I would like to have been different in C, is that
the basic types "int" and "char" default to being signed, and you have
to declare "unsigned int" it you want it unsigned.

A lot of simple chores (like processing the bits within a byte)
involve counting from 0 to 7 -- most programmer would think:

int i; for(i=0; i < 8; ++i) ...

Which on some super small/simple CPUs would make for an
extra instruction (or two) in the comparison to insure i wasn't -.

I would more likely code:

unsigned int i; for(i=0; i < 8; ++i) ...

I'd have preferred unsigned as the default type, and a "signed"
keyword for when you really want numbers that can go -.

I think this is getting quite far outside the original discussion...
how a programmer prefers to create code is a very personal thing
and something discussion is unlikely to change.

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 65 of 75, by curvedline

User metadata
Rank Newbie
Rank
Newbie

i modified to change the upper case to the lower case for hangman.exe
https://mega.nz/file/bR5QFQoK#UOr5W5ZSh2Oy2Wb … s-53TIimHA8qEUU

asm.exe and link.exe in this URL
https://mega.nz/file/6UwEHJLB#tbSAGITd_e8Mmyf … ci3FINoRaEFyFLI

this OR.ASM is a file given from TB compiler
while ago, i downloaded ASM.EXE and LINK.exe's from internet somewhere, floating in the empty space, i dont know what i got
ASM.EXE and LINK.ex were NOT from the same source or same maker.

i am trying to turn OR.ASM to OR.TRC that i could use it in true basic (TB)
would you investigate what asm.exe and link.exe are, i think you are able to know it less than a minute in your hand. me ... never so far.
your micro-c, i am stuck getting at two other programs as the website pointed me, i cant read ~200k, ~100k intro txt files in a short time. once i get to some reading ,
i would like to ask how to compile the script and turn it into EXE at least.

my guessing syntax might be this way
asm.exe or.asm
LINK or
EXE2bin.COM OR
REN or.bin or.trc

del or.exe
del or.obj
del or.bin

>"so called" compilers for such commonly interpreted languages simply tokenize
>the source, and link it to a module which "interprets" that token code and makes
>it "run" with out initial user interaction - but basically that has to include everything but
>the interactive shell and tokenizer

i think TB DOS was made by Assember
TBWin was made by C (this one i know for sure)
since TB can not make a small size exe file, if that is what tokenizer does than i am sure TB is tokenizing.
especially if tokening is the simplest form of adding or using things together, then it is 99.9% tokening, because TB ALWAYS goes for
the simplest method as possible. i think that was probably Kemeny's philosophy, this was why he invented BASIC, used it in manhattan project before Fortran
i could see "these simplest forms" everywhere in DOS TB compiler.
TB can not handle just about any hardware, but it does what i need, FP(floating point) computations.
controlling hardware with TB... is like endless suffering.
example) TB's LMB(left mouse botton) control is well designed in its module but if someone wanna add a RMB control in it with the paid interrupt, all break lose
two "get mouse subs" must operate SEPARATELY
1st click goes to the internal get mouse, the next clcik goes to the added sub get mouse-int, it auto closes the 1st to use the 2nd. BOTH can NOT exist in the same module
a TB script gets as ugly as it gets, basically unreadable, the only one who writes can but for a short time, my specific memory does not last long for what i did for a case like this

this is my insane list of adding all 1000s of subroutines in 10s of TRC files, when i make an EXE or uses a different version of TB exe
this is what 40 years old DOS TB still does, quite impressive

TRC.BAT
copy/b interpt.trc + stringpt.trc + dta.trc + setbreak.trc dostmp1.trc
copy/b genv.trc + scrndump.trc + getp.trc + exec.trc dostmp2.trc
copy/b dostmp1.trc + dostmp2.trc dostmp.trc
copy/b scrlib.trc + keybdlib.trc + mouselib.trc + mouse.trc mousetmp.trc
copy/b dostmp.trc + mousetmp.trc + dos-my.trc DOS.TRC
copy/b cur-scr.trc + cur-nscr.trc CURSOR.TRC

copy/b rkfp.trc + rkfpd.trc + rkfad.trc + rkfapd.trc + rkfd.trc RKF.TRC
copy/b root1.trc + root2.trc + root3.trc ROOT.TRC
copy/b cmplxlib.trc + cmatlib.trc + cmplx-my.trc COMPLEX.TRC

copy/b math1.trc + math2.trc + math3.trc + eig.trc + matrix.trc mathtmp1.trc
copy/b integ.trc + fourier.trc + spline.trc + fit.trc mathtmp2.trc
copy/b hugelib.trc + matlib.trc mathtmp3.trc
copy/b mathtmp1.trc + mathtmp2.trc + mathtmp3.trc MATH.TRC

copy/b graph1.trc + 3d.trc + graph256.trc + geocoor.trc GRAPH.TRC

copy/b str-lib.trc + str-patt.trc + str-tab.trc + str-text.trc str-tmp1.trc
copy/b str-tmp1.trc + str-my.trc strtmp.trc
copy/b parse.trc + strtmp.trc + textedit.trc WORDS.TRC

del dostmp1.trc
del dostmp2.trc
del dostmp.trc
del mousetmp.trc
del mathtmp1.trc
del mathtmp2.trc
del mathtmp3.trc
del str-tmp1.trc
del strtmp.trc

rem strlib.trc, patlib.trc, tablib.trc, textlib.trc = str-temp1.trc
rem remove geocoor.trc from graph someday
rem consider to remove graph256.trc from graph, graph256.trc cant be done completely with my know
rem copy/b is it OS indepedent?

take a time with Solar GPS, when the sun is setting, take a look at it, the map will show you are in the grey region.

Last edited by curvedline on 2025-02-14, 05:25. Edited 4 times in total.

Reply 66 of 75, by curvedline

User metadata
Rank Newbie
Rank
Newbie

one thing about a program optimization
in a nutshell, i fell for this trap, i am paying 1000s hours of workload
once a program was completed, i'd feel great, then soon i'd notice few things in code-scripts that bugged me,
so i reduced sub(subroutine)'s input numbers by 1 then right away i started to change all other scripts that were effected by the change, but not all and never all
time passed, came back, trying to fix by renaming and things also, adding more alterations NOT as a whole.. time passed, i forgot what i did even if i wrote the specific changes i made in a TXT file
all broke lose, the only way that i could fix this mess was now checking sub by sub and file by file and finding the sub from 100s libraries and 1000s files with ztree in windows for DOS.. repeat this 1000 times.
the same goes with database structure, at start of writing a program i put a redundant data column to help and identify other columns, but in an optimization process, i often removed this column and started to change the effected scripts but never all, then i could not go back and run some scripts, i forgot what i did.. i backed up entire libraries 4 to 5 different places, then i forgot which ones were the correct effected ones, turning 1000 file checking to 5000 file checking...

so i came to a point human minds would work in a redundancy, and not in an optimization, scripts must be readable as easily as possible.
this was my life lesson. when writing a script, make it as perfect as possible for the 1st time

Reply 67 of 75, by DaveDDS

User metadata
Rank Member
Rank
Member
curvedline wrote on 2025-02-14, 04:20:

i am trying to turn OR.ASM to OR.TRC that i could use it in true basic (TB)
would you investigate what asm.exe and link.exe are, i think you are able to know it less than a minute in your hand. me ... never so far.

ASM.EXE would be an "assembler" - although that's not one I terribly families with, the two I've used a LOT in DOS are:
MASM.EXE (Microsoft ASseMbler) and TASM.EXE (Turbo-ASseMbler)

An assembler takes source code in "assembly language" which is a text representation of the actual instructions
that a processor can perform and turns it into a binary object module. Note that ASM code is considered very low
level and will typically involve a lot more steps than higher level languages... Although high-level languages will internally
translate down to assembly/instruction level.

eg: In BASIC/C or other high level languages, you might code something like:

   counter = 10

Equivalent ASM code might be:

  MOV AX,10
MOV DGRP:_counter,AX

This is a VERY simple example, more complex operations like: Array1 = (Array1[idx] * Array2[idx]) + offset[idx]
can translate to dozens (and in some cases, hundreds) of ASM instructions.


A linker takes binary object modules (which might come from a "library") and combines them into an
excutable .EXE file.

For example, in C there is a fairly powerful library function called "printf" which prints things in a format you
specify in the function call (and it can be fairly complex). "printf" is typically provided by the manufacturer of
your C compiler, and may have taken 100s of lines of C to implement.

But you don't have to put the code for "printf" into your program, your compiler manufactured most likely
provided an object module for it in a library that the toolset links with the code you provide to build the final
.EXE (most likely the vendor didn't want to "give away" the source code to "printf" and only included the pre-
compiled object module for it in the provided library.

Most linkers are bright enough to only link in code from the library that you actually reference within your
program - so "printf" (and lots of other library functions) don't get put into your .EXE unless you use them!

A linker can also be used to combine multiple modules that you provided (usually also with a library) which you might
want to do with a large project rather than putting all of it in one source file. For example, if you are writing an
operating system, you might have:
startup
command interpreter
filesystem
networking
application interface
and more "modules", each of which might have many source files, all of which are compiled and then linked
into a final system image.

your micro-c, i am stuck getting at two other programs as the website pointed me, i cant read ~200k, ~100k intro txt files in a short time. once i get to some reading ,
i would like to ask how to compile the script and turn it into EXE at least.


If there are files missing, please let me know - I don't know what you mean by: ~200k, ~100k as I don't have any
files with those names. This toolset has been available for more than 30 years and I've not had such complaints....
... but I did lose my website during my events of 2019 and had to rebuild everything ... perhaps I missed something...

I'm not sure what you mean by "compiling the script" - are you asking how to compile a .C program?

Best way to find out is to read the provided documentation, but a quick hint... to compile: program.c

> cc program -pof

Will make program.COM (single 64k code+data) - if you need more memory: cc program -pofs
Will compile in "small" model, 64k code + 64k data).

The exact steps needed by a particular toolset will depend on that toolset.
btw, EXE2BIN isn't used unless you are making TINY model and want a .COM
file - LINK always makes a .EXE (even for TINY model) and .COM which only
supports TINY is smaller and simpler so I tend to convert when I can.
(.EXE has headers etc. telling the OS how to load the various parts onto memory,
.COM is a simple binary image of the (up to 64k code+data) TINY model,.

-----

Btw, I played a bit more with TIMER (It's great being retired) - and made it present a countdown (in
larger digits - bit rough because they are drawn by multiple text characters) which lets you easily
see how much time is left from across the room.... <...>/Drop/TIMER.ZIP has been updated!

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 68 of 75, by curvedline

User metadata
Rank Newbie
Rank
Newbie

SET Spec=ST2.
FOR %%V IN ('TYPE %Spec%') DO SET X=%%V
ECHO %X%
PAUSE
this batch doesnt work in DOSbox-x

a file ST2. has a line, it goes like this
old ABCDE123.TRU

i need to read 4th byte to 11th byte or until i hit the "."

"old" is the basic compiler's command to load a file ABCDE123
once i exit the tbasic compiler, i need to send the file "ABCDE123" to a different directory to compile and make an ABCDE123.EXE there
i hope to do it in one batch file
is there a way to minimize this by any chance?

the code below is a tip of iceberg, i still need to add alphabets, luckily all capitals and ~@!-_ any string that could make a file name

@ECHO OFF
CLS

ECHO =================================
ECHO True Basic - send a TRC to Z-Bind
ECHO =================================
REM 0 1 2 3 4 5 6 7 8 9
CHK1BYTE.COM ST2. 00000004 30 31 32 33 34 35 36 37 38 39
IF ErrorLevel 10 GOTO :39B1
IF ErrorLevel 9 GOTO :38B1
IF ErrorLevel 8 GOTO :37B1
IF ErrorLevel 7 GOTO :36B1
IF ErrorLevel 6 GOTO :35B1
IF ErrorLevel 5 GOTO :34B1
IF ErrorLevel 4 GOTO :33B1
IF ErrorLevel 3 GOTO :32B1
IF ErrorLevel 2 GOTO :31B1
IF ErrorLevel 1 GOTO :30B1
IF ErrorLevel 0 GOTO :num1

:30B1
SET S1=0
GOTO :num1
:31B1
SET S1=1
GOTO :num1
:32B1
SET S1=2
GOTO :num1
:33B1
SET S1=3
GOTO :num1
:34B1
SET S1=4
GOTO :num1
:35B1
SET S1=5
GOTO :num1
:36B1
SET S1=6
GOTO :num1
:37B1
SET S1=7
GOTO :num1
:38B1
SET S1=8
GOTO :num1
:39B1
SET S1=9
GOTO :num1
:num1


REM 0 1 2 3 4 5 6 7 8 9
CHK1BYTE.COM ST2. 00000005 30 31 32 33 34 35 36 37 38 39
IF ErrorLevel 10 GOTO :39B2
IF ErrorLevel 9 GOTO :38B2
IF ErrorLevel 8 GOTO :37B2
IF ErrorLevel 7 GOTO :36B2
IF ErrorLevel 6 GOTO :35B2
Show last 43 lines
IF ErrorLevel 5  GOTO :34B2
IF ErrorLevel 4 GOTO :33B2
IF ErrorLevel 3 GOTO :32B2
IF ErrorLevel 2 GOTO :31B2
IF ErrorLevel 1 GOTO :30B2
IF ErrorLevel 0 GOTO :num2

:30B2
SET S2=0
GOTO :num2
:31B2
SET S2=1
GOTO :num2
:32B2
SET S2=2
GOTO :num2
:33B2
SET S2=3
GOTO :num2
:34B2
SET S2=4
GOTO :num2
:35B2
SET S2=5
GOTO :num2
:36B2
SET S2=6
GOTO :num2
:37B2
SET S2=7
GOTO :num2
:38B2
SET S2=8
GOTO :num2
:39B2
SET S2=9
GOTO :num2
:num2

SET Fname=%S1%%S2%
IF "%Fname%"=="34" ECHO 34
pause
:END

Reply 69 of 75, by curvedline

User metadata
Rank Newbie
Rank
Newbie

i finally decided to finish the alarm clock programs over +30 years after... (only worked if the alarm time was higher than going time previously)
https://mega.nz/file/7QoBiQTJ#v-O4VGQeAGotcWM … RaUJnRhS6XVLmvE

alarm1.exe is a standard text mode 80 version
alarm2.exe is the text mode 80 line input version
alarm3.exe is the graphic menu version

alarm3.exe might be good to investigate, the same style as the last scroll menu interface, but more intuitive, i removed the 2nd popup menu

i was able to extract a 8 byte file name with CHK1BYTE.COM
no w everything is linked, i can automatically send a TB compiled file to where it can be binded to be an EXE file with just one batch click
it took about 2000 batch lines, CHK1BYTE.COM freed me from either repetitive endless xtree scrolling or command line typing

REM                          0  1  2   3  4 5  6  7  8  9  
CHK1BYTE.COM ST2. 00000004 30 31 32 33 34 35 36 37 38 39
REM A B C D E F G H I
CHK1BYTE.COM ST2. -Q 00000004 41 42 43 44 45 46 47 48 49
REM S T U V W X Y Z
CHK1BYTE.COM ST2. -Q 00000004 53 54 55 56 57 58 59 5A
REM - _ ! @ ~ ` ( )
CHK1BYTE.COM ST2. -Q 00000004 2D 5F 21 40 7E 60 28 29

i think i can say DOS True Basic can do what assembler makes it do, if TB does that in that area, it is probably in the same level as assembler
TRC is very small, just about same size as the assembler's exe-make
it doesnt just become a TRC made by TBasic, some file output made by assembler can be simply renamed to be a TRC . if the reverse process was possible, a TRC could turn to an ASM script

Reply 70 of 75, by igully

User metadata
Rank Newbie
Rank
Newbie

I have never heard of DOS True Basic before.

Do you happen to know the resulting DOS .COM or .EXE file size a simple "Hello World!" program would occupy?

As a reference (Warning: my memory may be not that accurate after all these years):
PowerBasic 2.x was about 8KB.
Borland Turbo Pascal 7 was about 3KB.

Thanks in advance

Reply 71 of 75, by DaveDDS

User metadata
Rank Member
Rank
Member
igully wrote on 2025-02-20, 20:06:
...Do you happen to know the resulting DOS .COM or .EXE file size a simple "Hello World!" program would occupy? ... PowerBasic 2 […]
Show full quote

...Do you happen to know the resulting DOS .COM or .EXE file size a simple "Hello World!" program would occupy?
...
PowerBasic 2.x was about 8KB.
Borland Turbo Pascal 7 was about 3KB.
...

Just for fun - taking the "classic" Hello World in C :

#include <stdio.h>
main()
{
printf("Hello World");
}

Compiling with my own Micro-C/PC :

HELLO    COM              1,334 20-02-2025 22:40

And with Micro-C/DVM (Daves Virtual Machine)

HELLO    DVM                 45 20-02-2025 22:41

The difference in size is mainly due to the "printf" function being linked in..
DVM is a virtual machine I invented to allow me to easily run code I'd
previously written with my 16-bit toolset under Win64, Linux and any other
environment I might choose... It has most of the C library built into it, which
means the reference to printf() is literally a single 2-byte instruction.
(and before anyone says ... DVM.EXE is a single 15k file and requires no
dynamic libraries or other supporting files!)

In this case, we can replace printf() with a much simpler/smaller function:

#include <stdio.h>
main()
{
fputs("Hello World", stdout);
}
HELLO COM 550 20-02-2025 22:42
HELLO DVM 48 20-02-2025 22:42

The extra 3-bytes in the .DVM is because it's generating code to pass two
arguments instead of one. The .COM is still bigger due to startup code + fputs() and
the associated buffered IO still requiring some space (and 8086 code generally takes
more space the C-FLEA - than CPU I invented)

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Last edited by DaveDDS on 2025-02-21, 21:29. Edited 1 time in total.

Reply 72 of 75, by curvedline

User metadata
Rank Newbie
Rank
Newbie

>I have never heard of DOS True Basic before.
DOS True Basic is the original BASIC in history, made by the computer language creator like FOR NEXT, DO LOOP, IF then, DIM, END PRINT kind of statement, back in 1930s before fortran and cobol
if you read some of my previous posts in the back , he is mostly known for an Albert Einstein math assistant, and the Manhattan project's compiler guy. you can lean most TB(true basic) syntax in 20 minutes, all are obvious and the middle school math style operators. then you could just start writing your own numerical analysis like solving differential eqs. and integrals and etc.

i uploaded the TB ver 2.1 which i used to build nearly all of my numerical algorithms
https://mega.nz/file/3MhHyBoJ#UYzsWjra8emWtLz … N_6AGkIauNFCIz0

HW.TRU file has
print "hello world"
end
if compiled , it is about 80 bytes in size (HW.TRC)

making it an EXE file 90k (TB calls it binding process), why high?, they said it would load its entire module and entire functions, like tangent ,err ft, arcosine, secant... etc, because TB's binded exe files were never a batch file replacement, an EXE size was too big. but i used it as a replacement , since i didnt know much about batch operators, still struggling very much

if TRC made by the TB is the same as the one that made by assembler
then i THINK one could compile TRC by renaming it to some extension that could work in assembler, but i am no assembler man, hasnt seen one assem compiler even now except 1 or 2 floating around on the internet, then one could turn a TB's TRC to a "prog.COM" style file and the smallest size possible.

PowerBasic 2.x was about 8KB.
Borland Turbo Pascal 7 was about 3KB.
if anything was made by Bill gates, i wouldnt use it, he would just turn it obsolete soon as soon as you were hooked on it

you can test TB, it is probably faster in number crunching like adding numbers from 1 to 10^8, in double precision. i think i know this for sure now, i wasnt quite sure until Mr. daveDDS. TB has the computational speed of assembler that was why it beat all other compilers back in the day.

i want you to know that TB's syntax are the most beautiful things in the world in my eye. it is "SIMPLE" and the most structured lingo and not one of the most structured ones... then again ... mathematically

DOS is dead. TB DOS is dead, but NOT the scripts, i can port them anywhere i want. i can run it in UNIX too, if i have the TB unix version. and algorithms last forever

typing in the TB editor might be overwhelming at 1st. not knowing what to do, basic is
F1=go to editor
F2=go to command line
old hw and enter
bye enter = quit TB
sav enter
press F9 to run the file or type run enter
com enter to make the compile file in the memory then must save the file

auto-aliased
sav = save
uns = unsave
com=compile
spl = split

Reply 73 of 75, by igully

User metadata
Rank Newbie
Rank
Newbie

Thank you curvedline for the detailed information.
It seems True Basic is not what I was looking for despite its features and rich history.

I believe I found a better alternative to an almost assembler-like compiler for BASIC-like syntax:

ASIC 5.0 by 80/20 Software
A "Hello World" compiled, generates a 357 byte .COM file.
The compiler and editor are a little less than 150KB in file size.
It can still be found in almost any DOS shareware repository.

@DaveDDS

It seems your Micro-C/PC and your Micro-C/DVM have much both efficient code generators than Borland's Turbo C.
Turbo C seems to compile an 8KB executable for a simple "Hello World". You have done much better than them in that specific task.

What about your own tiny basic-like implementation (Micro-Basic 2.2)?
The interpreter is just 7KB in size when the executable is compressed, which makes it extremely compact, rivaling in size anything I have seen out there.
Would it be too much to ask to have an option implemented for it to generate a standalone DOS .COM and/or .EXE? Or even a separate program/command that compiles any of these would seem great.

BTW, I have seen an early version of your Micro-Basic used commercially in embedded DOS SBCs from JK microsystems. That is really cool!
http://www.jkmicro.com/Products.html
http://www.jkmicro.com/Downloads-General.html (BAS_ED.ZIP - contains the MicroBASIC interpreter, a simple text editor, and a BASIC blackjack game (BJ.BAS))

Reply 74 of 75, by DaveDDS

User metadata
Rank Member
Rank
Member
igully wrote on Yesterday, 19:44:

It seems your Micro-C/PC and your Micro-C/DVM have much both efficient code generators than Borland's Turbo C.
Turbo C seems to compile an 8KB executable for a simple "Hello World". You have done much better than them in that specific task.

I used Turbo-C for years (in fact the first editions of Micro-C were compiled in Turbo-C). It
doesn't generate bad code - IMHO the main reason it can produce larger executables is the
libraries which get linked in - it seems most developers don't care so much about efficency,
and I find a LOT of commercial tools call their own libraries a lot from within their libraries....
So even the simplest of programs can make for a big .EXE

I "grew up" in computing coding assembly language for little processors like
the 8051, 8080, 1802 ... and when you work in a processor which has only a few K
(or less) of code space, you get very aware of how "what you do" affects
the output size ... I "discovered" C in the 80s, and decided to write
Micro-C shortly thereafter (I wanted a compiler that could be used
for very small systems - and it's amazing how fast and well you can learn a
programming language by writing a compiler for it as you go) - and I carried
that same philosophy into it - most of the low-level (and some higher level)
library functions are written in assembly language ... and the parts that are C
generally don't call "other stuff" unless it really needs it or is very likely to have
both linked in to the same program...

What about your own tiny basic-like implementation (Micro-Basic 2.2)?
The interpreter is just 7KB in size when the executable is compressed, which makes it extremely compact, rivaling in size anything I have seen out there.
Would it be too much to ask to have an option implemented for it to generate a standalone DOS .COM and/or .EXE? Or even a separate program/command that compiles any of these would seem great.

Micro-Basic was pretty much the first programming language I had ever
written - and is an interpreter ... I didn't know/think about a compiler...
(I didn't really learn about compilers till I decided to write Micro-C)
I originally wrote MB in assembly language for what was at the time my main
system - a homebuilt 8080 (prob. late 70s)

Later, I re-coded it in C as an example program in Micro-C... but didn't really
change the structure/design - it would basically be a complete redesign (and a fair
bit of effort) to make a BASIC compiler (and there's so much I've learned since then
that it would be a pretty different version of BASIC)

-- And sorry, I was a teenager/very young adult when I wrote a lot of this stuff...
-- Over 65 now ... and given the effects of a fairly serious injury I received abt 5 years ago..
-- I'm just not as keen anymore... (but I do still like to build/create stuff)

BTW, I have seen an early version of your Micro-Basic used commercially in embedded DOS SBCs from JK microsystems. That is really cool!
http://www.jkmicro.com/Products.html
http://www.jkmicro.com/Downloads-General.html (BAS_ED.ZIP - contains the MicroBASIC interpreter, a simple text editor, and a BASIC blackjack game (BJ.BAS))

I don't recall if I ever arranged for a company of that name to redistribute my
stuff, but I really don't care anymore as most of "the world" considers stuff like
this useless these days - but, yeah It's always kinda cool to see my stuff still being
used.

(and maybe we'll see more of it with my "retirement project" - releasing as much
of my source code as I'm able - which is a lot)

Dave ::: https://dunfield.themindfactory.com ::: "Daves Old Computers"->Personal

Reply 75 of 75, by curvedline

User metadata
Rank Newbie
Rank
Newbie

>It seems True Basic is not what I was looking for despite its features
i want to emphasize about the TB's editor, it is as intelligent as the star trek's computer, it has command lines, all editors in the world must have a high level compiler built into it, or it is a not a real editor in my opinion.
a TB editor can do
*script files - it is a TB version of batch files
*dos("dir") - dos shell (can be also put into a script file)
*and THE intelligence ,the DO "truebasic files"
*macro
it is like this.

do cap.tru - it makes a loaded file all capitalized - destructive and just about all other editors have it
do words.tru - it detects the list of these words DivX GigaBit GigaByte MegaBit MegaByte nGlide OpenGL UFO 0Kg 1Kg 2Kg 3Kg 4Kg 5Kg 6Kg 7Kg 8Kg 9Kg and MASK them with easily recognizable style
do fortran2TB - it converts a fortran program to a TB runnable program
do BAS2TB - it converts a basic program to a TB runnable program
do data 1 ,2, all - re-orientates DATA in the basic editor with the way you want
do ClipperIndentation - sorts all indentations of the Clipper database program which doesnt have indentation built into it
do call_JACK - it detects Jack and 8 number digits in the load file and call him or let you decide what you want do.

what am i saying?

all words loaded in the TB editor are up for grabs and become VARIABLES for TB to do anything with them, besides typing
you program these "DO yourDESIGNEDfiles"

all editors must have compiler built into it, or it is NOT a real editor.
the TB editor is as intelligent as your programming skills to the infinity
you can experience of this with TB at least

TB might be able to control other machines through its interrupt, ...probably can... but i dont know how.