Slashdot Mirror


Assembler Compiler In Bash

sTeF writes "This guy is crazy, he wrote an assembler totally in Bash. After all those awk/sed/ps httpservers this is the next crazy step. what's next? a virtual machine in Bash? anyhow here's the url to the source."

13 of 126 comments (clear)

  1. hee, hee, hee by Anonymous Coward · · Score: 3

    Bash (bæsj) means poop in Norwegian!

  2. A standard mirror... by Rain · · Score: 3

    Here's a standard mirror of the beast, since (as posted earlier), the site has a limit of 60 anonymous connections, and I didn't notice any mirror that wasn't FreeNet based.

    HTTP: http://www.bluecherry.net/~rain/shasm.tgz
    FTP: ftp://ftp.bluecherry.net/pub/misc/shasm.tgz


    Our FTP server has a limit of 15 anonymous users, so I'd highly recommend using the HTTP mirror unless some BOFH firewalled port 80 outbound. (I've seen it happen!).

    --
    Ben Winslow..........rain@bluecherry.net
    bluecherry internet..http://www.bluecherry.net/

  3. Interactive assembler by coreman · · Score: 3

    We've had intereactive C for a while now, interactive assembler seems a reasonable extension... hmmm interrupt latency is what, 3-4 days?

  4. shasm by _Gnubie_ · · Score: 3

    The guy who wrote this Colorg (Rick) , also maintains cLIeNUX (Client orientated Linux) and was awarded the Efnet #Linux "King of the Geeks" crown a few days ago for SH.ASM. I've had a look at the code.
    The idea is to try to make a porttable ( to an extent ) assembler so asm written on one Arch can port easily to another.

    The cool thing about this is it only needs Bash. no other external utils.

    Tre Geek Cool

    At the moment not all the instructions are support and it doesnt do Elf and A.out - Only flat listings

  5. Re:'Assembler Compiler?' by commbat · · Score: 3

    the difference between assemblers and compilers

    For the newbies who can't understand what we're talking about:

    'Assembler' used to mean both the mnemonic 'language' that coincided with machine code (the actual ones and zeros that hardware understands -- sort of) and the program that turns that language into a form that the linker needs to produce the executable.

    'Compiler' is a program used to 1) scan the source code looking for keywords and other constructs in the language in question, substituting 'tokens' and making entries into a symbol table. 2) produce meaningful error messages concerning syntax. 3) parse the result determining the meaning of the program, sending this information to a 3) code generator and optionally to a 4) code optimizer. That's a very simplistic definition and one that's not necessarily 100 percent correct for all programs calling themselves 'compilers'.

    The current trend of calling assemblers 'assembler compilers' grates against my sensibilities too.

    --
    'Intellectual Properties' are uncontrollable in the wild. To base an economy on them is just stupid.
  6. Re:Next step by UberLame · · Score: 3

    Well, we used to have lisp machines. So, a self booting bash would just make for a bash machine. All programs would just be bash macros that get called from the command line. All storage would be scalars, arrays, and associative arrays. For persistance, bash would need to modified to save it's state to disk, but that would probably fit on a floppy for most people.

    --
    I'm a loser baby, so why don't you kill me.
  7. Let me guess... by Soft · · Score: 3

    Someone has had a bad experience of the Admin Horror Stories kind, rm-rf/ and the like?

  8. Assembler vs. compiler by eap · · Score: 4

    I've done a little bash programming, and I've also written a compiler (in C), and it would seem to me that writing an assembler would not be especially difficult in bash because the langauge contains very good string manipulation utilities (sed, awk, etc.). As one poster mentioned, assembly maps very well to machine code. Building in support for assembler macros could get tough, though.

    Now, if you were to try and write a 3rd generation language compiler (such as Pascal) in bash, you might get into trouble fast. This would require some very extensive control and data structures that bash doesn't support as well as, say, C. I'm not sure bash has multidimensional arrays or pointers, and these make constructing things like symbol tables a lot easier.

    Still, I would say this guy knows a lot more about bash than I do, and there is probably something I am missing (since I can't read the source right now).

  9. 'Assembler Compiler?' by emerson · · Score: 5

    Good thing the Slashdot editors are calling non-coders "l4m3" in the poll this week, since they're SO clear on the difference between assemblers and compilers....


    --

  10. Next step by geirt · · Score: 5

    the next crazy step

    bash in assembler.

    By the way, that would make bash self booting ...

    ---
    recursion, n: see recursion.

    --

    RFC1925
  11. Strange, stupid things to do with common tools by multipartmixed · · Score: 5

    ...many moons ago, my 3rd year AI prof asked us to hand in a solution to the `Blocks World Problem' in any language we wanted to. (Of course he actually wanted a solution in Lisp, but I had just finished hacking some extra functionality into Emacs and was sick of that language)

    I turned in a solution in ksh. He asked me "Why Ksh??", and I said "It doesn't fork to run functions like the bourne shell." Hee hee! I love given right-wrong answers to profs. ;-)

    A few weeks later I wrote a normal-math to RPN-math parser in Bourne shell using the Shunting Yard algorithm.

    You can do all kinds of things in shell -- for those of you among us who extoll p*rl as the be-all and end-all of programming languages, I say, "Try Shell! If you can't do it in shell, you should be writing it in C, anyhow".

    --

    --

    Do daemons dream of electric sleep()?
  12. Bullshit by multipartmixed · · Score: 5

    You don't need to build anything on the machine-to-be-h4x0rd if you know the target architecture -- which you must if you're going to write your 31337 buffer overflow 3xpl017 in assembler.

    Anything which can generate binary from your telnet connection will do -- I've transfered binaries from one system to another by cutting and pasting them in base64, or escaped octal before. Hell, there are even special t00lz designed for transfering binaries which are often available on the target system.. Lets see... I think they are called "ftp", "rsh", "ssh", and other funny nam3z like that.

    Yeesh. You people are idiots. Sysadmins beware? Puh-lease.

    No 5cr1pt k1dd13 is going to be writing custom one-offs in assembler on a target box.. after all, the 5cr1pt k1dd1e collective IQ is somewhat near the value the ax register holds after xor ax,ax.

    No skilled cracker is going to need this tool to do the deed, although it might be handy to have around.

    Next time, think before you speak -- alarmism is not useful. If you weren't posting as an AC, I'd think that you were almost certainly trying to a frist psot karma-whore trick.

    --

    --

    Do daemons dream of electric sleep()?
  13. LOL by jawtheshark · · Score: 5

    Now we just need an assembler written in perl! Everyone knows that will be the more elegant code ;-)

    --
    Ahhh...the great dumpster continuum. Many a free computer will be found there. -- sowth (748135)