problem with picbasic pro

Status
Not open for further replies.

veiledcavalier

Member level 5
Joined
Feb 26, 2006
Messages
92
Helped
7
Reputation
12
Reaction score
4
Trophy points
1,288
Location
Alexandria-EGYPT
Activity points
1,906
picbasic pro problem

elslam alykom,

i am working in a project using pic 16f628 and the pic basic compiler,

i have a problem with the data coming from PORTB4,5,6,7 ,in assembly
i used to make MASKING :
Code:
                                       num1 equ oxoc
                                       .
                                       .
                                       .
                                       SWAPF PORTB,w
                                       ANDLW 0x0F
                                       MOVWF num1

the function SWAPF ins. is like that:
        befor: 0000 1111
                       \ /        
                       / \
        after : 1111 0000

i don't find an instruction in the pic basic pro to do that fun.

if any one knows how plz post

thanks in advance.
 

hi,

You could not swaf the port value. for that you have to do

1. move the port value into some register
2. swapf the register value
3. mask the value which one is you want
4. then store into new register otherwise you may use the same register for your furthur progress.

try this code,

num1 equ oxoc
num2 equ 0X0d
.
.
.
MOVF PORTB,w
MOVWF num1
SWAPF num1
MOVF num1,w
MOVWF num2

BY

arsamy.
 

I don't mean that i want an assembly code i know it good ,i wrote some of it as a guide what i want is the BASIC code for this

thanks alot
 

Hi veiledcavalier
you want code in Basic or hex?
what is your data that is problem?
if you want basic please send that part of your assembly.
good luck.
 

I believe he is asking for an equivalent instruction in "Basic".

I don't believe there is in PBP

You can use the assembly code in the "basic" program by using the "@" symbol.

Enigma460
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…