Table of interrupt vectors "under the microscope"

General discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
SVG-FLIM
Posts: 4
Joined: 17 Sep 2018 13:10

Table of interrupt vectors "under the microscope"

#1 Post by SVG-FLIM » 18 Sep 2018 06:35

I have a task to write a program on Atmega328.
One of the conditions is to place the information block in the memory of programs at certain addresses.
I know that this is achieved by using the "org" directive.
It works, but there is a limit.
I conducted experiments and studied the code listings that are obtained after compilation.
The reason for the restriction is the creation of an interrupt table
your compiler builds an interrupt table using RJMP,
which is normal for Atmega168 (16 Kb) but strange for Atmega328 (32 Kb).
Because of such a table (RJMP), there is a need for intermediate "extenders" of JMP.

You implement with this code:
-------------------------------------------------- -------
0x0066 0x93EF PUSH R30
0x0068 0x93FF PUSH R31
0x006A 0xE9E0 LDI R30, 144
0x006C 0xE2F7 LDI R31, 39
0x006E 0x9409 IJMP
_main:
0x00D4 0xEFBF LDI R27, 255
0x00D6 0xBFBD OUT SPL + 0, R27
0x00D8 0xE0B8 LDI R27, 8
0x00DA 0xBFBE OUT SPL + 1, R27
-------------------------------------------------- -------


Now about the problem.
I need to place an information block with the size of 64 bytes from the address 0x0080.
This need is due to the use of specialized
programmer.
We can not influence this.
The programmer was purchased from the developer.

In my program, many interrupt vectors are used and when compiling the required area
program memory is busy with inserts "Push_Z - Init_Z - IJMP"

If your compiler used long JMPs in the interrupt table, then such a problem would not arise.
And now I do not know how to solve this problem.
Attachments
IMG_3.jpg
IMG_3.jpg (139.2 KiB) Viewed 1725 times
IMG_2.jpg
IMG_2.jpg (74.25 KiB) Viewed 1725 times

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Table of interrupt vectors "under the microscope"

#2 Post by filip » 21 Sep 2018 12:51

Hi,

I believe you have raised the same issue on our HelpDesk so we will continue there.

Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for AVR General”