Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Writting Compact Tables

Status
Not open for further replies.

Suraj143

Active Member
Can somebody tell me a way to write a table in a more compact way.

I use the below method it uses lots of lines in the code.I need C style written tables.I use assembly.

Code:
Table	addwf	PCL,F
	retlw	b'00000000'
	retlw	b'00000001'
	retlw	b'00000010'
	retlw	b'00000100'
	retlw	b'00001000'
 
Which Chip? The 16F ones with writable flash can hold two 7 bit values per location and 18F can hold two 8 bit values per location.

Mike.
 
The 16F628A doesn't have writable flash. If you switch to the 16F88 then you will be able to write compact tables. It also has twice as much memory so you could hold 4 times more messages.

Edit, if it's just the number of lines your woried about then you can do,
Code:
    dt    b'00000000',b'00000001',b'00000010',b'00000100',b'00001000'
    dt    "Hello World!",0

Mike.
 
Last edited:
Hi mike that's what I'm thinking to write

can I add more elements to each line like 8 values??

Code:
Table	dt	.1,.2,.3,.4,.5,.6,.7,.8		; 8 elements
	dt	.8,.7,.6,.5,.4,.3,.2,.1		; //
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top