Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
It's funny.  Laugh.

Assembler Compiler In Bash 126

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

Comments Filter:
  • by Anonymous Coward
    a friend of mine once, when writing his thesis, "renamed" his Postscript pictures like this:

    rm foo*.eps bar*.eps

    fortunately he had a (one day old) backup. It's not exactly an admin horror story, but he knew the root password (his machine).
  • by Anonymous Coward
    Damn, troll, learn something before you post. Java is not slow. It takes longer for Java programs TO COMPILE, but once compiled, theres no real difference.

    The poster said " How about a java virtual machine written in bash. Would that be slow enought?".

    Was the poster correct saying it would be slow. Yes!!! Guess who is the troll?

  • by Anonymous Coward
    I once turned in my solutions for a Miller-Rabin Primality Tester ( to test large ( >15 digit ) primes ) in Javascript! The Professor was amazed he could surf to a webpage, type a large number in a textfield, hit a button & test primality , all on the client-side without any C/perl/whatever, plus he could do a "View Source" & see the javascript source code right there. That's how you misuse tools, my man.
  • by Anonymous Coward
    For crackers who want to do some stack smashing, this would be quite useful for compiling a buffer overflow attack from a compromised machine that didn't have any compilers installed. Systems Administrators beware.
  • by Anonymous Coward
    'Assembler' used to mean both the mnemonic 'language'...

    The mnemonic language is better known as assembly, while the word assembler indicates the translator.

  • It's called "eval".

    :)

    1st Law Of Networking: Loose ends are bad, termination is good.

  • Please take some time and read the documentation which comes with the assembler. It got some points why the assembler was written and possible usages.
  • The guy who wrote this Colorg (Rick) , also maintains cLIeNUX (Client orientated Linux)

    Is he the guy that started that huge flamewar by suggesting that /bin, /etc, etc. be renamed to /.bn, /.et etc. to hide them, and then adding symlinks like "/Binaries -> /.bn". What a weird bloke.

  • Oh come on, everyone knows that Java running under Bash is slow. But when bash is running on Linux it's faster than everything else. In fact, it'd be so fast, it'll finish compiling even before you finish writing the code.

    What we're all waiting for is the JVM in E-macs. That'll be the day. :-)


    ticks = jiffies;
    while (ticks == jiffies);
    ticks = jiffies;
  • In your dreams (:
  • You probably want CFLAGS=-S
    :)
  • Machine code is another language. You could even program in it if you felt the masochistic urge. It is a language that is interpreted by a microprocessor. I am perfectly aware of what is normal terminology in "the trade." But compiler is also a computer science term that is much broader than the original poster indicated. A lot of terms in "the trade" change pretty frequently (for example, try to define "operating system" in a manner that cannot be debated). So I don't see the point of jumping on someone because of some terminology usage just because it offends some arrogant programmer.

  • Get off your fsking high horse. The definition of a compiler is a little more broad than what you've given.

    A compiler takes something in language source and translates it into its equivalent in language target. Language target is commonly machine code. However, language could be something like assembly code, C code, or even a TeX DVI file (tex has rightly been called a compiler).

    What's the big deal if source is an assembly language instead of a high-level language? Yeah, you might want to be more specific and call it an assembler, but by the accepted definition of a compiler it is in the domain of compilers.

    Now, consider your definition of a compiler:

    • assemblers have to scan source looking for keywords, converting them into tokens and making entries into a symbol table. At least, I would consider "mov" and "add" to be keywords of some sort. And labels definitely need some sort of symbol table. Who cares if it can be translated right away without any processing? It's still translating.
    • Assemblers can also produce meaningful error messages too within the domain of what a meaningful error message is for assembly code.
    • Assemblers have to know what you mean when you say "add $r1, $r2, $r3." It's arguably less than knowing what "x = y + z" means, but to that's just because the scope of the assembly and high-level languages differ.
    • Assemblers generate code typically, amazing.
    • Some assemblers even perform optimizations. For example, some MIPS assemblers would rearrange instructions to take advantage of branch delay slots.

    Basically, an assembler is a compiler by my definition and your definition. So stop the elitist arrogancy because you think you know what is and is not a compiler unlike the so-called uneducated masses.

  • No, you really couldn't. That would be a shell script that runs gcc.

    Instead of a shell script that converts C code to machine language. Yes, it would require other atomic pieces (sed/awk) but the shell script would do the conversion.

  • Who is the madman that gets credit for this compiler?
  • Hey... what's the big deal? WHen I was in university, I wrote a C compiler, and linker, in BASIC on my TRS-80/Model I.

    Okay, so 'Hello world\n' took 20 minutes to compile... :)
  • Sorry.. I don't think so..
  • Many years ago I used VMS DCL to write what would now be called a bytecode compiler for a menusystem description language. Getting DCL to output arbitrary binary was, ah, an interesting experience.

    I'm glad to see I'm not the only weirdo out there. Be creative! Think about what your tools *do*, not just how everybody else uses them. Has anybody else tried doing DHTML in m4?
  • ...but I have much greater respect for Greg Ubben's complete implementation of dc in sed. It comes with newer versions of GNU sed and therefore probably hides somewhere on your hard disk (try locate dc.sed). Or look here [ece.ntua.gr].
  • what about that?
    f C compilers are written in C why not write a BASH interpreter using BASH...

    that'll probably be about 100 times slower than the original BASH, so you can even run SHASM in this new thing and get a 10000 times slower assembler..

    which will be cool of course ;-)

  • for i in `seq 1 1000`; do
    echo "Shell-script is not an effective tool for complex programming tasks."
    done

  • Does anyone know of a good z80 asmbler for linux? I've got an itching to work on my TI-83 again, and no TASM to do it with!
  • I guess I have to reply..

    Machine code is another language

    Its not!!! That's my point MC and assembly are the same thing! Two different representations of the same thing. Define 'programming' in machine code and you will discover that I can argue that what you are really doing is programming in some symbolic representation of 'machine code'. '0x90' is no more machine code than 'nop' but we don't call it that. Think of an assembler more like a text to speech software rather than a babblefish like translator.

    &LT RANT sorry... &GT
    I understand that you can take the definition of compiler to include assemblers. Your argument about definitions changing is bogus. Rarely do we take a broad definition and use it to cover specific instances when we are trying to be specific. Sure definitions get broader. Name something that was part of the definition of an OS in 1980 that isn't currently part of at least one piece of software generally accepted to be an OS! Broad definitions often extend themselves. When I say "EPROM" I don't have to say "ROM EPROM" its assumed and understood that EPROM is a ROM. When I said memory 10 years ago, that meant DRAM, SRAM, assorted XXROM's. Today memory is all that it was in 1991 but we have additional descriptions like SDRAM, RDRAM, DDR, and assorted other 'new' things.

    You have a valid point about jumping people for terminology, but why do we teach grammar? Its because having a standardized method for expressing something aids in understanding. It is far clearer to call it an 'assembler' than a 'assembler compiler' even though it might be correct by the definitions of a compiler. Which as other people pointed out is actually incorrect, an assembler is the 'compiler'. To be correct, in ones terminology it is really an 'assembly compiler'.

    &lt /RANT &GT

  • A compiler takes something in language source and translates it into its equivalent in language target

    This is precisely why its not appropriate to call an assembler a compiler. Its not technically a language translation. Its rather a symbolic conversion. The language is, for the most part, 1:1 between the human readable symbols and the machine readable symbols. Assuming x86, "NOP" is exactly 0x90 all the time and 0x90 is exactly NOP all the time. Early assemblers were simply advanced search and replace engines. Early compilers still had scan, parse, code generation, and in some cases an optimization pass. Sure you can construe an assembler into a compiler but its really a subset of a compiler because many of the compiler requirements aren't really needed with an assembler. If your going to call an assembler a compiler you might just as well call the disassembled dumps from your favorite debugger "decompiled code".

    Calling an assembler a compiler is not acceptable for someone in the trade. Its acceptable for a layperson to not understand the differences just like it is acceptable for them not to completely understand the differences between flash, PROM, EPROM and RAM.

    Now to support another view point. Using your definition of a compiler what is the difference between a compiler and a cross-compiler? There isn't any is there? Well then how do we distinguish the difference. What about java then, which is (as far as I'm aware there still isn't a true java machine that support the whole spec) always a cross compiler or maybe just a tokenizer. Maybe the whole thing has to do with language! You express and idea with the understanding the audience you are expressing it to understands the basic premises of your topic. Now on /. do you expect people to know what an assembler is? How about a compiler? Now why the heck call it an assembler compiler when you could just call it an assembler written in bash.

  • One of my buddies wrote an assembler in HP Basic back in 1976 while we were sophmores in high school. We used Model 25 Teletypes to connect to our highschools mainframe. He also wrote a virtual machine kinda based on the 6800.
  • zcc includes 'as', a good assembler with a linker and all. Search for it on google.
  • A 6502 cannot last a 1020 years

    Three possibilities:

    1) Hardened militarized versions of the chip were discovered and used in the bender units,

    2) The 6502 was reversed engineered from surviving copies of 'Attack of the Mutant Camels'

    3) The templates used in the manufacture of 6502s were discovered and reused.
  • If you mean by that that EMACS doesn't have an assembler, au contraire (did I spell that right? ;-). EMACS has the only assembler you'll ever need, once you have Emacs installed. It translates elisp into bytecodes.

    Now for those of you thinking -- wait, isn't that a compiler? -- remember that the bytecode compiler has a lower level section that you can use as an assembler, which again points out that with LISP you can do anything, and make it look the way you like, as long as you like lists :-).

    I *love* EMACS... I love LISP even more.
  • I hate to say it, MicroSoft has beaten you to the punch!

    MS-DOS since v 1.0 has included Paul Allen's DEBUG.COM . IMHO, this is the unsurpassed high-water mark of MS's products.

    DEBUG.COM (now DEBUG.EXE) is remarkably interactive. It has a built-in miniassembler and disassembler and is remarkably interactive in use.
  • IIRC I had heard that there is someone, somewhere, merrily hacking away writing PerlOS (complete with device drivers, of course.)

  • Now I have a use for the two VICs in my hall closet! I figure I can burn through a sample in about 5.6 years!

    You've truly inspired me. I think I'm going to write an OS in QBasic now!

  • Replace the ftp with http and all is well.. Seems they aren't allowing anonymous ftps any longer or something.
    Ed.
  • Superiority, bah. GNU zealot.
  • i've always called what you call assemblers compilers. they're no different from what you call compilers. they're going from high level language to low enough to run. and how come it doesnt even say what hardware the compiler is for? assembly languages differ.
  • he was confused, it was really ascii art, he just thought it was perl code.
  • by bendawg ( 72695 )
    This Bash of Borg. Resistance is futile. You will be assembilated.
    (Sorry--Couldn't resist)
  • I'm reminded of my own Lisp interpreter [ganley.org] written in JavaScript.

    Joe Ganley
    ganley.org [ganley.org]

  • I thought a C++ Compiler in XSLT sounded pretty crazy until my brother said he'd thought about writing one, "just for fun".
  • by ayf6 ( 112477 )
    Bash compiler... What will this guy think of next. Seems like colorg (rick) is always coming up w/ a new crazy idea. For those of you that dont know Clienux (colorg's distribution) uses a unique directory structure (no /etc for example). Its unique and you all should try it... -jester
  • 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....

    [...]

    Moderators: copy/pasting text from the site a story links to isn't "Informative," it's "Redundant."

    I don't know, but don't you think someone else is being really really pedantic?

  • Jesus, you must be a fun guy to work with.

    I know him, and he is.

    --
  • Object Oriented Assembler (OOA that is.) Come up with that, and you're all set for the trip to a nut house.
  • yeah,absolutely everything else was fine. When i came back i expected to see no posts all day, but instead it was business as usual!
  • Talking of slashdotted, i couldnt get into SlashDot yesterday from 09.00 -> about 17.00 uk time - anyone else have this prob?
  • "For me to bash on!"
  • Well, cool. I always like hacks like that.

    Long time ago, an anonymous hacker where I worked did a fortran compiler in TECO. Someone else started to (re)write system utilities in Teco, as well (like SYSDPY on the PDP-10.) Nice hack....

  • How can a 5cr1pt k1dd13, with an IQ that large, possibly figure out what the result of `xor ax, ax is?
  • Nope, just slashdotted. Maximum of 60 anoyn connections. I've provided a mirror on Freenet [freenetproject.org]; see another post.


    ------

  • I have provided this mirror on Freenet [freenetproject.org]:

    KSK@/slashdot/mirror/shasm.TGZ [freenet]

    The direct CHK is CHK@CZMmKmFfPIBICsilSsDybTofi1oOAwE,cNNb4iRSoRGynx ANzqhByQ [freenet]

    If you have Freenet node and a plugin for your browser that can understand freenet: URIs, you can click the above to get it. Otherwise, go to www.freenetproject.org [freenetproject.org] and download and install Freenet. Then request the key.


    ------

  • I have provided this mirror on Freenet [freenetproject.org]:

    KSK@/slashdot/mirror/shasm.TGZ [freenet]

    The direct CHK is CHK@CZMmKmFfPIBICsilSsDybTofi1oOAwE,cNNb4iRSoRGynx ANzqhByQ [freenet]

    If you have Freenet node and a plugin for your browser that can understand freenet: URIs, you can click the above to get it. Otherwise, go to www.freenetproject.org [freenetproject.org] and download and install Freenet. Then request the key.


    ------

  • Amiga Virtual ASM is, if you can really call it "assembly". In any case, OO is really something better left for high-level work.


    ------

  • Ah, grasshopper, you are missing the whole point of Unix - The pipe. Everything on Unix is [intended to be] part of everything else.

    By that logic I could make a C compiler by just making a bash script that runs gcc...
    --
  • Why then takes this more than ten hours?

    My suggestion was a compromised server, since
    the trace stopped dead somewhere in the states.

    Hmmm...
  • > Now what I'd love to see, is a free X server for OS X. Mmm, that would make my life complete!

    What about XFree86 4.0.2 ? Get the darwin distribution at xfree86.org then the rest from http://mrcla.com/XonX/

    Now that I have completed your life, could you refrain to post garbage ? A bash assembler is just awsome...

    Cheers,

    --fred
  • WTF is bash? errrr... oke mum, i'll be down in a minute!
  • Its been said millions of times - just because something can be done doesn't mean that it should be done.

    Now, take this pencil and pad of paper and go sit in the corner. Write the following line 1,000 times:
    Shell-script is not an effective tool for complex programming tasks.

    ------
    Life would be better and Linux would have far fewer bugs if we could somehow force this time-out on lots of other folks too. Case in point: teTeX.

  • If by "beat the Emacs people" you mean, "Invented something needlessly slow to perform a task which is already better-performed elsewhere", then you are wrong. Emacs has been doing that since its inception.


    --
    ALL YOUR KARMA ARE BELONG TO US

  • sed and awk aren't part of bash.

    Duh. But you're still missing the point of my post, which was to say that no app in unix is intended to stand alone. The whole IDEA of Unix is that you can string your commands together; Implementing something solely in bash is the right way to do it if it's the fastest and/or easiest, but if using sed and/or awk would have made it easier, then doing it without them is contrary to the lazy* [slashdot.org] nature of Unix.

    * This is, of course, the type of laziness made famous by Larry Wall.


    --
    ALL YOUR KARMA ARE BELONG TO US

  • I think you're missing the point of the original post, though; nobody's arguing that bash is meant to stand alone; I think you may have jumped into the argument a few posts too late. If you write a compiler using bash, and do string manipulation through sed and awk, then you haven't written a compiler just using bash. You've used bash AND sed AND awk. We're talking about semantics here, not practical programming.

    When I started this sub-thread (way up the tree from here) I wasn't saying I didn't get it; I was saying that it was pointless and unnecessary, and I was attempting to explain why.

    HTH, HAND.


    --
    ALL YOUR KARMA ARE BELONG TO US

  • sed and awk aren't part of bash.

    Ah, grasshopper, you are missing the whole point of Unix - The pipe. Everything on Unix is [intended to be] part of everything else.

    Remember, pipes as we know them in the Unix (and everything else these days) shells came from Unix. That's where that shit was invented. The idea was to produce a bunch of atomic utilities that one could tie together with shell scripts, exactly as one does on any other mainframe (Or at least, you used to need a 'frame to run this junk. OS/400. OS/390. Etc.)

    ObDisclaimer: I don't think OS/400 or OS/390 are junk. I Think they're both very nice. Please do not send men in blue suits to beat me up.


    --
    ALL YOUR KARMA ARE BELONG TO US

  • by Anonymous Coward
    I'm guessing you just fell off the boat yesterday. While the current jvms are a bit faster than some of the previous ones they are still slower than their non p code counterparts. I for one am tired of hearing the bs from zealots like you who have probably never done any real coding and think java is a god send. It has it's points but it is hardly the end all be all so many make it out to be.
  • sed and awk aren't part of bash.

  • Assembly language is NOT machine code, so it does need a compiler to turn it into Machine code. Thats what this is, its a compiler for assembly language.

    Assembly language is pretty much a straight one for one conversion into machine code, but the assembler does do things like, convert labels into relative jumps. Things like that are a real pain when you are coding in straight Machine Code.
  • > Anyone that puts a single-quote in a UNIX filename needs to be shot.

    Why? The single-quote is not a special character to a Unix filesystem. It may be special to the shell, it's true. So change your shell? Or just use the facilities in the shell for dealing with this. I have files with single-quotes in. I don't find typing \ or enclosing the name in double-quotes to be appallingly hard work.

  • As of this posting neither netscape 4/windows nt or wget/slackware were able to connect, with or without email address passwords.

    My guess is it's just slashdot effect, and the problem is that the quota for simultaneous anonymous connections is exceeded. Or the sysadmin was so horrified by the number of people hammering on her server that she disabled the anonymous acct. altogether. Wait 24 hours, it'll be ok -_-

  • by mcc ( 14761 )
    As a perl -e oneliner :)

    Don't laugh, you just know SOMEBODY in the slashdot reading audience saw jawtheshark's post and started writing a oneline perl assembler immediately -_-

    (hell.. whenever i can get through to the /.ed ftp server, i'll try to write one myself.. :)

  • What do pipes have to do with anything?

    The assembler was written entirely in bash. It uses no external utilities. It does not use sed or awk or perl or python or ed or anything else. The post I was replying to was an idiot that got modded as insightful by other idiots.
  • sed and awk aren't part of bash.
  • I will not rest until I have a 36 bit operating system written in base. TOPS-10 ALL THE WAY!!!!
  • Just think what would have happened if Linus decided to go for a walk instead of hack!!! Flood. Famine.
  • Assembly language is pretty much a straight one for one conversion into machine code

    Indeed, on some processors the assembler does even more including expanding one assembly instruction into multiple machine instructions. On a MIPS [mips.com] for example there's even a register reserved for the assembler ( at - assembler temporary) to use when expanding instructions.

  • Clearly the ultimate would be bash in bash.
  • It appears that the IP address for www.slashdot.org (and just plain slashdot.org) changed in the last 24 hours or so - my nameserver hadn't sync'd up with the change until sometime yesterday afternoon. But people on other name servers were apparently able to connect just fine. I must have a slow nameserver here...
  • Once I wrote a plot program for an HP71B, a handheld computer, in that machine's dialect of BASIC, which would print out lines and arcs (land survey drafting) on their weirdass inkjet printer - took about an hour per 8-1/2" x 11" page...

    Unlike these cheat-o-matic languages in popular use these degraded days, which basically run way too God damn fast for you ever to win, BASIC is a sporting language, plays fair, gives you the competitor at least a chance to keep up or even surge ahead and break the ribbon, with nothing more than a pencil and paper and your own slow brain as a processor.

    Yours WDK - WKiernan@concentric.net

  • Why can't we just define what an assembler is ? It would be much easier. An assembler assembles assembly. Simple. Anything that does not do this is not an assembler.

    Now your definition of an "assembler" is "a program that translates assembly language into object code"; you still leave "assembly language" undefined. The task of defining asm precisely is complicated by the virtual machines that exist on several levels:

    • The macroinstruction support in more powerful assemblers distorts the "one asm instruction, one binary instruction" aspect of the commonly accepted definition of asm. The MIPS asm specification specifies a large number of "pseudoinstructions," that is, short macros that use MIPS register 0. A rich macro system in an assembler could possibly make MIPS look like PowerPC look like ix86 look like Sparc look like Alpha look like XScale look like ARM look like even good ol' Z80 and 6502.
    • One word: Java.
    • How do we know it isn't possible to create a machine that runs C bytecode in hardware? It's already been done for Forth.

    All your hallucinogen [pineight.com] are belong to us.
  • Common practice where I work is to call programs that convert assembly into machine code assemblers, and programs that convert high level source (C,Fortran) into machine code compilers.

    Scheme and Perl advocates would say that C and Fortran aren't much higher level languages than assembly; thus the common joke about C compilers being PDP-11 assemblers. I still haven't seen a hard distinction made between "an assembler with a rich macro language" and "a compiler."


    All your hallucinogen [pineight.com] are belong to us.
  • The idea is to try to make a porttable ( to an extent ) assembler so asm written on one Arch can port easily to another.

    C source code is pretty close to a portable assembly language, source-compatible across any conforming ANSI C compiler. Jasmin [nyu.edu] (Java virtual machine assembly) is even binary-compatible across Linux/x86, Solaris/SPARC, Mac/PowerPC, and Windows/x86.


    All your hallucinogen [pineight.com] are belong to us.
  • Duh. But you're still missing the point of my post, which was to say that no app in unix is intended to stand alone.

    I think you're missing the point of the original post, though; nobody's arguing that bash is meant to stand alone; I think you may have jumped into the argument a few posts too late. If you write a compiler using bash, and do string manipulation through sed and awk, then you haven't written a compiler just using bash. You've used bash AND sed AND awk. We're talking about semantics here, not practical programming.
    --
  • When I started this sub-thread (way up the tree from here) I wasn't saying I didn't get it; I was saying that it was pointless and unnecessary, and I was attempting to explain why.

    Alright; the post that started all these threads said that the bash language contains good string manipulation utilities in the form of sed and awk. Someone pointed out that these were not part of bash. You said UNIX apps weren't meant to run as stand-alones. Nobody disputed this; we're just saying that from a strictly technical point bash, sed, and awk are all different programs, not that they should be run alone.
    --
  • It is a matter of semantics, but compilers typically convert a high level language into assembly which is then assembled into the binary machine code.

    Common practice where I work is to call programs that convert assembly into machine code assemblers, and programs that convert high level source (C,Fortran) into machine code compilers. Interpreters are the third way to get text to turn into machine code, although they are usually based on compilers (script->C source->object).

    Summary
    Assemblers - 1 to 1 conversion of keywords to object code
    Compilers - keywords often result in many lines of object code
    Interpreters - statements are compiled and run as they are being entered.



  • Java only undergoes pseudo-compilation. Even after it is compiled, it is still only in byte code, which must be interpreted. This wonderful combination of a compiled/interpreted language brought to you by Sun makes for incredibly slow runtime versus purely compiled languages. While it's not required to be knowledgable to post on slashdot, it really should be a prerequisite for reprimanding someone on misinformation.

  • How about a java virtual machine written in bash. Would that be slow enought?
    No, how about something like a PDP-11. Any other ideas?
  • Yeah, it's kind of like that Linus guy who wanted to learn about the 386. Just look at all the time he waisted on another version of UN*X.
  • Anyone that puts a single-quote in a UNIX filename needs to be shot.
    Anyone that pluralizes CPU with a single-quote needs to be shot.
    (I am referring to the directory named sh.asm/CPU's in the tarball.)
  • >So you can write a driver in a HLL huh? umm yes.
    Erm, let me rephrase the question...

    So you can write a driver in a HLL without relying on libraries or LowLevel calls? (think about it..also asm directives don't count)

    >So you can code a routine to a certain byte size in a HLL? if you have to
    Maybe, but you've still got section padding which still adds bytes...

    >So you can code a routine to execute in a certain number of cycles in a HLL? can you in asm? think about it.

    Actually yes. every instruction has a cycle count, and any out of order execution or pipelining can be countered using simple optimizing trix.

    >Is it pointless to squeeze the last bit of performance from a routine?
    You didn't answer the question....

    >i think you are asking the wrong questions. i think you should be asking:
    Am I a fag? no
    Do I have any idea? plenty. I am a regular contributor to a rather large open-source project (xmame/xmess) so that probably gives me an idea or two ;)

    Should I kill myself? Wrong question, because I am on a course of antidepressants at the moment to stop me from thinking about exactly that.

    Next....
  • There's not enough space inthis little box for a diatribe, so here's a few links for x86 assembly language programming:-

    www.hugi.de [www.hugi.de] Windows based (linux ver on its way) assembly diskmag with plenty of articles on the advantages and disadvantages of ASM vs HLL

    www.x86.org [x86.org] loads of info about x86 programming

    www.cfxweb.net [cfxweb.net] Loads of articles on assembly programming and HLL too.

    Hope that clears a few things up *g*
  • by Anonymous Coward on Thursday February 15, 2001 @02:58AM (#430927)
    Bash (bæsj) means poop in Norwegian!
  • by Rain ( 5189 ) <slashdot@t. t h e m u ffin.net> on Thursday February 15, 2001 @06: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 @03: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?
  • by _Gnubie_ ( 14485 ) on Thursday February 15, 2001 @01: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 @04: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.
  • by UberLame ( 249268 ) on Thursday February 15, 2001 @07: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.
  • by Soft ( 266615 ) on Thursday February 15, 2001 @01: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 @05: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 @01:37AM (#430935)
    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....


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

    the next crazy step

    bash in assembler.

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

    ---
    recursion, n: see recursion.

  • ...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".

    --
  • by multipartmixed ( 163409 ) on Thursday February 15, 2001 @05:35AM (#430938) Homepage
    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.

    --
  • by jawtheshark ( 198669 ) <{moc.krahsehtwaj} {ta} {todhsals}> on Thursday February 15, 2001 @01:45AM (#430939) Homepage Journal
    Now we just need an assembler written in perl! Everyone knows that will be the more elegant code ;-)

If all else fails, lower your standards.

Working...