Rugxulo

Usono, 13.10.2009, 02:52 |
Win32 Befunge93 interpreter -- partial fail in HX (Announce) |
Hi!
Pinecone_ from FASM's forum has (re)written a Befunge93 interpreter for Win32. (Also see some examples.)
Anyways, some of the examples work fine in Win32 (e.g. Vista for me) but not in HX. Mostly everything works, but serpinsky.bef stalls, and a few others don't work either (e.g. my saluton.bef never prints the English hello, only the E-o one, oddly enough). I blindly assume it has to do with the "?" (random direction) operator, but I don't really know. Just mentioning it here in case Japheth finds it worth investigating further.
(P.S. My internet modem/router at home is on the fritz, so I may not post much here for a few weeks until I can get it fixed.) |
Rugxulo

Usono, 24.10.2009, 23:47
@ Rugxulo
|
Win32 Befunge93 interpreter -- partial fail in HX |
> Hi!
>
> Pinecone_ from FASM's forum has (re)written a
> Befunge93
> interpreter for Win32. (Also see some
> examples.)
>
> Anyways, some of the examples work fine in Win32 (e.g. Vista for me) but
> not in HX.
Well, it's not like there aren't other interpreters out there. I've even hacked up / improved a pre-existing one myself (converted from TASM, fixed a few bugs, shrank size a lot). See this thread on FASM's forum. |
Rugxulo

Usono, 07.11.2009, 17:36
@ Rugxulo
|
BEFI.COM -- 1024 bytes |
> Well, it's not like there aren't other interpreters out there. I've even
> hacked up / improved a pre-existing one myself (converted from TASM, fixed
> a few bugs, shrank size a lot). See
> this
> thread on FASM's forum.
I tweaked this some more. So now it's only 1024 bytes with simple LFN support (int 21h, 7160h) and a 386 check (since it's 386+ only). Assembles with FASM (or via MAKE.BAT) NASM, YASM, or Octasm. |
Rugxulo

Usono, 10.11.2009, 05:36
@ Rugxulo
|
BEFI.COM -- 1024 bytes |
> I tweaked this some more. So now it's only 1024 bytes with simple LFN
> support (int 21h, 7160h) and a 386 check (since it's 386+ only). Assembles
> with FASM (or via MAKE.BAT) NASM, YASM, or Octasm. (NEW: DJASM, heh)
The original TASM version seems to assemble fine with "jwasm -bin -Fo=befi.com befi_tas.old", but it only works if you delete "befungecode:" and add "befungecode=600h" at the top somewhere. (Of course, DUAL2.BEF still has issues, but there's something about that file that is VERY sensitive, I don't know what's up.) |
Rugxulo

Usono, 14.04.2010, 23:13
@ Rugxulo
|
BEFI.COM (version 2k) bugfix -- still 1024 bytes |
> The original TASM version seems to assemble fine with "jwasm -bin
> -Fo=befi.com befi_tas.old", but it only works if you delete "befungecode:"
> and add "befungecode=600h" at the top somewhere.
JWasm 2.x changed the opcode for "cmp sp" to the shorter one, and that broke it. So I had to barely modify the makefile. I did that in December, but it wasn't important enough to release a new version. (I doubt Japheth cares, and he's the only reason I tested JWasm on the "old" source anyways.)
Anyways, I fixed a bug (wouldn't ignore uppercase chars, which now apparently makes befunge[3x].bf work correctly) while still keeping it 1024 bytes. I also improved the examples a bit, reran the benchmark on a few machines (BEFI vs. original C-based BEF), so now I've uploaded a new version.
No huge plans for the future, but I will make some more minor tweaks. (I admit my version number scheme sucks, but whatever.)
EDIT: Proper FASM thread for this project is here. --- Know your limits.h |
Rugxulo

Usono, 15.04.2010, 22:37
@ Rugxulo
|
BEFI.COM (version 2k) bugfix -- still 1024 bytes |
> No huge plans for the future, but I will make some more minor tweaks. (I
> admit my version number scheme sucks, but whatever.)
Here's my problem: I think I found and fixed a long-standing signed number bug (even in original TASM version), even fixed NEGMOD.BEF, but what's annoying is that I'm unsure it's truly fixed (stupid div/idiv confusion). Sure, my simple examples work, and the B93 part of Mycology passes, but it seems I'll need to do more exhaustive testing. Gah, I need a better testsuite. (Also size jumped to 1040. Yeah, I know who cares, but still ....)
06-:. 3/. 06-:. 3. @
(NEWBEFI)
-6 -2 -6 0
(BEFI1213)
-6 1431655763 -6 1
(PCONEB93)
-6 -2 -6 0
(BEF)
-6 -2 -6 0
--- Know your limits.h |
Rugxulo

Usono, 17.04.2010, 03:01
@ Rugxulo
|
BEFI.COM (version 2l) bugfix -- 1014 bytes |
> Here's my problem: I think I found and fixed a long-standing signed
> number bug (even in original TASM version), even fixed NEGMOD.BEF, but
> what's annoying is that I'm unsure it's truly fixed (stupid div/idiv
> confusion).
Well, I'm not too worried, esp. since the original BEFI (1280 bytes) also had the bug. But I do think I've fixed it (see IDIV.BEF, NEGMOD.BEF). But whatever, there's always hidden bugs, can't worry until you find 'em. I tried a few times to use weirdly huge negative numbers to mess up either MUL or IDIV, but nothing showed up (vs. various other B93 or B98 interpreters). --- Know your limits.h |
Rugxulo

Usono, 15.05.2010, 16:23
@ Rugxulo
|
BEFI.COM (2n, 982 bytes) and FPC esolang implementations |
So BEFI.COM is now only 982 bytes. However, I've also been on the lookout for other host language esoteric implementations (admittedly, mostly Befunge).
ISLIP (IneQuation's Simple LOLCODE Interpreter in Pascal) is a LOLCODE 1.2 interpreter written in FPC. It works, even with FPC/DOS, but it only has two examples (hello, quad), and I don't grok it, and most of the other examples I tried didn't work, so I didn't play with it too much. Still interesting (and WTFPL license, heh).
And I finally found a (well, two) Pascal Befunge-93 interpreter. The first (Befunge-93 Builder 1.0) is one written using Delphi 1 (!) for Win3x. It has some incompatibilities with newer Windows (toolbar doesn't show right) but works other than that for most examples. The second is a DOS TP7 version. However, unless you want to run under DOSBox (0.74 just released, BTW), it has several problems: runtime 200 error, no LFN support, no *nix LF support. Of course, it compiles and works fine with latest FPC/DOS, so that's good. 
EDIT: Oops, forgot links. |