gnupic: gpsim's gui
Subject:
Re: gpsim's gui
From:
Craig Franklin ####@####.####
Date:
16 Oct 2004 06:41:36 +0100
Message-Id: <41706E7C.704@users.sourceforge.net>
Vangelis Rokas wrote:
>
> On Wed, 13 Oct 2004, Craig Franklin wrote:
>
>> .direct "a", "PORTC==0"
>>
>> or
>>
>> .direct 0x60 + 1, "PORTC==0"
>>
>> or
>>
>> .assert "PORTC==0"
>
>
> Any ideas for integrating with C language?
>
> writing:
>
> assert(PORTC==0);
>
> in pic16 port, would emit a directive like:
>
> .direct "a", "PORTC==0"
>
> but symbol PORTC isn't known as PORTC but as _PORTC. I guess gpsim
> will emit
> an error there.
>
How are you defining _PORTC in the assembly? An EQU?
> I see 2 solutions here:
>
> 1. The easy way
> Declare assert as macro which calls an _assrt function which
> emits:
> .assert "a", "0"
>
The definition in the spec says to assert when the expression is true.
So you want to do this:
.assert "1"
You shouldn't need a function. If you can, use a macro. There is no
code penalty for the macro and you won't have to call the function.
>
> 2. The hard way
> To let gpsim know about symbols like PORTC via the def directive.
>
> Is this possible?
>
Yes. Although the symbol table would get full of a lot of garbage. One
set of defs for each object file.
> I guess [2] needs a lot of work, so I'll stick [1] for the time being
>
>
Give me a little time to work on it.
> regards,
> Vangelis
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
>
>