This list is for discussion of the design and implementation of field-programmable gate array based processors and integrated systems. It is also for discussion and community support of the XSOC Project (see http://www.fpgacpu.org/xsoc).
|
Hi, I designed a minimal cpu for FPGA and Iam testing it now. I found it really difficult for writing programmes in machine language. I would be thankful if some one here cold give some idea on writing an assembler or compiler. Thanks, Frang. |
|
|
|
> I would be thankful if some one here cold give some idea > on writing an assembler or compiler. > A simple assembler written in a good language (like Java with built in StreamTokenizer) could be done in a few hours (and only with few lines). If you're interested I can send you an example Martin |
|
> I designed a minimal cpu for FPGA and Iam testing it now. > I found it really difficult for writing programmes in machine language. > > I would be thankful if some one here cold give some idea > on writing an assembler or compiler. Just try SMAL. Its a configurable Assembler. http://www.cs.uiowa.edu/~jones/cross/smal32/ http://www.cs.uiowa.edu/~jones/cross/ |
|
On Wed, 20 Mar 2002, Frangline wrote: > I would be thankful if some one here cold give some idea > on writing an assembler or compiler. When I did something similar, I hacked together a very simple assembler in Perl. It just converted the nmenonics to machine language bits I could load into memory. No fancy stuff (variables? negative numbers? hah! :-), but it did made coding easier. If you want to have a compiler, a better assembler would be advisable, I think. If you just want to write small programs, spending a little time with your favorite string processing language is probably easiest. jake |
|
|
|
For a retargetable ANSII C compiler, check out LCC at http://www.cs.princeton.edu/software/lcc. Also, check out XSOC and what Jan has done with LCC at http://www.fpgacpu.org if you haven't already done so. GCC is also an option but will be harder to port. Hope this helps. Veronica -----Original Message----- From: Frangline <> To: <> Date: 20 March 2002 16:50 Subject: [fpga-cpu] Help in compiler design. >Hi, >I designed a minimal cpu for FPGA and Iam testing it now. >I found it really difficult for writing programmes in machine language. > >I would be thankful if some one here cold give some idea >on writing an assembler or compiler. > >Thanks, >Frang. >To post a message, send it to: >To unsubscribe, send a blank message to: |
|
> When I did something similar, I hacked together a very simple assembler > in Perl. It just converted the nmenonics to machine language bits I > could load into memory. No fancy stuff (variables? negative numbers? > hah! :-), but it did made coding easier. I wrote an assembler in Perl for the HP-21xx minicomputers. It's complete in the sense that I think it supports all of the assembly language features that HP's own assembler did (including floating point constants), but it's not too fancy. It is GPLd and may be downloaded from: http://www.brouhaha.com/~eric/retrocomputing/hp/21xx/asm21.zip The 21xx has some "microcoded" instructions like the early DEC machines (most popularly, the PDP-8). This means that individual bits or groups of bits in some instruction formats have independent meanings, like horizontal microcode in a "conventional" microcoded machine. So my assembler had to go to a bit of trouble to allow combining these "microinstructions" and verifying that incompatible ones aren't merged. All of that code can be deleted if one wants to assemble for a more conventional architecture. Eric |