flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3 ... 10, 11, 12 |
Author |
|
rugxulo
rugxulo wrote:
EDIT: Very minor new release (befi_2g.zip), adds sed scripts (inside MAKE.BAT) for auto-conversion to NASM/YASM or Octasm. I'm also going to stop spamming this thread and just put it in its own project thread. Last edited by rugxulo on 30 Oct 2009, 17:57; edited 2 times in total |
|||
![]() |
|
rugxulo
Some more random / interesting? findings:
Code: 09-2%.@ Quote:
Guess that's a bug (but who needs that?). ![]() Also, check out the speed difference for this useless snippet (MTFI 8086 version runs it incorrectly so not listed): Code: 91+:*-:0`#@ #._ Quote:
That's on this P4 2.52 Ghz here running XP SP3. I ran the same on my old old P166 (heh), and BEFI was comparatively much much faster (approx. 4 mins. for BEFI vs. 23 mins. for DJGPP-compiled BEF or I think 12 mins. for Pinecone_'s). EDIT: Using BEF2C -p -o (else itself crashes), the resulting time is 6 mins. on my P166 (GCC 3.4.4, DJGPP 2.04). Lame examples, but still interesting I thought. |
|||
![]() |
|
rugxulo
BASE7.BEF: Not optimized, could be written better (e.g. as chars or only one decimal number instead of having dumb spaces between digits), but hey, it works.
![]() Code: v actually works now! |
|||
![]() |
|
windwakr
rugxulo wrote: BASE7.BEF: Not optimized, could be written better (e.g. as chars or only one decimal number instead of having dumb spaces between digits), but hey, it works. All you gotta do is change the ending to: Code: >:91+`#@_86*+, And now for some reason I feel the urge to do some Befunge coding.... |
|||
![]() |
|
rugxulo
windwakr wrote:
Yeah, I also thought of that this morning. Anyways, here's a slightly smaller version: Code: v# ,+"0"_@#!`-17:< >7&v ^_$#:< >:#/ 7 # %# :#\_\:!#^_7/ change all sevens to eights for Octal Now if only eta_hello.bef worked in more interpreters (ahem, befi). ![]() |
|||
![]() |
|
Pinecone_
I've been fairly inactive lately, mostly due to school work. However I have found a practical use for these esoteric languages
![]() Look at the following peice of code I wrote for one: Code: ~:!#v_l\7+89***l{>" a retne tsum uoY" v >v >$:v>0".eman"^}<{"Wrong Serial."0<># ,: v0 _^ >! #v_^ <>"oY"v ^ < ^_@ >&::'0`#^_'8#$`#v_^ { ^ +*8\-\*8:#6< ^"u must enter"< ^"Yay"0_}# =_0".rebmun laires a "^^ It's pretty similar to befunge, but with a few extra instructions... ' enters stringmode for the next character only, then returns to normal mode { moves the IP to 0,y (y being the current y position) and resumes executing with the same delta as before. } same as { but to the right side. = compare the equality of the top two values on the stack. push 0 if equal, 1 if not equal. l roll bits of value on the top of the stack left by one bit. ~ acts like input in regular befunge, but reads from the name the user entered into the name/serial form. & is like ~ but reads from the serial entered instead. , is the output of the script, either "You must enter a serial.", "You must enter a name.", "Wrong Serial." or "Yay" (meaning success, but I didn't have enough space for that) These got me thinking.. what other strange instructions could we come up with, that could be useful in terms of flow control that don't take away from the befunge feel, and could potentially help size optimizations? |
|||
![]() |
|
rugxulo
Pinecone_ wrote: I've been fairly inactive lately, mostly due to school work. Yes, I figured as much. Sad that they overwork kids so much these days. Quote:
You mean piracy (boo hiss) or just general password-ish related stuff? (Your code doesn't really tell me anything. I'm not sure what it's supposed to do.) Quote:
Looks vaguely more like Befunge98 than 93. I still don't really get 98, parts of it are a bit weird and confusing. I think Befunge98 can be extended to do whatever you need (fingerprints -> A-Z). Didn't you have plans for extending your interpreter to B98 at some point? P.S. I likely want to port your existing B93 interpreter to DOS, but some of the routines aren't really obvious where they want what, etc. (I'd have to take another look to be more specific, though.) EDIT: BTW, B98 seems to choke on whitespace in stringmode (e.g. my GUESSWHO.BEF example), both CCBI and FBBI. I personally consider that a bug, but who knows .... |
|||
![]() |
|
Pinecone_
rugxulo wrote: Yes, I figured as much. Sad that they overwork kids so much these days ![]() rugxulo wrote: You mean piracy (boo hiss) or just general password-ish related stuff? (Your code doesn't really tell me anything. I'm not sure what it's supposed to do.) rugxulo wrote: I likely want to port your existing B93 interpreter to DOS, but some of the routines aren't really obvious where they want what, etc. rugxulo wrote: BTW, B98 seems to choke on whitespace in stringmode |
|||
![]() |
|
rugxulo
Pinecone_ wrote:
Good, congrats! Quote:
Wow, that's something totally different that I've never heard of. Quote:
You did give some description, but it was still a little confusing. I'll have to look at it in more depth later. And yes, you can use 32-bit regs in DOS (DJGPP does all the time [e.g. Quake], as does OpenWatcom [e.g. Doom]). Quote:
You're right, I didn't know (hadn't read the full spec). I'll have to read it more in-depth later. (Actually found old specs to '96 and '97, and I tried for a few hours late last night to write a program to tell which one it's running on, but that was very frustrating, so I gave up ... for now.) |
|||
![]() |
|
rugxulo
Okay, my latest creation, useless but interesting:
EDIT: Tweaked. Code: !" "-!#v_"8879">,1k$>,@ ;$R z 3 >0"39"#@,z+ ^ WinXP> bef -q whichbef2.bef 93 WinXP> befi whichbef2.bef 93 WinXP> pconeb93 whichbef2.bef 93 WinXP> fbbi -93 whichbef2.bef 93 WinXP> ccbi --befunge93 whichbef2.bef 93 WinXP> for %a in (whichbef2.bef) do mtfi -3 %~sa 93 WinXP> for %a in (whichbef2.bef) do mtfi -6 %~sa 96 WinXP> for %a in (whichbef2.bef) do mtfi -7 %~sa 97 WinXP> fbbi whichbef2.bef 98 WinXP> ccbi whichbef2.bef 98 Last edited by rugxulo on 14 Apr 2010, 17:50; edited 1 time in total |
|||
![]() |
|
rugxulo
Since some Befunge98 interpreters don't have a -93 compatibility mode (I'm looking at you, CCBI), I decided to make my "guess who" more compatible so that it works either way. This is a direct result of the different whitespace handling in string mode.
EDIT: CCBI 2 has --befunge93, but it's quirky (reflects on invalid instructions, ugh). Code: v (guess who, gleaned from 4tH example, now compatible with B93 or B98) <v"& "+49"X *"::" *"7" X"5" X!" <v" XX"*62" XXXX"::" "6"X/"5" X"5" XXXX!"*44" XXX"+49" XX***"9" X"5" X!"/2 <v" "8"X\"5" XX"::" XX":" X!"*26" XX"*26" XX"*27" X"5" X":::" X":" XX!"*27 <v35" X":" X X":" X!"+19" X"/4"4 X"9" X"*72" XX X":" XXXX!"+92" X"+49" X"9 <v"X":::" X"::" X":::" X"8" X"/3"3 XXX":" XX!"+19" X":::" XXX"6" X"8" X"* <v:::" X":::" X":::" X"8" X!"9" X"::" X":::" X":::" X"8" X"/2"( XX!"9" " <v9"X/!"8" X"5" XXX//":::" X"+19" X!"8" X":::" X"::" X"5" X"9" X!"8" X" <v7" X"/2", XXXX!"9" X"9" //"::" X"/2": XX!"8" X"9" //":::" X"+19" "*2 <v*93" X** X!"+92" X"8" XX":::" XX"5" X"/2", X***X!"+19" X"9" //XXXX" <v*72" XX"::" X "6"*":" "9"X"*28" XX XXX!"*62" XX"6" X ****":" X" <v:" "5"*":" X"*62" XXX"5" XX!"*82" XXXX "7"* XXX"6" XXXX"+91" XX!" <v/2", XXXX!"*37" X":::" XX!"/2"( X":" ***":" X"*28" "5"X!"/2"& X" v < >:!#@_:"!"- v ^ ,_v#`*56:_91+,$ #| #$_ >1-\:,\:! Last edited by rugxulo on 14 Apr 2010, 17:51; edited 1 time in total |
|||
![]() |
|
rugxulo
Sorry to bump this old (favorite) thread!
![]() I was reading some Lua page today (and not totally convinced at it being such an easy language to learn), and I think it led to some Quine page. Normally I wouldn't even be interested because it's so hard to do. (I am in awe at some like the Intercal version!!) But with Befunge it seemed pretty trivial. (Also, I resent the idea that the obvious Rexx one is "cheating".) The only problem is mine is SO obvious that it almost 100% mirrors one of the pre-existing ones (and I didn't look): I wrote:
Kevin Vigor, Denis Moskowitz wrote:
Yeah, I'm sure somebody can come up with a better method. (That one plus four others are listed here, if you're curious.) P.S. Isa recently posted here his Net-/OpenBSD BF93 interpreter in the High Level Languages section, in case you missed it. P.P.S. I was gonna say, "Where's Pinecone_???" but noticed that I too haven't posted much since November. Ah well. ![]() |
|||
![]() |
|
Pinecone_
I'm here!
Sorry for the lack of activity on this forum in (wow... ages... time flies ![]() ![]() However I did have a good idea for a new esoteric language! Consider: Code: 65 x = { { x 6 + x = } { 91 x == } IF x PRINT_ASCII } { 123 x <= } WHILE Code: x = 65; while (x <= 123) { if (x == 91) x = x + 6; PRINT_ASCII(x); } ![]() Also, due to the syntax I'm planning, the above code can also be written on one line: Code: 65 x = { { x 7 + x = } { 91 x == } IF x PRINT_ASCII } { 123 x <= } WHILE ![]() A few notes:
Also I'm not too sure about these things and open to suggestions of how they should be handled:
If anyone is feeling bored, feel free to give a go at implementing the language ![]() One last note: I'm defining Language here, to mean the syntax of the language. The functions and operators avaliable to any implimentations of the language can vary, and should be called "Inverse:<Specific Name for implimentation>". My future implementation of Inverse (which may quite possibly be the only one, I'm just stating this stuff in-case someone decides to take interest to this ![]() Functions / Operators are to leave their result (if any) on the stack (which then allows them to be assigned to variables easily). The tricky part for an interpreter/compiler will be knowing whether a reference to a variable or the value of the variable is supposed to be pushed onto the stack. The best (or at least easiest to implement) idea I've had to overcome this is to push a reference to the variable and the variable's current value onto the stack, and then functions/operators uses whichever one they need to perform their purpose and discard the other (or special cases can be made, for example for the operator += which may use both) ![]() I'll go into more detail after I get some time to write some more stuff up about it and give a go at writing an interpreter... Unfortunately that time wont come for at least a month from now. PS: Inverse was inspired by Reverse Polish Notation. Edit: Fixed a would-be bug in the code ![]() Last edited by Pinecone_ on 07 Apr 2010, 08:12; edited 2 times in total |
|||
![]() |
|
revolution
Your "new" language looks like Forth.
|
|||
![]() |
|
Pinecone_
Really?...
![]() Edit: It does seem to have similarities... kind of like Forth is a super-advanced Inverse from the future! Hmmmm... Maybe using my new Inverse language I created a time-travel machine, traveled back in time and invented Forth (obviously I couldn't use my real name back then or I would have confused myself now) Yes, that's what happened ![]() lol anyway, I'm still interested in doing this... as soon as I get some time to... (I'm also interested in learning Forth now ![]() |
|||
![]() |
|
rugxulo
Forth is cool but confusing. In particular, few adhere to the standard, so you often have some mishmash of half-implemented versions. But they're usually still interesting.
![]() Anyways, I updated my hack (befi.com), bugfix to properly ignore uppercase letters (which apparently fixes official befunge[3x].bf examples). Also tweaked some other stuff. Of course, to add the fix, I had to increase the code, and shrinking back to 1024 wasn't too easy, so now it always returns a bogus errorlevel (to be fixed eventually/hopefully). There's also another interpreter, Serprex/Marsh (written in C99, apparently for *nix since it assumes "/dev/random") which seems pretty fast, e.g. even faster than BEFI.COM on this P4 (but not other cpus) when compiled with GCC 4.4.2 -mtune=pentium4 -O2 -fomit-frame-pointer. CCBI (Win32 or Linux32/64 only) was also updated to version 2, and he also updated Mycology. He now has a --befunge93 mode, but it's quirky (reflects on invalid instructions, e.g. ';', why??? not even official BEF or FBBI do that!). Actually, a lot of guys in #esoteric on irc.freenode.net seem to be writing Befunge interpreters but aren't finished optimizing yet (heh). ![]() P.S. Here's some new results for my benchmark.bef (although I *may* have accidentally used GCC 4.2.3 instead of much-faster 4.4.2, but whatever, the comparison is the same, used same .EXE for each machine). Note that I didn't use DJGPP's "redir -t" this time because a while back I made a temporary two-byte change to BEFI.COM and, on my AMD64x2 laptop running Vista, it slowed down twice as much (but only under REDIR!), so I avoided that here just in case. Quote:
![]() |
|||
![]() |
|
rugxulo
I remembered (but never got around) to the 1-year anniversary of (last update) of your (Pinecone_)'s Befunge93-win.exe . Oh well, happy birthday to it!
![]() |
|||
![]() |
|
Goto page Previous 1, 2, 3 ... 10, 11, 12 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2019, Tomasz Grysztar.
Powered by rwasa.