Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

XOR function not working ?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-8051
View previous topic :: View next topic  
Author Message
RAWWAR

Bascom Member



Joined: 26 Nov 2014
Posts: 17

PostPosted: Sun Nov 13, 2016 12:11 pm    Post subject: XOR function not working ? Reply with quote

Hi,
I was just playing with bascom, using the following statements:
Dim A5 As Byte
Dim B5 As Byte
Dim C5 As Byte
A5 = 03
B5 = 55
C5 = A5 Or &HFF
C5 = A5 And &H01
C5 = Not C5
C5 = Not A5
C5 = Xor B5
C5 = Xor &H55
So: trying the AND, OR, NOT and XOR functions.
It works. however, the last two statements result in an error:
Error 10: wrong type [BIT, BYTE, INTEGER etc....]
Any idea what I am doing wrong ?
Rob
Back to top
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1571
Location: Basel, Switzerland

switzerland.gif
PostPosted: Sun Nov 13, 2016 12:57 pm    Post subject: Reply with quote

Hi,

OR/XOR require two values

C5 = A5 Xor B5
C5 = A5 Xor &H55

Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
RAWWAR

Bascom Member



Joined: 26 Nov 2014
Posts: 17

PostPosted: Sun Nov 13, 2016 6:33 pm    Post subject: Reply with quote

Hi,
yes of course it needs 2 parameters.... How could I be so st....
Thanks,
Rob
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-8051 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum