How to assembler a 24-bit integer in avr-as?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'd like to assemble a 24-bit integer in avr-as as if it was generated from C code like

const __pgmx char c = 1;
const __pgmx char *pc = &c;

and the assumption that __pgmx generates 24-bit addresses.

If pc just holds the lower 16 bits of c's location then the code is

.global	pc
	.data
	.type	pc, @object
	.size	pc, 2
pc:
    .word c

Now the question is how to write down the complete 24-bit address?

.global	pc
	.data
	.type	pc, @object
	.size	pc, 3
pc:
    .word c
    .byte hlo8(c) ??? error from as

same error for hh8(c)

Can anyone enlight me?

Thanks!

avrfreaks does not support Opera. Profile inactive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds to me like you'll need to dig down deep into as&ld.

Sounds like *this* (named space with 24-bit pointers) is finally something worth to concentrate into, rather than discussing the merits of making the libraries lintable,,, :-)

I regret that I am so stupid I can't help.

Jan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, it's for 3-byte pointers. And as a byproduct there could be a 24-bit arithmetic and built-in types __int24_t and __uint24_t. Up to now, everything works smooth except that avr-as has some white spots on its landscape...

avrfreaks does not support Opera. Profile inactive.