Sign in

username or email:

password:



Not a member?
Forgot your Password?

Search 68hc12



Search tips

Subscribe to 68hc12



Ads

Discussion Groups

See Also

DSPFPGA

Discussion Groups | 68HC12 | CodeWarrior warning :A12004 Value is truncated ...

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).


So far in May, you have voted 0 times ou of a total of 22 votes by the community.
Please help us clean the archives from unuseful discussion threads by using the voting system! Details here.


Is this thread worth a thumbs up?

-1

CodeWarrior warning :A12004 Value is truncated ... - andr...@yahoo.co.uk - Apr 5 15:35:13 2012

I'm wondering why I'm getting lots of these warnings - (A12004) Value is truncated to two bytes. ??

They are all indicated with a JSR instruction.

The code compiles and runs - but since I moved some of the routines into paged memory, rather then the non paged area - I get these warnings.

Do I need to change a setting in CodeWarrior ? I know you have to be careful with JSR and paged memory - and I'm just calling a subroutine that is on the same page ?

Anyone any thoughts ??

Thanks

Rachel




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: CodeWarrior warning :A12004 Value is truncated ... - Gilbert Gagne - Apr 8 21:46:11 2012

Hi Andrew,
Your problem has to do with the addressing range of 68HC12 which is only 64=
K with 16 available bits. Whenever the specified address, using 16 bits, is=
less than $8000 or greater than $C000 it is meant to be unpaged memory. An=
y address between $8000 an $C000 must also specify what page you want. That=
's why CALL  ADDR,PAGE stacks the page number and RTC unstacks the page n=
umber to return execution to the proper place. Just using JSR  ADDR tries=
to execute code in the unpaged memory area using only 16 bit addresses. Pa=
ged subroutines can only be accessed with CALL  ADDR,PAGE  even if on t=
he same page.

I don't use Codewarrior so I don't know how to specify where to load your p=
aged subroutines. All my work is in assembly language and my paged subrouti=
nes are preceeded by ORG $8000 in the loading process.

My serial bootloader loads code at $80000 plus a specified offset. For exam=
ple, code for page $33 is assembled in the window $8000 - $BFFF and loaded =
into memory at $CC000 - $CFFFF using the command: FLOAD 4C000. $80000 plus =
offset $4C000 gives the desired absolute address $CC000.

Some similar procedure must be required for loading your paged code. Hopefu=
lly this is covered somewhere in the Codewarrior documentation.

________________________________
From: "a...@yahoo.co.uk"
To: 6...
Sent: Thursday, April 5, 2012 3:34 PM
Subject: [68HC12] CodeWarrior warning :A12004 Value is truncated ...

I'm wondering why I'm getting lots of these warnings - (A12004) Value is tr=
uncated to two bytes. ??

They are all indicated with a JSR instruction.

The code compiles and runs - but since I moved some of the routines into pa=
ged memory, rather then the non paged area - I get these warnings.

Do I need to change a setting in CodeWarrior ? I know you have to be carefu=
l with JSR and paged memory - and I'm just calling a subroutine that is on =
the same page ?

Anyone any thoughts ??

Thanks

Rachel




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )