flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > Befunge Interpreter

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_ 11 Sep 2009, 07:25
rugxulo wrote:
e.g. my bro
I'm gonna take a wild guess and say your the younger? Razz It just seems that's how it ALWAYS goes: younger annoys older... myself included (I'm younger)
Post 11 Sep 2009, 07:25
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 11 Sep 2009, 08:19
No, we're twins, and "that's all she wrote". Laughing


Last edited by rugxulo on 20 Oct 2009, 07:14; edited 1 time in total
Post 11 Sep 2009, 08:19
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_ 12 Sep 2009, 15:13
Awesome. But what do you mean "That's all she wrote"?
Post 12 Sep 2009, 15:13
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 12 Sep 2009, 21:30
No more kids, i.e. there's only two of us.


Last edited by rugxulo on 20 Oct 2009, 07:14; edited 1 time in total
Post 12 Sep 2009, 21:30
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_ 09 Oct 2009, 15:47
Major update: Complete rewrite, is now 100% bug free as far as I know.

The core is separated from OS-specific stuff, so sometime I'll give a go at porting it to linux.
Post 09 Oct 2009, 15:47
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 09 Oct 2009, 23:14
Cool beans! I was worried you either got swamped at school, lost interest, or were rewriting. Good job! Very Happy

P.S. Still doesn't work with chess apparently, but seems okay otherwise. (Even works under HX in DOSBox now, which is the main reason I complained about MSVCRT.DLL before. Well, actually, HX might have a bug or two as saluton.bef [never "Hello", only "Saluton"] and serpinsky.bef [hang?] don't work, but other stuff is fine. Those work fine on Vista, though.)


Last edited by rugxulo on 20 Oct 2009, 07:14; edited 1 time in total
Post 09 Oct 2009, 23:14
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_ 10 Oct 2009, 09:36
rugxulo wrote:
Cool beans! I was worried you either got swamped at school, lost interest, or were rewriting. Good job! Very Happy
Thanks Smile To be honest I had lost a little interest in befunge (shameful, I know), so I focused on improving my interpreter, which got me interested again Smile


rugxulo wrote:
P.S. Still doesn't work with chess apparently, but seems okay otherwise. (Even works under HX in DOSBox now, which is the main reason I complained about MSVCRT.DLL before. Well, actually, HX might have a bug or two as saluton.bef [never "Hello", only "Saluton"] and serpinsky.bef [hang?] don't work, but other stuff is fine. Those work fine on Vista, though.)
I'm still trying to figure out why chess doesn't work, but am out of ideas at the moment. Good to know it works (partially?) under HX now Smile Thanks.

