HP 64700 series User Manual page 41

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

Advertisement

000446 0C42 0000
00044A 57CA FFBE
00044E 343C 04FF
000452 2F3C
000454 000005FF
000458 2F3C
00045A 00000500
00045E 6100 0034
000462 DFFC
000464 00000008
000468 60A0
00046A 2039 0000
00046E 0600
000470 C1FC 4E6D
000474 2040
000476 41E8 0339
00047A 2008
00047C 23C0 0000
000480 0600
000482 4240
000484 4840
000486 0280
000488 000000FF
00048C 4E75
00048E 1340 0500
000492 4E75
100
101
102 **************************************************
Figure 3-2. Sample Program Listing (Cont'd)
53 TEST
CMPI
54 ;-------------------------------------------------
55 ; If the counter is not zero, continue to write
56 ; random numbers.
57 ;-------------------------------------------------
58
DBEQ
59 ;-------------------------------------------------
60 ; The counter is zero.
61 ; in the RESULTS area.
62 ;-------------------------------------------------
63
MOVE.W
64 ;-------------------------------------------------
65 ; Push the "high address" and "low address"
66 ; parameters expected by the QSORT routine.
67 ;-------------------------------------------------
68
MOVE.L
69
MOVE.L
70 ;-------------------------------------------------
71 ; Call the QSORT routine.
72 ; stack pointer after the call.
73 ;-------------------------------------------------
74
BSR.W
75
ADDA.L
76
BRA.B
77
78 **************************************************
79 * The RAND routine generates a pseudo-random
80 * number from 0-0FFH, and leaves the result
81 * in D0.
82 **************************************************
83 RAND
MOVE.L
84
MULS.W
85
MOVEA.L D0,A0
86
LEA
87
MOVE.L
88
MOVE.L
89
CLR.W
90
SWAP
91
ANDI.L
92
RTS
93
94 **************************************************
95 * The WRITE_NUMBER routine writes the random
96 * number to the RESULTS area.
97 * previous number is the offset in this area.
98 **************************************************
99 WRITE_NUMBER
MOVE.B
RTS
#0,D2
D2,AGAIN
Sort the random numbers
#4FFH,D2
; Reset counter.
#RESULTS+0FFH,-[A7]
#RESULTS,-[A7]
Increment the
QSORT
#8,A7
AGAIN
; Repeat program.
RAND_SEED,D0
#4E6DH,D0
339H[A0],A0
A0,D0
D0,RAND_SEED
D0
D0
#000000FFH,D0
The second
D0,RESULTS[A1]
Examples 3-5

Advertisement

Table of Contents
loading

Table of Contents