Download Print this page

Processor Variables - Intel EV80Cl96KB User Manual

Microcontroller evaluation board

Advertisement

EV80C196KB Microcontroller Evaluation Board User's Manual -43-
Processor Variables
Several commands are provided to access variables which are associated with the
processor rather than with the program:
PC
PC = <byte-address>
PSW
PSW = <word-value>
gJ= <word-address>
The processor variables can be modified only while the target is stopped, they can
be read at any time. These commands allow the display and loading of the program
counter (PC), program status word (PSW) and stack pointer (SP). Display is in the
default base.
NOTE: The examination of the SP will be confusing if you don't understand
the following paragraphs.
The iECM-96 software uses two words in the user's stack to store the PC and PSW
during a host interface interrupt. When the user displays the SP (or uses the
STACK command) the value shown for SP is adjusted by 4 bytes to compensate for
this overhead so that it becomes more or less invisible to the user (the user must
still allow for the extra stack space used). This is convenient but creates confusion if
you display using the SP command and then use the WORD command to look at
location 18H which is the register address of the stack pointer. Location 18H will be
4 less than "SP".
An additional consideration is what happens when you attempt to write into the stack
pointer using the SP command. Before returning from the RISM interrupt service
routine (ISR) which actually updates the stackpointer, the RISM places in the stack a
return address and associated PSW for the idle loop it executes while the target is
"'stopped". This prevents the target from getting lost upon return from the ISR. You
should not attempt to modify the stack pointer from the console through the use of
its register address (18H); it should only be modified by the SP commands or by
execution of user code in the target. This decreases the possibility of the target
getting confused.
Specific implementations of the RISM may actually prevent the user from writing into
"WORD 18" and thereby force the user to use the "SP" command.

Advertisement

loading