If anyone looks at the source, any suggestions on how I could more easily make it portable are welcome (this is my first attempt at writing something with the intention of running it on more than windows and I haven't done much/any programming in assembly on other operating systems either, so don't have much of an idea what might've needed to be different)
Post 10 Oct 2009, 09:36
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 20 Oct 2009, 07:13
Pinecone_ wrote:
If anyone looks at the source, any suggestions on how I could more easily make it portable are welcome (this is my first attempt at writing something with the intention of running it on more than windows and I haven't done much/any programming in assembly on other operating systems either, so don't have much of an idea what might've needed to be different)


My only suggestion is to check out the Linux IsForth which uses syscalls (I think). Written in NASM, though but might help. Cool
Post 20 Oct 2009, 07:13
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 25 Oct 2009, 14:33
Code:
--- windows.as~      2009-10-10 00:51:08 +0000
+++ windows.asm    2009-10-25 09:30:06 +0000
@@ -1,4 +1,4 @@
-FORMAT PE CONSOLE
+FORMAT PE CONSOLE on 'befi-lfn.com'
 Entry _Main
 
 STD_OUTPUT_HANDLE         =       -11
    


Quote:

10/25/2009 09:17 AM 1,046 befi-lfn.com
10/10/2009 01:44 AM 3,584 old-Befunge93-win.exe
10/25/2009 09:30 AM 4,608 new-Befunge93-win.exe
Post 25 Oct 2009, 14:33
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
Pinecone_ 28 Oct 2009, 22:36
What is that code for? I never seen any fasm code like that.
Post 28 Oct 2009, 22:36
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 29 Oct 2009, 15:30
What, you mean the use of "on"? It just embeds a DOS program into the MZ stub of the PE executable. Even (usually OS/2) LE and LX have a DOS stub. Actually, to be honest, I think you can technically have no MZ DOS stub, but 99% of all people and compilers don't do that (not sure if that's due to OS or compiler bugs and limitations or what).

Quote:

To select the Portable Executable output format, use "format PE" directive ... and then optionally "on" operator followed by the quoted string containing file name selects custom MZ stub for PE program (when specified file is not a MZ executable, it is treated as a flat binary executable file and converted into MZ format).


Otherwise it just includes by default the useless default message:

Quote:

This program cannot be run in DOS mode.


Might as well use that space for something useful, no? Laughing
Post 29 Oct 2009, 15:30
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 29 Oct 2009, 15:33
rugxulo wrote:
Actually, to be honest, I think you can technically have no MZ DOS stub
With fasm you can achieve this by creating an empty file and telling fasm to use it as stub.
Post 29 Oct 2009, 15:33
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 29 Oct 2009, 15:38
So here's what I should do to get back at all those anti-DOS programmers. Twisted Evil Laughing

Code:
--- pedemo.asm        2009-02-28 16:33:26 +0000
+++ tony.asm       2009-10-29 10:36:06 +0000
@@ -1,7 +1,7 @@
 
 ; Example of making 32-bit PE program as raw code and data
 
-format PE GUI
+format PE GUI on 'befi.com'
 entry start
 
 section '.text' code readable executable
@@ -19,8 +19,8 @@
 
 section '.data' data readable writeable
 
-  _caption db 'Win32 assembly program',0
-  _message db 'Hello World!',0
+  _caption db 'http://www.freedos.org',0
+  _message db 'This program cannot be run in Win32 mode (try FreeDOS).',0
 
 section '.idata' import data readable writeable
    


Oh well, I thought it was funny. Laughing
Post 29 Oct 2009, 15:38
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 29 Oct 2009, 15:43
Tomasz Grysztar wrote:
rugxulo wrote:
Actually, to be honest, I think you can technically have no MZ DOS stub
With fasm you can achieve this by creating an empty file and telling fasm to use it as stub.


Good to know although I don't think it would save much space. Then again, it's no less useless than telling you "sorry, we suck, can't run". Razz

Dual .EXEs were never heavily utilized, AFAIR, I only remember seeing a few examples (old old FASM versions [e.g. 1.40 seems to be, also UPX'd, heh], GNUish dual DOS + OS/2 1.x GNU textutils or fileutils, and some old old app that actually ran WIN.COM if started in DOS [ugh, now that was annoying, it didn't even ask!]).

EDIT: I guess EMX and RSX/NT apps also utilize it, but they do a lot of other trickery too, so it's not really a self-contained all-in-one app or anything.
Post 29 Oct 2009, 15:43
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 29 Oct 2009, 18:17
rugxulo: "This program cannot be run in Win32 mode (try FreeDOS)."

Laughing

But ... I can run DOS in my win32 OS. Can you run win32 in your DOS OS? Razz
Post 29 Oct 2009, 18:17
View user's profile Send private message Visit poster's website Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 29 Oct 2009, 18:42
You can't run DOS in your Win32 unless you're still running Win9x. Everything else is partially emulated (NTVDM -> V86 mode plus heavily modified MS-DOS 5 and BIOS emulation).

As mentioned, the only decent partial Win32 emulation in DOS is HX. (WDOSX works with almost nothing, and DOSWin32 needs "MS-DOS 5" [DR-DOS didn't support it]). Too bad Japheth still never responded to why HX partially doesn't work with Pinecone_'s "new" interpreter.

EDIT: Even QEMU or BOCHS or DOSBox under HX or something like GRUB4DOS booting a hard drive image file probably is mostly emulation, but if the host is DOS, I guess you're still technically running Win32 on DOS.
Post 29 Oct 2009, 18:42
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.