From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,c6f50259b82952b7,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 2001-08-29 19:55:23 PST Return-Path: Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!cola.stump.algebra.com!robomod!not-for-mail X-COLA-Policy: http://stump.algebra.com/~cola X-COLA-Info-1: Send submissions to cola@stump.algebra.com X-COLA-Info-2: Send complaints to cola-admin@stump.algebra.com X-Comment: moderators do not necessarily agree or disagree with this article. X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) Date: Wed, 29 Aug 2001 21:51:11 CST From: Rick Hohensee Message-ID: <200108290542.BAA14425@smarty.smart.net> Subject: osimpa x86 compembler in Bash MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Newsgroups: comp.os.linux.announce X-Auth: PGPMoose V1.1 PGP comp.os.linux.announce iQBVAwUAO42qHyFvAtx2nXvNAQG6oAH/VgnfTzbDAH7NfivUhqEjNDXpzlRVh2MC Abc7GPOofoxeNoM1zO5/87NYhR2xwZdDTmT9vdtlzxcK3piPREZDjg== =U5n2 Xref: archiver1.google.com comp.os.linux.announce:1204 osimpa is an assembler for Intel 80386 processors and subsequent, written entirely in the GNU Bash command interpreter shell. The predecessor of osimpa was shasm, as seen on Slashdot. osimpa is much cleaned up, can create useful Linux ELF executables, and has various HLL-like extensions derived from Forth and C and some programmer convenience commands. Osimpa uses it's own names for x86 opcodes, which vary from stuff like "=" instead of "MOV" for terseness for common instructions, to the likes of loadmachinestatusword for little-used instructions that are best kept self-explanatory. The syntax of osimpa is also unique, and has some faint resemblances to Forth, while doing whatever is expedient in the shell. There is no "lexer"; all tokens are whitespace-delimited. Two-operand instructions use one of "to", "from" or "with" to delimit and order the operands. The size of an operand is assumed to be the current cellsize, or can be explicitly set to byte with the "byte" keyword. Keywords are also available for the x86 size-change prefixes. osimpa is about 2 orders of magnitude slower than a regular stand-alone assembler, or about one order of magnitude slower than a compiler. Interactivity is extremely high, however. You can change a keyword in seconds, for example, or you can alias it in your source, since the source file of a program written in osimpa is a Bash script. You can assemble a program one instruction at a time if you like. Each opcode has it's own help, e.g. ..................................... = h Intel MOV catch-all. copy. The most prevalent insn. The only access to special registers. The fast mem<->A forms may be A= and =A by the time you read this. ..................................... And of course, since osimpa is an assembler, the performance of the resulting program is usually quite good. This is similar to unix "cat" in osimpa... ............................................................. ELF pull @ $argc pull @ $programname -test 1 with @ $argc when zero help -test 2 with @ $argc when not zero per_filename = @ SP to B -test byte 104 with byte @ B when not zero per_filename -test byte 0 with byte @ 1 + B when zero help L per_filename 1- @ $argc when zero ciao pull B zero C Linux $open flag A when sign problem = A to BP L per_read = BP to B = $buffer to C = 4096 to D Linux $read flag A when zero per_filename = 1 to B # C is still good from the above = A to D Linux $write jump per_read L problem print $ouch Linux $exit L help print $helptext Linux $exit L ciao = A to B # wierd bug, this is a scab. = A to B Linux $exit text ouch <