Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Libary in Bascom-avr

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
Ned

Bascom Member



Joined: 29 Jul 2004
Posts: 15
Location: New Zealand

newzealand.gif
PostPosted: Sat Aug 21, 2004 11:24 pm    Post subject: Libary in Bascom-avr Reply with quote

Hi,
Can someone either confirm or correct me on the following ?
If I have a piece of code in assembly can I use it as a component of a libary to be called when required by my main Bascom program.

If this is so does anyone know if there is any software to port a snippet of assembly code written for a 8051 to an AVR

Thanks,
Ned
Back to top
View user's profile
rprosser

Bascom Member



Joined: 17 Jun 2004
Posts: 8
Location: Christchurch NZ

newzealand.gif
PostPosted: Sun Aug 22, 2004 10:23 am    Post subject: Reply with quote

Writing your own library function is not too hard. The help file gives a few examples or let me know & I'll try and sort out an example.

I don't know of any software to port Assembly 8051 to Assembly AVR.

If there is something I'd also be interested - or, more correctly, I'm loooking more at going the other way!

Richard P
Back to top
View user's profile
Ned

Bascom Member



Joined: 29 Jul 2004
Posts: 15
Location: New Zealand

newzealand.gif
PostPosted: Thu Aug 26, 2004 10:09 pm    Post subject: Libary in Bascom AVR Reply with quote

Hi Richard.
Not really the answer I was looking for but many thanks anyway for your response. I may try to make up a table of the commands etc of both so it may make it easier to go through the code and just sustitute where required. Who knows it may work. Smile

Regards,
Ned
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6198
Location: Holland

blank.gif
PostPosted: Tue Aug 31, 2004 10:14 pm    Post subject: Reply with quote

Hi,

A library is not a simple snippet of AVR asm.
It just is the equivalent of a SUB/FUNCTION that is called by the compiler depending on the statements you use.

Have a look at the libdemo.bas sample and the mylib.lib file.
The advantage of lib is that you can override existing functions by writing your own lib.

for example look at the lcd replacement libs. they result in smaller code as they are fixed for certain pins and not as versatile as the default lib.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum