SFR definitions and 'system' keyword

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

SFR definitions and 'system' keyword

Post by Jerry Messina » Tue Mar 24, 2015 4:45 pm

In the device files SFR's are defined with the 'system' attribute, ie

Code: Select all

public system MAADR5 as byte absolute $0E80
What would be the difference if it was just declared as a regular byte as

Code: Select all

public dim MAADR5 as byte absolute $0E80
Does the compiler treat 'system' as special somehow?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: SFR definitions and 'system' keyword

Post by David Barker » Tue Mar 24, 2015 4:56 pm

If memory serves the system keyword isn't used by the compiler any more (port is though). However, I have maintained using system to declare SFR's for all system modules.

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: SFR definitions and 'system' keyword

Post by Jerry Messina » Tue Mar 24, 2015 5:12 pm

Is there some special meaning attached to EDATA?

If I try

Code: Select all

public system EDATA as byte absolute $0F61
when I go to use it I get 'Error(47): Comma missing'

If I declare it w/out 'system' it works.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: SFR definitions and 'system' keyword

Post by David Barker » Tue Mar 24, 2015 5:21 pm

Yes, that is an anomaly. The parser will not name mangle "system" variables (so this contradicts my previous post, system is treated differently!). The code generator is falling over on the non mangled EDATA. What is it you are trying to do?

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: SFR definitions and 'system' keyword

Post by Jerry Messina » Tue Mar 24, 2015 5:45 pm

The J60 Ethernet chips have a SFR named EDATA @ $0F61 and the device files are getting it wrong.

It seems I already addressed this in the updated SystemConvert app I sent you a link to a few weeks ago. I just forgot to copy over the new device files to this machine.

According to the sysgen source comments, EDATA needs special treatment. I forgot about that.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: SFR definitions and 'system' keyword

Post by David Barker » Tue Mar 24, 2015 7:41 pm

Yes, it typically gets called EEDATA I think

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: SFR definitions and 'system' keyword

Post by Jerry Messina » Tue Mar 24, 2015 8:50 pm

Gotcha. So since it uses EDATA instead of EEDATA, trying to declare 'system EDATA' for the J60 register name was an issue. Seems to work fine just declaring EDATA as 'public dim', so that's no problem.

This wouldn't have been an issue if I could have remembered that I already went down this road a month ago!

Post Reply