Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 2.24. #12

merged 41 commits into from Sep 13, 2018
Changes from all commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
serprex Feb 12, 2016
Add build.seq for building under AmigaDOS 1.3; ignore UAE files.
cpressey Jun 16, 2016
Merge pull request #3 from serprex/master
cpressey May 23, 2018
Add some better notes/documentation to build.seq.
cpressey May 24, 2018
Bump version numbers of these programs, add history and credits.
cpressey May 29, 2018
When an error occurs, exit program with non-zero exit code.
cpressey May 29, 2018
Remove unimplemented -q option from usage help text.
cpressey May 29, 2018
Output "\n", because a newline makes post-optimization phase break.
cpressey May 29, 2018
Remove the -p flag as it is simply the equivalent of -w 80 -h 25.
cpressey May 29, 2018
Report usage and exit if unrecognized command-line options given.
cpressey May 29, 2018
Exit with non-zero exit code when error occurs.
cpressey May 29, 2018
Post-optimization is buggy, so do not have it be the default. -O.
cpressey May 29, 2018
We really do want to write out characters, not ASCII values, here.
cpressey May 29, 2018
Add version of `` that avoids stringmode, thus can compile.
cpressey May 29, 2018
Adjust detected pageheight, allowing eg/ to compile OK.
cpressey May 29, 2018
Merge pull request #4 from catseye/build-on-amigados-1.3
cpressey May 30, 2018
Merge branch 'develop-2018-1' of…
cpressey May 30, 2018
Don't load invalid (past-EOF) bytes into playfield.
cpressey May 30, 2018
Make & push -1 on error or EOF unless back-compat -u flag is given.
cpressey Jun 5, 2018
Example program will be added in a different branch.
cpressey Jun 7, 2018
Merge pull request #7 from catseye/bef2c-befprof-fixes
cpressey Jun 7, 2018
Merge branch 'develop-2018-1' of…
cpressey Jun 8, 2018
Merge pull request #9 from catseye/defined-input-integer-error-mode
cpressey Jun 11, 2018
Start by being conservative about what we think we know.
cpressey Jun 11, 2018
Two are known to compile under DICE C.
cpressey Jun 11, 2018
These compile under this.
cpressey Jun 13, 2018
FreeDOS, not MS-DOS. Also, previous versions have build on NetBSD.
cpressey Jun 13, 2018
Correct typo, or perhaps change typo to match.
cpressey Jun 18, 2018
Confirm compilability under NetBSD 6.1.5.
cpressey Jun 18, 2018
Partial success with Borland C++ 3.1.
cpressey Jun 18, 2018
Switch from "compact" to "large" memory model, see how it goes.
cpressey Jun 18, 2018
Untested, but solution will likely be something like this.
cpressey Jun 22, 2018
Fix up batchfile.
cpressey Jun 22, 2018
Known to compile, now.
cpressey Jun 22, 2018
Merge pull request #11 from catseye/audit-compilability
cpressey Jun 25, 2018
Apply patch from for building on MSVC.
cpressey Aug 20, 2018
Add MSVC to "known-to-compie-on" notes, and add credit.
cpressey Aug 29, 2018
Disable warning 5045 and say that it compiles under MSVC++ 14.15.
cpressey Aug 30, 2018
Merge pull request #15 from catseye/build-on-msvc
cpressey Sep 3, 2018
Why did summer go so quickly? Was it something that you said?
cpressey Sep 3, 2018
Update README for release of version 2.24.
cpressey Sep 13, 2018
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.


Just for now

@@ -1,3 +1,4 @@
@@ -1,5 +1,6 @@
syntax: glob

@@ -0,0 +1,33 @@
# NMAKE Makefile for bef.

PROGS=bin\bef.exe bin\befprof.exe bin\bef2c.exe

WARNS= -Wall -wd4820 -wd4131 -wd4459 -wd4242 -wd4244 -wd4996 \
-wd4668 -wd4255 -wd4710 -wd4706 -wd4702 -wd4711 -wd4456 -wd5045

CFLAGS=$(CFLAGS) -Ox -nologo

!ifdef DEBUG

all: $(PROGS)

bin\bef.exe: src\bef.c
$(CC) $(CFLAGS) src\bef.c -Fe:bin\bef

bin\befprof.exe: src\befprof.c
$(CC) $(CFLAGS) src\befprof.c -Fe:bin\befprof

bin\bef2c.exe: src\bef2c.c
$(CC) $(CFLAGS) src\bef2c.c -Fe:bin\bef2c

$(RM_F) *$(O) src\*$(O)

$(RM_F) $(PROGS)
@@ -1,9 +1,10 @@
Welcome to the NEW Befunge-93 Reference Distribution
Welcome to the Befunge-93 Reference Distribution

Since `bef` is a reference implementation (so far as it goes) of Befunge-93,
we saw fit to once again combine the specification and implementation into a
single distribution.
This is the reference distribution for the Befunge-93 programming language.
It contains the specification and reference implementation (`bef`), which
are direct descendants of the originals, along with a few related tools and
many example programs.

About Befunge-93
@@ -21,19 +22,20 @@ Contents
* `README.markdown`: these post-modernist existential rants
* `LICENSE`: a bedtime story written to give your lawyer sweet dreams
* `doc/Befunge-93.markdown`: the specification for Befunge-93, such as it is
* `src/bef.c`: Befunge-93 reference interpreter/debugger v2.23 source code
* `src/bef2c.c`: Befunge-93 to ANSI C compiler v0.94 source code
* `src/befprof.c`: Befunge-93 profiler v0.94 source code
* `src/bef.c`: Befunge-93 reference interpreter/debugger v2.24 source code
* `src/bef2c.c`: Befunge-93 to ANSI C compiler v1.0 source code
* `src/befprof.c`: Befunge-93 profiler v1.0 source code
* `eg/*`: Various and sundry contributed Befunge-93 programs

For More Information

