Welcome to the Zilog forum!
Go to bottomPage: 12
TOPIC:
#981
Software Trap Z8F0822 dosn't work 1 Year ago Karma: 0
Hi,

Code dosn't work:

LD %20,#%09
LD %21,#%BC
TRAP #%10

I want jump to %07BC but the Programmcounter will loads with the Reset vector and program crashed.
What ist wrong?
z8user (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#982
Re:Software Trap Z8F0822 dosn't work 1 Year ago Karma: 0
The vector table is stored in ROM in the z8, it remains fixed during the program execution. The interrupt addresses are registered at compile time by defining interrupt service routines. The two load instructions are not changing any values.


Please share a little more of what you want to do.
mr (User)
Senior Boarder
Posts: 41
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#983
Re:Software Trap Z8F0822 dosn't work 1 Year ago Karma: 0
The vector table is stored in ROM in the z8, it remains fixed during the program execution. The interrupt addresses are registered at compile time by defining interrupt service routines. The two load instructions are not changing any values.


Please share a little more of what you want to do.
mr (User)
Senior Boarder
Posts: 41
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#984
Re:Software Trap Z8F0822 dosn't work 1 Year ago Karma: 0
i wont test the instruction set. The example from "eZ8 CPU User Manual" UM0128 s.192 Software Trap :

TRAP
Software Trap:

Sample Usage
If Register 68h contains the value A0h, and Register 69h contains the
value 2Fh, the following statement pushes the Flags and Program Counter
onto the stack. The Program Counter loads the value A02Fh. Program
execution resumes at address A02Fh:
TRAP #%34
Object Code: F2 34

This is, what i wont, but only with other adresses.

LD %20,#%09
LD %21,#%BC
TRAP #%10

Go to instruction 09BCh
z8user (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#985
Re:Software Trap Z8F0822 dosn't work 1 Year ago Karma: 0
I'm using the Z8 XP F1680, but the F0822 is similar

The memory at starting at %0000 is ROM, the standard vector table starts at %0002 with the reset vector address and continues up to %0037, after that is defined as program space. This standard vector table has the addresses for the standard ISRs. You can add more pointers starting with %0038 and use those places to hold trap vectors. You can use the earlier ones too, but you'd have to be sure you don't conflict with any existing run-time service routines.

The Flash ROM is loaded with your code when you flash. It cannot be modified with out first erasing it and enabling it for writing. Any trap vectors should be defined statically at compile time to reduce code space.

The example given in the manual illustrates the concept but doesn't consider the region where the writing occurs.
mr (User)
Senior Boarder
Posts: 41
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#990
Re:Software Trap Z8F0822 dosn't work 1 Year ago Karma: 0
Thank's mr, it's correct.

I will use now:

LD R14,#HIGH(subroutine)
LD R15,#LOW(subroutine)
CALL @%EE



...
subroutine:
...
RET
...

for my ez8 homebrew real time system
z8user (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 12