The decb executable,
before use, must be compiled and installed. I suggest the following
very easy procedure in 4 steps (use the terminal):
1) Copy the package somewhere, and unpack it; it will unpack into a directory named decb.1.0.XXX.src;
2) Now, choose a directory in your path, where executables will be saved; let's assume it's ~/bin (that is the subdirectory /bin in your Home directory, but you can choose any). Edit the
Makefile to customize addresses for decb (e.g., among the rest, change the install directory to ~/bin, commenting
the undesired destinations and leaving uncommented ONE ONLY valid
destination) using the destination directory you chose.
3) get into decb source directory and type the following (be sure to have gcc
installed - Note:
I compiled dib under gcc 4.X, I believe all 3.X versions will work, but I don't guarantee it):
$ make $ make
(the latter may require root privileges
if you try to install decb into system directories, as suggested by default in the Makefile).
For Mac Users:
in case you want to install dib into some system directory (e.g. /user/local/bin), remember that
privileges are not required, as long as you can access an
administrative login: in this case, after make, login as an administrator with
(being <name> the username
of the administrator) - you will be requested of a password - and then
install the software with
$ sudo make install $ exit
4) now type the following to test the correct installation:
$ decb --help
This shows the basic features of decb, and you're done! The USER/
directory is full of ready-to-run examples; read the readme files, before.
Version 1.0.beta History 5 (November 30, 2019)
Continued thanks to Ian Jones
(I can reveal his full name, after the incredible success of tbas, my console BASIC interpreter); I confirm here the fact that he's a great great friend. Ian and I are the decb team!
Generalities: This version underwent minor changes throughout these last five years, mainly to solve small nuisances and make it compilable on more modern systems. The more evident change is the removal of the O2 optimization level, which caused crashes in some situations.
The most important fact is anyway that decb is still alive!
Read the documentation to know the technical data.
Version 1.0.beta (December 15, 2014)
Infinite thanks to I.J.
(he wants to remain unknown), a friend and a great tester, who compiled
and ran decb finding an incredible number of inconsistencies in the
listings. He helped me to understand where decb didn't behave as
expected; he also realized that the source was not correctly executed
on 64-bits machines, so I checked carefully all the malloc/free
references, in order to fix this bad behavior and preserve paging both
for 32 and 64 bits machines. He patiently attended all the many
program revisions, each hopefully the last and each invariably
still full of mistakes. I. J. and I are the decb team!
Thanks to Paul Ohnemus,
who revealed to me the fact (then unknown to me) that strncpy() is not safe in
most systems (not mine) and helped me to fix all the wrong (excessive) sizes in
its third argument, a fact that mostly prevented correct compilation
and execution on some Linux versions; for these reasons I created my
own portable strncpy_() and strncat_() functions, along with a wrapper
Thanks also to Arnaud Delfosse, who first signaled the abnormal behaviour of strncpy() in his Linux machine.
What changed? A lot! Read on.
checked the malloc/free references one by one to set up a correct behaviour on all systems. This was a very important step.
inserted my own string manipulation function in order to have the program portable (I
discovered with some disappointment that string functions behave
differently on different machines, and this guarantees that the code is
NOT portable if used thoughtlessly). This was a very important step.
inserted a trap structure for memory leaks signals (SIGSEGV, SIGBUS, SIGABRT) in case of general malfunctioning; now, the "? MEMORY ERROR" message means some peculiar memory leak... Write to me if you find this message!
a trap structure for interrupts (SIGHUP, SIGINT) to perform the closing
operations (files closing, memory freeing, footer printing and so
forth), after a user CTRL-C, depicting output in the DEC-BASIC style
added option -P to set the user-defined page length
integrated options -L and -R to accept dash or comma as number separator
corrected the --length option execution
integrated the -R/--resequence option for the ON..THEN/GOTO statement, which didn't work as expected for its multiple inline addresses by renumbering only the first number in the list
modified the error code routine to print usage only for errors in options arguments, not for errors due to BASIC features
the run-through process with program lines, from an infinite cycle
waiting for END() to a simple and finite process from first to last
effective line; this should override memory errors in all systems
updated and corrected some constants in decb.h (in particular, I modified the value of HALFPI to a more precise value)
changed comments here and there and integrated all LBMAA-A-D references in the listing
corrected a bug in the LET() statement, which didn't skip equal signs in strings, so that an assignment like C$="NUM=" was problematic. This problem didn't affect numeric assignments, but only string assignments.
corrected a bug in the PRINT routines that didn't correctly treat the multiple comma spacing
corrected a couple of bugs in the FOR/NEXT routines, the first that returned a bad address in case of impossible FOR
cycles, a fact that caused the printing of the fatal decb "? SYSTEM
ERROR" message, the second for a fine tuning in detecting inner cycles;
also I fixed the recognizing of the end of cycle in case of
decimal numbers, to avoid most of the errors due to inner number
corrected the part of DIM() dealing with string arrays, which didn't behave as expected for all the cases
a bug in MATINPUT(), which started column count from 0 and not from 1
(as standard for matrix indexes) for 2-dimensional numerical matrices,
and which didn't behave well with the & (ampersand technique)
the MATPRINT() function, which didn't complete correctly the parsing of
matrices for all sequences of matrices in the queue
corrected a bug in the READ statement for string variables identified by a letter and a number, which didn't work correctly.
fine-tuned the GOTO jumps while in a DEF FN multiline structure
added the exporting of variables changed into a DEF FN structure (as specified on the DEC BASIC references, only variables in the argument queue are restored to their original value)
fine-tuned the CHAIN statement, adding the flushing of all opened files in the calling program, to make them available to the called CHAINed file, and fixed the line number argument controls
corrected a bug in the WRITE#/PRINT# statements that didn't correctly detect the "? MIXED WRITE#/PRINT#" error and performed (wrongly) both; the same for the PRINT USING routines
fixed a bug in the READ#/INPUT# statements that couldn't load correctly numerical arrays because of a wrong assignment in the inner function
fine-tuned the PAGE statement, which is now identical to the DEC-BASIC even for console addressing
fixed a bug in SET which didn't correctly fix the position if past EOF
fixed the INPUT and MAT INPUT to behave correctly when a number beyond calculation limits was input by keyboard or in a DATA statement
refined the RND function (the pseudo-random numbers generator) to obtain pattern-free values
corrected a bug in the ASC function, which didn't interpret correctly the double and the single quotes as arguments.
fine-tuned the LEFT$, RIGHT$ and MID$ string function for values at the limit of computation
corrected a bug involved with the TIM function, because there were two places in the code where it was executed
fixed a bug in VAL that didn't make a perfect string interpretation
fixed the DEF FN recursion to a fixed number of steps and corrected a nuisance in the multiline DEF FN definition, which didn't work in case of a tick comment after it
Read the documentation to know the technical data.
Version 1.0.gamma (June 7, 2014)
This is the first uploaded version. - RETIRED -
Download it here.
version "gamma" was a very primitive attempt to put decb
under public view. I know that the correct name could have been
but since I wasn't sure it could run on any machine, "alpha"
seemed like a very advanced step for my program. Thus, I
called it "gamma", to mean a very early and experimental version of the
program, a sort
of pre-alpha. I know this caused some misunderstanding. This is due to my scarce fantasy only. In any case,
after the first messages from the BASIC community, I retired the
program because it
had even more bugs than I expected. So version gamma is not available
any more, because I have a dignity to defend ;-)
I wait for your impressions and bugs. Send me your suggestions, your considerations, your
corrections; even send me your working BASIC programs for decb,
all commented and completed with your own name and data (and six
characters at most per name): they will be part of the next package, of course.