Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How many times can I use "retlw" in a Assembly table?

Status
Not open for further replies.

newbie111

Member level 2
Joined
Nov 29, 2009
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
h.k
Activity points
1,609
Table ADDWF PCL, f ;data table for bit pattern


to make a table in assembly


is the limit ff times?

Thanks
 

Re: assembly table

For example

Code:
 Table	ADDWF   PCL, f			;data table for bit pattern
	retlw	b'1001'
        retlw   b'0110'
       retlw  b'1001'
       retlw b'0110'
retlw	b'1001'
        retlw   b'0110'
       retlw  b'1001'
       retlw b'0110'
      retlw b'0001'
       retlw b'0010'
       retlw b'0100'

I just know to know how many times i can use "retlw" in a table.( I have used 11 times)

Thanks

Added after 33 seconds:

I just WANT to know*******
 

Re: assembly table

Hi,

To simply answer your question, Yes, FF is the max table size.

For your current work there should be no problem creating small tables like that.

However when using large tables other things come into play and must be accounted for, but unfortunately lookup tables are not readily / clearly documented

If you go to this forum and search for 'tables' and look though some of the posts you will find some good info
https://www.microchip.com/forums/tt.aspx?forumid=11
It is a great site for good info and they readily help genuine questioners like yourself.

Also have a look at this manual which has some extra info not always detailed in the datasheets
https://ww1.microchip.com/downloads/en/devicedoc/33023a.pdf

If you do get chance to change from the 16F chips to the 18F range you will find virutally all these Banking, Paging , PCL problems that you so easily get with the 16Fs are a thing of the past - just that the 16F has been so popular with many examples out there , but people seem lost to the fact of how good the 18Fs are.
The assembler code is virtually the same but with a good few new instructions to make things even easier.
You can get the small 18F1320 or the 40pin 18F4520/4620 for much the same price as their 16F equivalents.
 

    newbie111

    Points: 2
    Helpful Answer Positive Rating
Re: assembly table

Do be careful where you place the table. If it spans a page boundary the page selection bits will not be updated so you will 'wrap' back to the beginning of the page where the table starts.

You can partially get around this by placing the table at the start of a page, for example:

org 0x200
mytable addwf PCL,w

but bear in mind that the 'addwf' instruction is also in the page so you have one less space to place data, it's maximum length becomes 0xFE.

As wp100 states, the 18F series uses a more linear addressing system so you do not have this limitation.

Brian.
 

    newbie111

    Points: 2
    Helpful Answer Positive Rating
Re: assembly table

Great answers from you two.


All clear!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top