
The 68010 179
MOVE.L #$4000,DO
M0VEC DO,VBR
The VBR can be used for many purposes. The implementation of
a virtual machine is made much easier by the use of the VBR. Each
different user of the virtual machine must think that he/she has his/her
own set of exception vectors. These should appear to be located at
address zero. However, when the program runs, these vectors really can’t
be used since the virtual machine operating system requires complete
control. The virtual machine operating can use the VBR to set up an
alternate address for the actual vectors. If an exception occurs that the
virtual machine operating systems wants to pass to the user it can re
vector through the address found in the vectors based at zero. The VBR
can also be used to make a debugger appear more transparent to the
program it is debugging.
RTD and Loop Mode
Two other minor features that exist for the 68010 are the RTD in
struction and loop mode. The RTD instruction works exactly like the
RTS instruction except that a constant is added to the stack pointer af
ter the return address is fetched. This constant value is normally used
to clear the stack of any parameters passed to the subroutine. As dis
cussed in Chapter 8, this is normally the responsibility of the caller. To
see how this instruction works, let’s say that subroutine MYSUB is called
with three longword arguments. The following call would be used:
MOVE.L ARG3,-(SP)
MOVE.L ARG2,-(SP)
MOVE.L ARG1,-(SP)
JSR MYSUB
Normally the caller would use an ADDA.L #12,SP following the JSR to
clean up the stack. With the 68010, the following instructions can be used
such that the subroutine can clean up the stack upon its return:
MYSUB: .
RTD 12
Loop mode is an enhancement to the operating speed of the 68010 that
the user doesn’t even have to be aware of. To understand the advantage
of loop mode, we will have to take a closer look at the factors that govern
Kommentare zu diesen Handbüchern