Figure 3-1. Pseudo-Code Algorithm Of Sample Program - HP 64700 series User Manual

Emulators
Hide thumbs Also See for 64700 series:
Table of Contents

Advertisement

Initialize the stack pointer.
Set up number counter.
AGAIN:
Save the two previous random numbers.
Call the RAND random number generator subroutine.
Test the two least significant bits of the previous random number.
If 00B then goto CALLER_0.
If 01B then goto CALLER_1.
If 10B then goto CALLER_2.
If 11B then goto CALLER_3.
CALLER_0:
Call the WRITE_NUMBER subroutine.
Goto AGAIN (repeat program).
CALLER_1:
Call the WRITE_NUMBER subroutine.
Goto AGAIN (repeat program).
CALLER_2:
Call the WRITE_NUMBER subroutine.
Goto AGAIN (repeat program).
CALLER_3:
Call the WRITE_NUMBER subroutine.
Decrement number counter.
If the number counter is not zero
Then goto AGAIN (repeat program).
Else
Reset number counter.
Push parameters for QSORT.
Call QSORT.
RAND:
Pseudo-random number generator which returns a random number
from 0-0FFH.
RETURN from subroutine.
WRITE_NUMBER:
Write the random number to a 256 byte data area, using the second
previous random number as an offset into that area.
RETURN from subroutine.
QSORT:
Quick-sort values in 256 byte data area.

Figure 3-1. Pseudo-Code Algorithm of Sample Program

An assembler listing of the sample program is shown in figure 3-2. It
is provided so that you can see the addresses associated with the
program labels. The program area, which contains the instructions to
be executed by the microprocessor, is located at 400H. The RESULTS
area, to which the random numbers are written, is located at 500H. The
area which contains a variable used by the RAND subroutine and the
locations for the stack is located at 600H.
Before you can use the analyzer to perform measurements on the
sample program, you must map memory and load the sample program.
Examples 3-3

Advertisement

Table of Contents
loading

Table of Contents