Forum breadcrumbs - You are here:ForumGeneral: HelpDoes anyone know C and GCBASIC?
You need to log in to create posts and topics.

Does anyone know C and GCBASIC?

PreviousPage 2 of 3Next
As we can see, it does the same thing on another version. It looks like it's a bug. Couldn't we fix it so that it still works?

It's very confusing for the user.
 

Maybe it doesn't work as you expect, the idea is that you uderstand how it actually works.

Variables are found during compilation, if you run the simulation without compiling the location of the variables is unknown.
That also depends on the compiler, finding variables might work better for some compilers and worse for others.

Version 1.0.0 is a bit more "clunky", 1.1.0 works better.

Here's what i do:
choose Sender as Main MCU
open Sender.gcb
compile
import
open mcu monitor : wkey(8), key(16), i ,j are empty


run
i, j are found but not wkey(8) and key(16)

Same with Simulide 1.1.0 :

Here is what you can do instead:

1- Open circuit and gcb file.
2- Declare i and j individually: https://simulide.com/p/forum/topic/does-anyone-know-c-and-gcbasic/#postid-856
3- In Mcu Montor use key and wkey: https://simulide.com/p/forum/topic/does-anyone-know-c-and-gcbasic/#postid-856
But that is only useful to know the address.
To watch arrays values use the RAM table.
4- Upload.

 

Thank you very much I can finally get it to work.
But wouldn't it be possible to simplify the user experience for future versions?
 
for example, as soon as you open the MCU monitor:
 
Alert message that says "alert compilation did not take place, the location of the variables are not known"?
Or "The compilation didn't happen, do you want to compile and upload? (don't forget to choose de main MCU before)"
 
And for variables to be added declare individually, can't this be fixed as a bug and the user doesn't have to do it anymore?
 
Because it's just a very small thing but I guess if these two problems exist, there must be plenty of other things of the same type that are going to be a problem for the user?

Hello,

I've another question :

if i do:

wkey(5)=0xf7f8

the variable is in memory :

but if i do :

i=5

wkey(i)=0xf7f8

the variable is not in memory, why ?

but if i do :

i=5
wkey(i)=0xf7f8

the variable is not in memory, why ?

That is weird...
This could be an actual bug, I will have a look.

 

If this is a bug, this could explain why this doesn't work :

key = 0xD4,0xB7,0xE3,0xE8,0x88,0x4C,0x3C,0x54,0x95,0x3F,0x71,0xAA,0x42,0x75,0xBA,0xD1

same kind of bug (increment problem)

 

Hello,

Do you find the bug ?

Sorry, yes it is fixed.

PreviousPage 2 of 3Next