Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

Assembler Compiler In Bash

Posted by michael on Thu Feb 15, 2001 05:05 AM
from the bass-ackwards dept.
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."
This discussion has been archived. No new comments can be posted.
Assembler Compiler in bash | Log In/Create an Account | Top | 126 comments (Spill at 50!) | Index Only | Search Discussion
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1) | 2
  • Re:Let me guess... by Anonymous Coward (Score:1) Thursday February 15 2001, @03:37AM
  • Re:Java, or... by Anonymous Coward (Score:1) Thursday February 15 2001, @05:28AM
  • Hardcore math by Anonymous Coward (Score:1) Thursday February 15 2001, @06:06AM
  • Actually by Anonymous Coward (Score:1) Thursday February 15 2001, @12:47AM
  • Re:'Assembler Compiler?' by Anonymous Coward (Score:1) Thursday February 15 2001, @07:04AM
  • Re:Cut to the chase by Ranger Rick (Score:1) Thursday February 15 2001, @05:24AM
  • Re:time for a time-out by kju (Score:1) Thursday February 15 2001, @07:21AM
  • Re:shasm by Stormie (Score:1) Thursday February 15 2001, @01:50AM
  • Re:How about by ydnar (Score:1) Thursday February 15 2001, @07:04AM
  • Re:Java, or... by Chacham (Score:1) Thursday February 15 2001, @05:25AM
  • Re:'Assembler Compiler?' by Hulver (Score:1) Thursday February 15 2001, @01:40AM
  • Re:Next step by /dev/kev (Score:1) Thursday February 15 2001, @02:13AM
  • Re:Who cares? by MrKhuel (Score:1) Thursday February 15 2001, @06:30PM
  • Who cares? by MrKhuel (Score:1) Thursday February 15 2001, @09:27AM
  • Re:huh? by Xerithane (Score:1) Thursday February 15 2001, @08:27AM
  • Who is the author? by jutus (Score:1) Thursday February 15 2001, @03:00AM
  • Re:Next step by Chmarr (Score:1) Thursday February 15 2001, @06:37AM
  • Re:'Assembler Compiler?' by Cee (Score:1) Thursday February 15 2001, @02:31AM
  • Not the first one by mwood (Score:1) Thursday February 15 2001, @03:51AM
  • that's nice... by mat.h (Score:1) Friday February 16 2001, @02:39AM
  • implement BASH itself in a SH script by cmos (Score:1) Thursday February 15 2001, @05:32PM
  • Re:time for a time-out by schon (Score:1) Thursday February 15 2001, @08:53AM
  • Speaking of asembly by (startx) (Score:1) Thursday February 15 2001, @03:46AM
  • Re:Who cares? by bored (Score:1) Monday February 19 2001, @03:13PM
  • Re:Who cares? by bored (Score:1) Thursday February 15 2001, @10:18AM
  • Big Deal by B.B.Wolf (Score:1) Thursday February 15 2001, @08:12AM
  • Re:Speaking of asembly by alehmann (Score:1) Thursday February 15 2001, @06:06AM
  • Re:You are mistaken, Dumass! - No, you are! by commbat (Score:1) Thursday February 15 2001, @03:17AM
  • Re:I Guess they beat the Emacs people by J.Random Hacker (Score:1) Thursday February 15 2001, @03:58AM
  • Re:Interactive assembler -- already done by redelm (Score:1) Thursday February 15 2001, @06:09AM
  • Re:PerlOS by shadowspar (Score:1) Thursday February 15 2001, @04:17AM
  • all right! by operagost (Score:1) Thursday February 15 2001, @03:36AM
  • Getting SHASM by tuiedm (Score:1) Thursday February 15 2001, @04:29AM
  • Re:Disassembler would be better. by jaakko (Score:1) Thursday February 15 2001, @05:03AM
  • Re:'Assembler Compiler?' by alprazolam (Score:1) Thursday February 15 2001, @05:24AM
  • Re:LOL by alprazolam (Score:1) Thursday February 15 2001, @05:27AM
  • borg by bendawg (Score:1) Thursday February 15 2001, @05:10AM
  • let's hear it for turing-completeness by ganley (Score:1) Friday February 16 2001, @04:40AM
  • C++ Compiler in XSLT by MrBlack (Score:1) Thursday February 15 2001, @06:04PM
  • Go G! by ayf6 (Score:1) Thursday February 15 2001, @04:02AM
  • Re:'Assembler Compiler?' by rmstar (Score:1) Thursday February 15 2001, @02:28AM
  • Re:Bullshit by alexburke (Score:1) Wednesday February 21 2001, @01:25PM
  • How about by roman_mir (Score:1) Thursday February 15 2001, @04:19AM
  • Re:Slashdotted ftp (Off Topic!) by pallex (Score:1) Thursday February 15 2001, @03:34AM
  • Re:Slashdotted ftp (Off Topic!) by pallex (Score:1) Thursday February 15 2001, @01:32AM
  • Re:hee, hee, hee by Hellburner (Score:1) Thursday February 15 2001, @06:28AM
  • Really ugly.... by lotussuper7 (Score:1) Thursday February 15 2001, @04:44AM
  • Re:Bullshit by smack64 (Score:1) Thursday February 15 2001, @09:25AM
  • Re:Getting SHASM by hardburn (Score:1) Thursday February 15 2001, @04:45AM
  • Re:Slashdotted ftp by hardburn (Score:1) Thursday February 15 2001, @04:24AM
  • Freenet Mirror by hardburn (Score:1) Thursday February 15 2001, @04:27AM
  • Re:How about by hardburn (Score:1) Thursday February 15 2001, @04:39AM
  • Re:huh? by nomadic (Score:1) Thursday February 15 2001, @07:39AM
  • Re:Slashdotted ftp (Off Topic!) by TheEye (Score:1) Thursday February 15 2001, @04:27AM
  • Re:Critic by f5426 (Score:1) Thursday February 15 2001, @12:23AM
  • rtfm? by darthdrinker (Score:1) Thursday February 15 2001, @07:18AM
  • time for a time-out by jnorden (Score:1) Thursday February 15 2001, @06:00AM
  • Re:I Guess they beat the Emacs people by drinkypoo (Score:1) Thursday February 15 2001, @07:32AM
  • Re:huh? by drinkypoo (Score:1) Friday February 16 2001, @01:08PM
  • Re:huh? by drinkypoo (Score:1) Friday February 16 2001, @04:26PM
  • Re:huh? by drinkypoo (Score:1) Thursday February 15 2001, @07:24AM
  • Re:Critic by de Selby (Score:1) Thursday February 15 2001, @08:26AM
  • Re:Slashdotted ftp (Off Topic!) by lucius (Score:1) Thursday February 15 2001, @02:53AM
  • Re:'Assembler Compiler?' by billcopc (Score:1) Friday February 16 2001, @12:03AM
  • My SETI@Home client compiled for the VIC-20 by tenzig_112 (Score:1) Thursday February 15 2001, @03:06AM
  • Link in article ? by RedLaggedTeut (Score:1) Thursday February 15 2001, @01:06AM
  • Disassembler would be better. by BlowCat (Score:1) Thursday February 15 2001, @04:45AM
  • Re:Disassembler would be better. by BlowCat (Score:1) Thursday February 15 2001, @06:07AM
  • Just promise me one thing: by AFCArchvile (Score:1) Thursday February 15 2001, @04:20AM
  • Crazy or just mis-understood? by James Foster (Score:1) Thursday February 15 2001, @03:14AM
  • Re:Didn't get the idea fist. But then! (Maybe not) by julesh (Score:1) Thursday February 15 2001, @03:29AM
  • Re:LOL by FreeMath (Score:1) Thursday February 15 2001, @12:49AM
  • Oucha ... by jamiguet (Score:1) Thursday February 15 2001, @01:11AM
  • Re:Critic by ConsumedByTV (Score:1) Thursday February 15 2001, @12:35AM
  • oh my god. by Pheersum (Score:1) Thursday February 15 2001, @07:28PM
  • Re:Critic by Kurt_Rambone (Score:1) Thursday February 15 2001, @12:17AM
  • Re:Critic by Kurt_Rambone (Score:1) Thursday February 15 2001, @02:38AM
  • Re:Bullshit by mallsop (Score:1) Thursday February 15 2001, @10:58AM
  • Re:LOL by MeltyMan (Score:1) Thursday February 15 2001, @11:21AM
  • Re:time for a time-out by seann (Score:1) Thursday February 15 2001, @09:16AM
  • Slashdotted ftp by ooze (Score:1) Thursday February 15 2001, @01:10AM
  • Re:Didn't get the idea fist. But then! (Maybe not) by ooze (Score:1) Friday February 16 2001, @12:59AM
  • Didn't get the idea fist. But then! by ooze (Score:1) Thursday February 15 2001, @01:36AM
  • Re:Slashdotted ftp (Off Topic!) by ooze (Score:1) Thursday February 15 2001, @01:37AM
  • I Guess they beat the Emacs people by robert-porter (Score:1) Thursday February 15 2001, @03:28AM
  • Why not ? by lemarsu (Score:1) Thursday February 15 2001, @01:44AM
  • Re:Depends on definition of "high-level" by _tiny_8_ (Score:1) Thursday February 15 2001, @07:09AM
  • Re:Java, or... by Anonymous Coward (Score:2) Thursday February 15 2001, @06:09AM
  • huh? by Zach Baker (Score:2) Thursday February 15 2001, @11:03AM
  • Re:'Assembler Compiler?' by Hulver (Score:2) Thursday February 15 2001, @01:39AM
  • Re:Arrrrgh! by paul.dunne (Score:2) Thursday February 15 2001, @06:48PM
  • Re:Strange... by mcc (Score:2) Thursday February 15 2001, @04:13AM
  • Re:LOL by mcc (Score:2) Thursday February 15 2001, @04:24AM
  • Re:huh? by kaisyain (Score:2) Thursday February 15 2001, @06:16PM
  • huh? by kaisyain (Score:2) Thursday February 15 2001, @06:05AM
  • Re:Java, or... by humphrm (Score:2) Friday February 16 2001, @08:15AM
  • Re:Some People. by hugg (Score:2) Thursday February 15 2001, @08:02AM
  • Re:'Assembler Compiler?' by mistered (Score:2) Thursday February 15 2001, @02:53AM
  • Cut to the chase by lildogie (Score:2) Thursday February 15 2001, @05:07AM
  • Re:Slashdotted ftp (Off Topic!) by Snard (Score:2) Thursday February 15 2001, @03:42AM
  • efficiency, fairness by anonymous cowerd (Score:2) Thursday February 15 2001, @05:35PM
  • But you still leave "assembly language" undefined by yerricde (Score:2) Thursday February 15 2001, @07:31AM
  • Depends on definition of "high-level" by yerricde (Score:2) Thursday February 15 2001, @05:35AM
  • Portable asm has been done by yerricde (Score:2) Thursday February 15 2001, @05:39AM
  • Re:huh? by nomadic (Score:2) Friday February 16 2001, @03:35PM
  • Re:huh? by nomadic (Score:2) Friday February 16 2001, @04:36PM
  • Re:'Assembler Compiler?' by saider (Score:2) Thursday February 15 2001, @02:10AM
  • Re:Java, or... by Marc2k (Score:2) Thursday February 15 2001, @07:40AM
  • Java, or... by FreeMath (Score:2) Thursday February 15 2001, @12:12AM
  • Re:Critic by FreeMath (Score:2) Thursday February 15 2001, @12:38AM
  • Arrrrgh! by sparcv9 (Score:2) Thursday February 15 2001, @11:38AM
  • Re:Critic by Kurt_Rambone (Score:2) Thursday February 15 2001, @12:44AM
  • Re:Critic by Kurt_Rambone (Score:2) Thursday February 15 2001, @12:52AM
  • hee, hee, hee (Score:3)

    by Anonymous Coward on Thursday February 15 2001, @01:58AM (#430927)
    Bash (bæsj) means poop in Norwegian!
  • by Rain (5189) <slashdot@t.the[ ]fin.net ['muf' in gap]> on Thursday February 15 2001, @05:49AM (#430928) Homepage
    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 [everything2.com] based.

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


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

    --
    Ben Winslow..........rain@bluecherry.net
    bluecherry internet..http://www.bluecherry.net/
  • by coreman (8656) on Thursday February 15 2001, @02:00AM (#430929) Homepage
    We've had intereactive C for a while now, interactive assembler seems a reasonable extension... hmmm interrupt latency is what, 3-4 days?
  • shasm (Score:3)

    by _Gnubie_ (14485) on Thursday February 15 2001, @12:48AM (#430930)
    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
  • by commbat (50622) on Thursday February 15 2001, @03:05AM (#430931) Homepage
    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.
  • Re:Next step (Score:3)

    by UberLame (249268) on Thursday February 15 2001, @06:10AM (#430932) Homepage
    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.
  • Let me guess... (Score:3)

    by Soft (266615) on Thursday February 15 2001, @12:16AM (#430933)
    Someone has had a bad experience of the Admin Horror Stories [hunter.com] kind, rm-rf/ and the like?
  • by eap (91469) on Thursday February 15 2001, @04:07AM (#430934) Journal
    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).
  • by emerson (419) on Thursday February 15 2001, @12:37AM (#430935) Homepage
    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....


    --
  • Next step (Score:5)

    by geirt (55254) on Thursday February 15 2001, @12:23AM (#430936)

    the next crazy step

    bash in assembler.

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

    ---
    recursion, n: see recursion.

  • by multipart/mixed (163409) on Thursday February 15 2001, @04:51AM (#430937)
    ...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".

    --
  • Bullshit (Score:5)

    by multipart/mixed (163409) on Thursday February 15 2001, @04:35AM (#430938)
    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.

    --
  • LOL (Score:5)

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