number of insructions in microcontroller

Thread Starter

abhi.creations

Joined Sep 10, 2007
9
hi all,
can any person provide me information about the number of
instructions in different microcontrollers.
i need to know some microcontroller (PIC, ARM etc.) having approx 16 to 20 instructions.
actually i have to choose a low instructions microcontroller
for designing its assembler. its urgent for me.

please suggest me and provide some support to me.
i will ne very thankful to all of you.
 

HarveyH42

Joined Jul 22, 2007
426
Regular 8-bit PICs have 36 instructions.
AVR have around 130 instructions (what I use).

I chose the AVR, mostly because it had such a rich instruction set and I was looking to program in assembler. Also, PIC has just one working register, AVR has 32.
 

Papabravo

Joined Feb 24, 2006
13,933
Not much. I do not think that the number of instructions has much correlation to the complexity of an assembler. IMHO the most complex aspect of an assembler is creating, managing, and sorting the symbol table. Any damn fool can implement a linear search and watch the performance plumet exponentially as the number of symbols grows linearly.

Another complex part is generating a useful assembly listing with appropriate diagnostics.

The opcodes are contained in a pre-sorted list. Matching them to the input text is very nearly trivial.

I've written several assemblers and I don't know where this quaint notion comes from.
 

Thread Starter

abhi.creations

Joined Sep 10, 2007
9
hi thanx papabravo ,
can you provide me any ebook link or any good pdf for understanding the concept of assembler design and coding.
one more thing is that i have to write the code in c language.

i am thinking to choose simple pic microcontroller.
 

beenthere

Joined Apr 20, 2004
15,819
This site might be a good place to start - http://webster.cs.ucr.edu/AsmTools/RollYourOwn/.

One thing to think about - if you are going to the trouble of writing an assembler, why not choose a microprocessor that has some useful features? Instead of the smallest instruction set, find one that might be interesting to design some projects with afte you get the assembler written.
 

hgmjr

Joined Jan 28, 2005
9,029
beenthere,

It surely must be true that great minds think alike.

What are the odds of both of us posting a link to the same site within the same minute?

And a cool site at that.

hgmjr
 

Thread Starter

abhi.creations

Joined Sep 10, 2007
9
thats fine,
but the site you have given is about programming from assembly languages.

what i need is to design my own assembler. and i have to code that design in c.
finally what i will be having in output will be an assembler.
 

hgmjr

Joined Jan 28, 2005
9,029
You should be able to apply the techniques presented at the website independent of the language you elect to use to implement the assembler.

Writing an assembler is a tedious and involved process regardless of the language used and not to be undertaken lightly. Parsing the source code syntax alone is a significant challenge. Add to that the need for syntax and runtime error checking and you definitely have your work cut out for you.

Good Luck,
hgmjr
 

Thread Starter

abhi.creations

Joined Sep 10, 2007
9
hi
i have created a new Thread as " assembler design and coding" because the name of this thread is not appropriate for assembler design. so most of the person who can help in this problem may not be having a look in this thread.
thanx
 

beenthere

Joined Apr 20, 2004
15,819
Don't forget the venerable Table Assembler. I think TASM is still around.

To hgmjr - as long as you don't have to sweat all the bells and whistles, GW Basic should be able to do an assembler. I wrote an extension for the Rockwell 65C02 instruction subset and made some improvements to an assembler written in Applesoft Basic about 20-some years ago. Basic makes parsing text inputs a snap.
 
Top