From: Murray L. <mur...@pe...> - 2002-03-17 23:55:46
|
Are the SFRs not memory mapped as well? I've used assemblers that don't know about many SFRs and have accessed them simply through their memory locations specified in the MCU documentation. If space wasn't a problem you could define the SFR addresses in a table and step through that table, addressing the SFRs indirectly. Just a thought. I haven't actually tried it. Regards Murray At 10:16 16/03/02 -0600, Karl Bongers wrote: >Hi Lanius, > >The instructions used to access SFR's >are embedded in the instruction, there is >no way to do it indirectly. So you cannot >make a construct that acts as a pointer to SFR. > >You can do it with self-modifying code if you >are running from RAM, but it's not too often >you run from RAM with MCS51. > >So probably a big case statement is your best >bet, or the equivalent optimized in asm. > >Karl. > > >Lanius wrote: > >>Hi, >> >>i want to display all *SFR-Register in a loop like: >> >>for(FSR=firstSFR;SFR<=lastFSR; FSR++) >>{ >> x= *FSR; >> putChar(x); >>} >> >>how to? >> >> >>bis denn... >>Rainer Stamm >> >> >>_______________________________________________ >>Sdcc-user mailing list >>Sdc...@li... >>https://lists.sourceforge.net/lists/listinfo/sdcc-user >> > > > > >_______________________________________________ >Sdcc-user mailing list >Sdc...@li... >https://lists.sourceforge.net/lists/listinfo/sdcc-user |