BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Fri Jul 20, 2018 11:43 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to use assembly irq's in conjunction with BASIC
PostPosted: Wed Dec 23, 2009 4:31 pm 
Offline
Citizen

Joined: Wed Nov 25, 2009 3:10 pm
Posts: 7
REALLY need something in the new manual to explain how to use assembler subsystems (IRQ's mainly of course) along with BASIC.

tnx,

-mark


Top
 Profile  
 
 Post subject: Re: How to use assembly irq's in conjunction with BASIC
PostPosted: Mon Jan 11, 2010 8:02 am 
Offline
Master

Joined: Mon Aug 18, 2008 1:26 am
Posts: 799
Location: CA bay Area
You REALLY need to post this in the "New Syntax Manual" forum also, Mark! ;)
Even if we do discourage double-posting! :lol:
You're right, of course.
Take care.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: How to use assembly irq's in conjunction with BASIC
PostPosted: Thu Apr 29, 2010 7:59 pm 
Offline
New User

Joined: Thu Apr 29, 2010 7:33 pm
Posts: 2
The mbasic library contains some really useful routines that would be nice to call from inside of asm{} routines as well as irq, such as "dec" or "hex". It's a shame to need to rewrite these kinds of routines when they are already there, so to speak.

Assuming this is possible, can a list of user-callable subroutines be provided in the manual?

(I'm referring specifically to PIC assembly in this case)

_________________
brad


Top
 Profile  
 
 Post subject: Re: How to use assembly irq's in conjunction with BASIC
PostPosted: Fri Apr 30, 2010 6:10 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
As far as calling basic subroutines from asm you aren't going to be able to do it. The basic subroutines are very complex, especially the modifier subroutines. Trying to document that would be atlesat 5 times worse then getting the current manual finished. :)

If you are a REALLY good PICmicro asm coder you can look at the library files to see how those routines are called. But don't say I didn't warn you. :)

As for using asm interrupts on Atom/Nano processors, it's pretty simple.

Code:
ISRASM{
  ..asm interrupt handler code...
}

Thats pretty much it. You can use basic code to enable the specific interrupts.

Code:
;enable peripheral and global interrupts like this
PEIE = 1
GIE = 1


Also the ISRASM{} automatically addes the entry and exit handlers(eg it pushes W,STATUS and FSR registers on the stack and pops them back off when you finish and executes the retfie for you. All you have to do is add your specific interrupt handler code in the block.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO