Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Aliases on array

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

Bascom Member



Joined: 27 Jan 2005
Posts: 46

france.gif
PostPosted: Fri Jul 26, 2019 7:29 am    Post subject: Aliases on array Reply with quote

Hello,
Is the following syntax is ok ?


newname alias array(1,2).7

newname is a single bit.
array is declared before.

Does any one has test this ?

Thank you.
Denis

(BASCOM-AVR version : 2.0.7.8 , Latest : 2.0.8.1 )
Back to top
View user's profile
six1

Bascom Expert



Joined: 27 Feb 2009
Posts: 553

germany.gif
PostPosted: Fri Jul 26, 2019 1:13 pm    Post subject: Reply with quote

i wonder, if it is too much work for you, to assemble little test programm...



Code:

$regfile = "m8def.dat"                                      ' specify the used micro
$hwstack = 32                                               ' default use 32 for the hardware stack
$swstack = 10                                               ' default use 10 for the SW stack
$framesize = 40                                             ' default use 40 for the frame space

$crystal = 4000000                                          ' used crystal frequency


$sim

dim b_array(2,2) as byte

b_array(1,1) = &B_1100_1010

b_array_1_1_bit_0 alias b_array(1,1).0
b_array_1_1_bit_1 alias b_array(1,1).1
b_array_1_1_bit_2 alias b_array(1,1).2
b_array_1_1_bit_3 alias b_array(1,1).3
b_array_1_1_bit_4 alias b_array(1,1).4
b_array_1_1_bit_5 alias b_array(1,1).5
b_array_1_1_bit_6 alias b_array(1,1).6
b_array_1_1_bit_7 alias b_array(1,1).7

print "Bit 0: ";b_array_1_1_bit_0
print "Bit 1: ";b_array_1_1_bit_1
print "Bit 2: ";b_array_1_1_bit_2
print "Bit 3: ";b_array_1_1_bit_3
print "Bit 4: ";b_array_1_1_bit_4
print "Bit 5: ";b_array_1_1_bit_5
print "Bit 6: ";b_array_1_1_bit_6
print "Bit 7: ";b_array_1_1_bit_7

end
 


Bit 0: 0
Bit 1: 1
Bit 2: 0
Bit 3: 1
Bit 4: 0
Bit 5: 0
Bit 6: 1
Bit 7: 1

_________________
For technical reasons, the signature is on the back of this message.
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1197
Location: France

france.gif
PostPosted: Fri Jul 26, 2019 2:03 pm    Post subject: Reply with quote

Hi Denis,
Could you please explain and post your problem?
What do you want to do?

With bascom you have a tool called SIMULATOR, have you tried it?

jp Wink

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
moreau

Bascom Member



Joined: 27 Jan 2005
Posts: 46

france.gif
PostPosted: Wed Jul 31, 2019 8:19 am    Post subject: Aliases on array Reply with quote

Hello,
Thanks for the answer.
To answer why i have not testing a short code, i'm not at home for testing and it was a simple question. Very thanks for answer. I can continue to investigate without my computer to test..

Subject closed, answer is noted 20/20.

Best regards.
D.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR 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