See Cat's Eye Technologies' official [Befunge-93 Project Page][].
See the official entry for [Befunge-93][] at [Cat's Eye Technologies][].

This comment has been minimized.


j4james Sep 14, 2018

I'm not sure if this is too late to fix, but this link text change to Befunge-93 has caused the link to break.

This comment has been minimized.


cpressey Sep 17, 2018
Author Member

Thanks. Too late to make it into the official release I guess, but I've fixed it on master which is where most people are going to see it anyway (and anyone reading the README locally as a text file is surely smart enough to figure out what URL to paste into their browser.)

[Befunge-93 Project Page]:
[Befunge-93 Project Page]:
[Cat's Eye Technologies]:

Happy Befunging!
Chris Pressey
Winnipeg, Manitoba
August 25, 2012
London, England
September 13, 2018
@@ -0,0 +1,10 @@
@echo off
rem --------------------------------------------------------------
rem Batchfile that compiles the bef sources under Borland C++ 3.1.
rem Uses "large" memory model for befprof b/c it uses >64K data.
rem --------------------------------------------------------------

@echo on
bcc -ebin\bef.exe src\bef.c
bcc -ml -ebin\befprof.exe src\befprof.c
bcc -ebin\bef2c.exe src\bef2c.c
@@ -0,0 +1,12 @@
; To build the Befunge-93 reference executables using DICE C
; under AmigaDOS 1.3, you can either run
; protect build.seq srwd
; build.seq
; or you can simply type the following commands into the shell:
dcc src/bef.c -o bin/bef
dcc src/befprof.c -o bin/befprof
;dcc src/bef2c.c -o bin/bef2c ; DICE C can't handle this one.
@@ -1,9 +1,9 @@
/* ******************************************************************
bef.c - The Original Befunge-93 Interpreter/Debugger in ANSI C
Copyright (c)1993-2015, Chris Pressey, Cat's Eye Technologies.
Copyright (c)1993-2018, Chris Pressey, Cat's Eye Technologies.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -39,12 +39,13 @@
Usage :
bef [-d] [-o] [-q] [-i] [-=] [-l] [-t]
bef [-d] [-o] [-u] [-q] [-i] [-=] [-l] [-t]
[-r input-file] [-w output-file]
[-s stack-file] [-y delay] <befunge-source>
-d: visual ANSI debugging display
-o: do not fix off-by-one error (for old sources)
-u: & on error or EOF is undefined, not -1 (backwards compat)
-q: produce no output except Befunge program output ('quiet')
-i: ignore unsupported instructions
-=: use b97-ish = directives
@@ -55,13 +56,30 @@
-s: write contents of stack to log file
-y: specify debugging delay in milliseconds
Compiles Under:
Known to Compile Under :
Borland C++ v3.1 (16-bit MS-DOS)
DJGPP v2.952 (32-bit Protected-Mode MS-DOS)
gcc 5.4.0 (Ubuntu 16.04)
gcc 4.5.3 (NetBSD 6.1.5)
DICE C 3.15 (AmigaDOS 1.3)
DJGPP 2.05 gcc 8.1.0 (32-bit Protected-Mode, FreeDOS 1.1)
Borland C++ v3.1 (16-bit, FreeDOS 1.1)
Microsoft Visual C++ 14.15 (see NMakefile)
Has, in the Past, been Known to Compile Under:
Metrowerks CodeWarrior (MacOS)
v2.24: Sep 2018, Chris Pressey
when & encounters an error or EOF condition it pushes
-1 onto the stack instead of an undefined value;
added -u option to retain old behaviour in this case
(thanks to James Holderness for noticing and suggesting)
support for compiling with MSVC (also by James Holderness)
v2.23: Aug 2012, Chris Pressey
delay given with -y now actually happens when compiled
with compilers other than Borland C++; it's implemented
@@ -86,7 +104,7 @@
v2.20, Jul 2000, Chris Pressey
prettied up preprocessor directives a bit
added defines for Metroworks CodeWarrior
added defines for Metrowerks CodeWarrior
so that bef will build on MacOS
relicensed under BSD
@@ -123,6 +141,7 @@
v2.00: Jun 1997, Chris Pressey
combines interpreter and debugger.
fixes ANSI error in debugger.
v1.02: Feb 1996, Chris Pressey
@ now pushes '@' onto the stack in stringmode instead of quitting.
@@ -160,6 +179,9 @@
# include <console.h>
# define CONSOLE 1
#endif /* __MWERKS__ */
#ifdef _MSC_VER
# define sleep(s) _sleep(1000 * s)
#endif /* _MSC_VER */

/********************************************************** #DEFINE'S */

@@ -192,6 +214,7 @@ int stackfile = 0, sa; /* flag : use stack log file, & assoc arg? */
int stringmode = 0; /* flag : are we in string mode? */
int quiet = 0; /* flag : are we quiet? */
int v10err_compat = 0; /* flag : emulate v1.0 off-by-one err? */
int undef_input_int = 0; /* flag : undefined value on "&" err/EOF? */
int deldur = 25; /* debugging delay in milliseconds */
int ignore_unsupported = 0; /* flag : ignore unsupported instructions? */
int use_b97directives = 0; /* flag : use b97-esque directives? */
@@ -233,6 +256,7 @@ int main (argc, argv)
if (argv[i][0] == '-') {
if (!strcmp(argv[i], "-o")) { v10err_compat = 1; }
else if (!strcmp(argv[i], "-u")) { undef_input_int = 1; }
else if (!strcmp(argv[i], "-d")) { debug = 1; }
else if (!strcmp(argv[i], "-r")) { infile = 1; ia = i + 1; }
else if (!strcmp(argv[i], "-w")) { outfile = 1; oa = i + 1; }
@@ -252,7 +276,7 @@ int main (argc, argv)
if (!quiet)
printf ("Befunge-93 Interpreter/Debugger v2.23\n");
printf ("Befunge-93 Interpreter/Debugger v2.24\n");

memset(pg, ' ', LINEWIDTH * PAGEHEIGHT);
@@ -661,6 +685,9 @@ int main (argc, argv)
case '&': /* Input Integer */
signed long b;
if (!undef_input_int) {
b = -1;
if (infile)
fscanf (fi, "%ld", &b);
@@ -677,6 +704,9 @@ int main (argc, argv)
int x, y;
long int p;
char t[172];
if (!undef_input_int) {
p = -1;
x = wherex();
y = wherey();
gettext(10, DEBUGROW, 80, DEBUGROW, t);
@@ -905,7 +935,7 @@ signed long pop ()

void usage ()
printf ("USAGE: bef [-d] [-o] [-q] [-i] [-=] [-l] [-t]\n");
printf ("USAGE: bef [-d] [-o] [-u] [-q] [-i] [-=] [-l] [-t]\n");
printf (" [-r input] [-w output] [-s stack] [-y delay]\n");
exit (1);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.