Jump to content

Register by name


robinfawell

Recommended Posts

I keep getting the following warning after compiling.

Warning; need to allocate new register by name. 

I have had this warning in the past and have ignored it.  Can anyone help?

Regards Robin

There is a sequel to this warning.  In the past I ignored Compiler Warnings.  In this case the for loop fails to work for some reason. The code looks OK. 

Link to comment
Share on other sites

It has happened again. This time I know the circumstances.

I am trying to minimise my code by introducing a for loop. (see below).  As soon as I compiled I received the following warning.

There is a sequel to this warning.  In the past I ignored Compiler Warnings.  In this case the for loop fails to work for some reason. The code looks OK. 

Robin

Microsoft Windows XP [Version 5.1.2600]

© Copyright 1985-2001 Microsoft Corp.

C:\C_Stops>make

Makefile generated.

Makefile.bat generated.

Assembling MIOS SDCC wrapper

==========================================================================

Compiling main.c

Processor: 18F452

pic16_allocRegByName:963 symbol name _ReadStoredValues_d_1_1    regop= 00D471E8

gen.c:1890: WARNING: need to allocate new register by name -> _ReadStoredValues_

d_1_1

==========================================================================

Compiling pic18f452.c

Processor: 18F452

==========================================================================

Linking project

==========================================================================

Converting to project.syx

Block 003000-0033FF allocated - Checksum: 2D

Block 003400-0037FF allocated - Checksum: 26

Block 003800-003BFF allocated - Checksum: 09

Block 003C00-003FFF allocated - Checksum: 7D

Block 004000-0043FF allocated - Checksum: 09

Block 004400-0047FF allocated - Checksum: 34

Block 004800-004BFF allocated - Checksum: 60

==========================================================================

SUCCESS!

C:\C_Stops>

/////////////////////////////////////////////////////////////////////

void ReadStoredValues( unsigned char pin) //__wparam

/////////////////////////////////////////////////////////////////////

{

unsigned char memorised_stored_pin;

unsigned char d;//to increment EEprom reads

q = ((pin-1)<< 5)  + 10;//determines EEProm address depending on Memory pin number.

for(d<=1; d>=13;d++)

SendDump(MIOS_EEPROM_Read(q + d));

//SendDump(MIOS_EEPROM_Read(q + 1));

MemorisedStopsSetLed (8, 14, 15, MIOS_EEPROM_Read(q + 1));//pedal stops

//SendDump(MIOS_EEPROM_Read(q + 2));

MemorisedStopsSetLed (24, 24, 25, MIOS_EEPROM_Read(q + 2));//tremelo strength

//SendDump(MIOS_EEPROM_Read(q + 3));

Link to comment
Share on other sites

robinfawell

It's good that you were able to discover the error on your own.

I've learned to compiled after just about any change, so I can correct a problem while it's still fresh in my memory.

I wouldn't ignore any compiler warnings... even if the code looks to be working fine. Jumping on any warning as soon as you see it will save you a lot of time and grief later on.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...