LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-28-2014, 03:13 PM   #1
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Lexical Analyzer for PIC Program


I'm modifying an open source PIC program in assembly language that takes user input for parameter control. The input parser is primitive and vulnerable to crashes from input overload. I did a few minutes of searches for lexical analysis but couldn't find anything related to this. Are there any lexical analyzers out there that target PIC assembly, or do I need to do this with lex/flex and create a C module? I don't have any experience with C in a PIC environment, and I'm not so sure this would be a good fit due to the way the variables are declared. I could be wrong.
 
Old 05-29-2014, 06:21 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,195

Rep: Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284
Most likely the crash is due to some simple off-by-one or out-of-bounds error. If you want to post the offending code there are likely some people here who can help. flex might be overkill for PIC. Last I checked space was kind of tight.
 
Old 05-29-2014, 09:43 AM   #3
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Original Poster
Rep: Reputation: 141Reputation: 141
I've been examining the code some more, and I think I found the problem. In the interrupt section, if the end of buffer is reached, he stops putting new chars in the buffer. In the input consumption routine if the end of line character is never reached no action is taken. I'm not sure what causes the freeze of the heartbeat LED, but I think the big culprit is solved.

I've been looking at this code for a long time, and I've been avoiding this particular problem because I wasn't able to reliably reproduce it until I got lucky yesterday. It will be good to get rid of it. Still, I think the idea of a lex that produces code for PICs is a useful one.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Analyzer/Syslog Analyzer fbexec Linux - Software 8 08-23-2012 09:47 AM
Linking PIC and non-PIC code...into a shared library debuser123 Programming 2 03-27-2011 09:50 PM
squid-log analyzer OR a good bandwidth analyzer isaaclw Linux - Server 5 06-16-2010 04:17 AM
efficient occurrence counting or alternative lexical analysis ta0kira Programming 4 02-06-2009 02:05 PM
designing C Compiler in linux.lexical analysis is done through lex and yacc tool aashish Linux - Software 2 09-25-2008 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration