On Fri, Oct 26, 2007 at 01:09:11AM -0700, Ajay Ramesh wrote:

> Can anyone help do this with gcc. 
> 
> [b]Assume the design includes a Program Counter, Accumulator, Arithmetic 
> Logic Unit and Instruction Register. Let ?addr? denote the address (field) 
> and ?mem [addr]? denotes contents of memory location ?addr?.
> 
> Note 1:  The Memory is external to the Processor
> Note 2:  Assume memory is 4K by 16 bits
>      
>       Designing an  Instruction Set to do the following:
> 
> 1.    Load Accumulator from memory location ?addr?
> 2.    Store Contents of  Accumulator to memory location ?addr?
> 3.    Add the Contents of Accumulator and memory location ?addr? and store in 
> Accumulator
> 4.    Subtract the Contents of  memory location ?addr? from  Accumulator and 
> store in Accumulator
> 5.    Load the Program Counter from memory location ?addr?
> 6.    Set the Accumulator to  ?addr? if accumulator >= zero
> 7.    Set the Accumulator to  ?addr? if accumulator not equal to zero
> 8.    Stop the Processor[/b]

Yes, I know how to do this.  No, I'm not going to do it for you
(school project?) as it's a major undertaking if you mean that you
need to write a compiler backend for it.  I suggest you start by
looking at the existing machine description files that gcc ships with;
a simple one like Hitachi SuperH would be a good place to start.
You'll also need to read and understand the 'gccint' infodocs that are
shipped with Solaris.

Good luck!

-- 
Keith M Wesolowski              "Sir, we're surrounded!" 
FishWorks                       "Excellent; we can attack in any direction!" 
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to