Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 28, 2024, 07:05:29 19:05


Login with username, password and session length


Pages: [1]
Print
Author Topic: Simple IF THEN ELSE and SELECT CASE for PIC assember  (Read 4409 times)
0 Members and 1 Guest are viewing this topic.
DTiziano
Active Member
***
Offline Offline

Posts: 104

Thank You
-Given: 41
-Receive: 168


« on: January 06, 2013, 11:00:33 11:00 »

Simple IF THEN ELSE and SELECT CASE macros to be used in assember for PIC micros.
The Select case macros I found on internet.
I put together because are a complement to the IF.

Can be used when the equivalent PICbasic function is not available (on interrupt for example).

May be this helps somebody.

Best regards.
Logged
Okada
Active Member
***
 Warned
Offline Offline

Posts: 132

Thank You
-Given: 29
-Receive: 188


« Reply #1 on: January 06, 2013, 11:43:03 11:43 »

I havent used basic much but I have read in C/C++ How to Program book that switch/select case statement are slower compared to if...elseif statement.
Logged
hate
Hero Member
*****
 Warned
Offline Offline

Posts: 555

Thank You
-Given: 156
-Receive: 355


« Reply #2 on: January 06, 2013, 03:26:25 15:26 »

I can't imagine what may differ between a 'switch/case' and 'if/elseif' but there are ways to code a multiple case 'switch' in assembler with only 1 equality check for any case if the variable matches a certain pattern. Even some compiler like Keil uses this method to compile C code into 8051 assembler. It's definitely faster than 'if/elseif' in that case.

Regards...
Logged

Regards...
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC