Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 10, 2016, 07:23:12 19:23


Login with username, password and session length


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

Posts: 102

Thank You
-Given: 35
-Receive: 159


« on: January 06, 2013, 12:00:33 12: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
***
 Muted
Offline Offline

Posts: 132

Thank You
-Given: 29
-Receive: 198


« Reply #1 on: January 06, 2013, 12:43:03 12: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
*****
Offline Offline

Posts: 556

Thank You
-Given: 156
-Receive: 354


« Reply #2 on: January 06, 2013, 04:26:25 16: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