ppg rom pocket q@uide · 2020. 11. 22. · ppc rom pocket guide this pocket guide is preliminary. a...

36
PPG RO M POCKET Q@UIDE

Upload: others

Post on 07-Aug-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

PPG RO M

POCKET

Q@UIDE

Page 2: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide
Page 3: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

PPC ROM POCKET GUIDE

This pocket guide is preliminary. A lack of time,and inadequate inputs did not permit a "fine tuned"pocket guide. For this reason, a preliminary versionis printed on paper. This will allow you to write innotes to serve as a reminder for you to send in yourinputs. We plan on reprinting this pocket guide ona high quality material that will make it durable forfield use. Pick your favorite routine and rewrite theshort form instructions for it. Make it short, comp-plete, and easy to use. If every ROM user carefullywrote up just one routine for the pocket guide wewould have a first class Pocket Guide in no time. Allimportant details should be included. Tables, charts,text, and special notations are suitable and should beused as required for a short write-up. Registers andFlags used, input formats, function, etc. should beincluded. Keep in mind to make it short and complete.The guideline for a pocket guide is short, short, short.

Each routine has an abbreviated Technical Details box.Abbreviations used in this box are:

SRL: Subroutines left C: Registers to copyI?: Interruptible? INP: If no printerF: Program file -: Variable

A/R: As Required

Al - ADDITIONAL KEY ASSIGNMENTS

May be used after M (which will set flag 20 and clear07) or after EM@(which will set both flags 20 and07). The sequence prefixtpostfixtkeycode, XEQ ESwill make the corresponding key assignment. If flag07 is clear, it will then prompt for subsequent keyassignments; otherwise it returns. after making onlyone assignment. Both KI®and permit key assign-ments under program control. If in a program it ismore convenient not to use > hote that the sequenceCF 20, SF 07, XEQ is completely equivalent to XEQEI® . Do not use data registers 09-11 between uses ofm .

lXROM: 10,03 SIZE: 012 SRL: 3 I? NO F: MK C: 611

&R srore part oF 1p(MR and @3 permit construction of programs that can

write (create) other programs. See regarding

PPC ROM POCKET GUIDE 1

Page 4: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

initialization of the byte-loading process. With adecimal code of the byte to be loaded in X, the in-struction XROM BB will load the corresponding byteinto the next location of the prepared area. Executionof such a 'program-writing' program will terminate withthe prompts for the terminating 'clean-up' operationsas with .

F(ROM: 10,24 SIZE: 012 SRL: 4 I? YES F: LB C: 71]

m- FIRST KEY ASSIGNMENT

This non-prompting program is suitable for making a keyassignment under program control. The sequence prefixtpostfixtkeycode, XEQ EE@will check registers and addthe desired key assignment. Subsequent key assignmentscan be made using , providing data registers 09-11are not used in the meantime. See for more infor-mation on making key assignments under program control.

IXROM: 10,02 SIZE: 012 SRL: 3 I? NO F: MK C: 61'

400 - DECODE 2 BYTES TO DECIMAL

Evaluates the decimal equivalents for the last twobytes in X. Returns the decimal equivalents for thenext-to-last byte in X, for the Tast byte in M. (UseX<>M to view.) Y, Z preserved; X, T lost.

IXROM: 10,55 SIZE: 000 SRL: 6 1I? YES F: IF C: 60

oY) - ASSIGNMENT REGISTER FINDER

Returns the number of assignment registers used. Ifthe‘top assignment register contains only a singleassignment (in the left half of the register), thefractional part of the result in X is 0.5.

IXROM: 10,10 SIZE: 000 SRL: 3 I? YES F: LF C: 59

X2nenn DELETE LAST cHARACTERRemoves the Tast (rightmost) character from the alpharegister. X, Y, Z, and T are lost, but L is preserved.

ferow: 10,18 1762 000 SRL: 6 17 vEs F: mL c: 64

XNauesmseTize X AvD ¥Sorts two alpha strings in X and Y: Xand Y in

2 PPC ROM POCKET GUIDE

Page 5: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

alphabetic order upon return (lowest value in X). IfX and Y are numeric, they are regarded as pointers totwo data registers which are to be sorted, the Towestvalue to the register designated by X. Flag 10 is leftset or clear, depending on whether an interchange wasperformed or not.

IXROM: 10,37 SIZE: 000 SRL: 4 I? YES F: VK C: 63

EXYD- Apua To MEMORY

This routine alpha stores (ASTO, ASHF, ASTO, etc.) thecontents of the ALPHA register into data registersusing a control number in X of the form bbb.eeeii.Example. Store ALPHA in ROl thru RO4. 1.004 XEQ €XD.Inverse operation is @O.

IXROM: 20,53 SIZE: 005 SRL: 5 I? YES F: NS C: 16J

m- ALPHA STORE b

In ROM the mode of interpreting the last two bytes ofstatus register b (which comprise the current locationof the program pointer) is different than when in RAM.In ROM all 4 nybbles specify the current address. InRAM the first nybble (mod 8) specifies a byte within aregister specified by the last 3 nybbles (mod 1024).

provides an ASTO b with the ROM-mode interpreta-tion, permitting ultra-fast ROM entry as an alternativeto E3 .

hROM: 10,61 SIZE: 000 SRL: O I? YES F: IF C: 60]

LY- zrrcove ANALYZER

XEQ &, See SCAN prompt. Use wand, scan any barcode.Requires printer. Prints tabular analysis of barcodeincluding type, every byte in binary, hex and decimal.Computes checksum to verify if it read the barcodecorrectly.

M?W 20,30 SIZE: 019 SRL: 4 I? YES F: BA C: W]

EXI3- sock cear

Stores 0's In defined block.

I'nputs T: T Output: T: T

2: Z Z: ZY: ¥ Y: ¥X: bbb.eeell X: 0L: L L: final control word

PPC ROM POCKET GUIDE 3

Page 6: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

[XROM: 20,43 SIZE: var, SRL: 5 17 yes F: M2 C: GTI

EEID)- 60& 1o sase peciva

Store base b in R06 (2<=b<=25), Key digits of base bnumber In alpha and XEQ "gEI3". Up to 14 digits maybe Input in aipha where each diglt is In the rangefrom 0 to b-1 Inclusive. The base 10 result is leftIn X and alpha is left cleared. The Inverse routineis EOD.

[XROM: 20,17 SIZE: 007 SRL: 5 1? yes F:BD C: 53—l

m- BLOCK EXCHANGE

Store two block control words bbb.eeeil 1In X and'Yand XEQ "E@". When the two blocks are of the samesize the order of the inputs in Y and X is notImportant, Otherwise only the block control word in Y

Is tested and controls the loop.

PROM: 20,34 SIZE: var. SRL: 5 §? yes F: M2 C: 61

1srock ncrement

This routine is a register block storing routine thatwill store numerical data in a sequence, as a constant,or zero, Three inputs are required: bbb.eeeii ENTERstart value ENTER increment value XEQ BI . X showsTast value stored when routine stops, Y contains ISGvalue, Z and T are cleared, LASTX contains incrementvalue.

IXROM: 10,44 -SIZE: A/R SRL: 5 I? YES F: BL C: 46

S - BLDSPEC INPUTS FOR@

This routine converts BLDSPEC numbers into HP-41 memorybytes for a synthetic text line. Key first BLDSPECnumber, XEQ FW . See first of seven bytes in X. (0-255). Key second BLDSPEC number, R/S, see second byte.Continue with R/S until all seven bytes are obtained.

To use EEPstart with 247, followed by seven bytes.To print: Text line, RCL M, ACSPEC, PRBUF. Related

routines are FL and XL . These are not intendedto be used as subroutines.

XROM: 10,42 SIZE: 000 SRL: 4 1? YES F: BL C: 46

4 PPC ROM POCKET GUIDE

Page 7: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

I3 - Brock move

Applies only to a block of consecutive registers.Input: T: T

Z: 1st register 1n source blockY: 1st register in destination blockX: number of registers in source block

IXROM: 20,39 SIZE: var, SRL: 5 1?7 yes F: M2 C: 61

BRB/

Applies only to a block of consecutive registers.tnput: T: T

Z: ZY: 1st register in source blockX: % number of registers in source block

1f X>0 the majority of block shifts to higher numberedregisters. f X<0 the majority of block shifts totower numbered registers. Amount of shift Is by one

register for each call to EIR.

[fizom: 20,40 SIZE: var. SRL: 5 12 yes F: M2 C: 61]

33Vl - BLOCK VIEW

This routine uses a defined block input in X (bbb.eeeii)to view the non-zero contents of the defined registersin the format R: NNN...N. Prints if printer is con-nected and on. For PSE at each register set flag 09.Set flag 10 to stop at each register.

kROM: 20,07 SIZE: A/R SRL: 4 I? YES F: SR C: 40]

23- sLock extrema

Input bbb.eeeli in X, If flag 10 Is set the blockwill be considered non-negative. If flag 10 Is clear

may return negative values as extrema. Output:M: regisfer number of max value = INT part of MN: register number of min value = INT part of N0: bbb.eeeil = original block control. wordY: maximum value in blockX: minimum value In block

[?ROM: 20,41 SIZE: var. SRL: 5 [? yes F: M2 C: 61

E- BLOCK STATISTICS

Assign appropriate location of the I-registers.

PPC ROM POCKET GUIDE 5

Page 8: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

Enter two block control words of the form bbb.eeellIn X and Y. When the two blocks are of the same sizethe order of the Inputs in X and Y is not Important.Otherwise only the block control word in Y is testedand controls the loop. Output in I«-registers:

ix £x2 Ly Eyz

[XROM: 20,42 SIZE: var, SRL: 5 1? yes F: M2 C: 64

- corman mnocrReturns the absolute decimal address of ROO (curtainlocation). X, Y preserved in Y, Z; Z, T, L lost.

kROM: 10,16 SIZE: 000 SRL: 6 1I? YES F: ML C: 64]

oxy n=# reg. In block

(0F.W . COMPLEX ARITHMETIC

SIZE 018 minimum. GTO "E" and XEQ 06 to Initialziethe complex stack. The following functions are on thetop two rows of keys.

X . 4a: Xc<>Yc be Yc c c: Pop d: LASTZ e: e

A: + B: - C: * D: : E: LN(2)

Initial iz H: sin(z) I: cos{z) J: Push(XEQ 06)

Store call # in R0O6 and XEQ " [I3"1:+ 23- 3:% 43/ S5:in(z) 6:init. stack7:cosh(y),sinh(y) 8:sin(z) 9:cos{z) 10:PUSH11:XY 12:Y1X 13:POP 14:LAST Z 15:elz16:POP(save LASTz)

[XROM: 20,23 SIZE: 018 SRL: 4 1? yes F: CA T: 3%

[od =3 - COUNT BYTES

Counts bytes between any two instructions in RAM.Position program pointer to beginning of sequence(first instruction in display). In RUN mode do aRCL b. Position program pointer to end of sequence(first instruction after the sequence in the display)and a second RCL b in RUN mode. Then XEQ yieldsthe byte count. When counting bytes in a program(first instruction to END) it may be more convenientto do the 2nd RCL b at the END of the program.In this case, add 3 to the byte count returned by EE3.Note that total byte count for a program divided by

6 PPC ROM POCKET GUIDE

Page 9: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

112 and rounded up to the nearest integer yields thenumber of tracks required to record the segment onmagnetic cards. (RCL b = 144, 124, k)

[XROM: 10,50 SIZE: 000 SRL: 4 17 YES F: IF C: 60

)- character To DECIMAL

Decades last byte of alpha register (rightmost char-acter displayed) into a decimal number returned in X.Up to 14 characters (the rightmost 14) will be pre-served in the alpha register, including the decodedcharacter if Flag 10 is set. Otherwise the decodedcharacter is deleted. X, Y, Z preserved in¥, Z, T;in X; X, Z, T, and L are lost.

hROM: 10,35 SIZE: 000 SRL: 6 I? YES F: VM C: 60

(oN]y - CALENDAR DATE TO JULIAN DAY NUMBER

Clear flag 10 for Gregorian (modern) calendar. Setflag 10 for Julian calendar. Input date in format:

Z: year The JDN is returned in X,Y: month DOW = (JDN + 1) MOD 7X: day The Inverse routine is EE.

IXROM: 20,21 SIZE: 000 SRL: 5 1? yes F: BD C: 53]

(419 - CLEAR KEY ASSIGNMENTS

A1l USER mode assignments revert to the standard key-board. Assignment registers are returned to the poolof unused registers without any need to PACK. Globallabel assignments are dormant until the next programcard is read in.

XROM: 10,06 SIZE: 000 SRL: 4 I? YES F: LF C: g;]

Y- coeinations

To compute Cln,k) key n ENTER} k XEQ "GE@". Thenumber of combinations of n objects taken k at a time

Is left In X,

XROM: 20,20 SIZE: 000 SRL: 5 1? yes F: BD C: 53

EB COLUMN PRINT FORMATTING

Aligns numeric values for printing columns of data.

PPC ROM POCKET GUIDE 7

Page 10: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

A skip index in R0O6 keeps decimal points in place. In-dex is calculated as (Max # digits left of dec. pt.)-1 for F29 clear, and (Max # digits...) -1 + (No. com-mas in largest number in the column) for F29 set. Setdisplay mode, status of F29, place skip index in R06,place the number in X and XEQ €&&. The number will thenbe added to the buffer in the correct column position.

[XROM: 20,27 SIZE: 007 SRL: 5 I? YES F: LG C: 29

(U - CURTAIN UP

Adds the integer value (including sign) of the contentsof X to the pointer in status register ¢ to registerROOI The sequence 10, XEQ {&EMraises the curtain 10registers. Then the sequence -10, XEQ lowers it%o Ij_t? previous position. Y, Z preserved in X, Y; X,

s ost.

[XROM: 10,34 SIZE: 000 SRL: 6 I? INP F: VM C: 60]

[04VA - CURVE FIT

SIZE 027. GTO "™ and the following functions are

on the top row of keys.

a: L- A A ©e: InitializeA: Z+ B: Solve Type J C: Y D: X E: Solve Best

bx + a

a*ebx (a>0)b*in(x) + a

b (a>0)

Curve Types: 1. Linear y

2. Exponential vy3. Logarithmic vy

a¥x4. Power y

Key x ENTER? y and press A for each data palr.Key B returns: - X: b Y: a Z: rKey E returns: X: ] Y: b Z: a T: rRegisters used:

RO6: fot. # RI3: Ex, R20: I In(x)?RO7: cv type Rt4: Ix R21: )Iln(y)2RO8: b, x RI5: Ly, R22: Iin(y)RO9: a, y R16: Ty R23: Zin(x)*in(y)R10: r R17: Zxy R24: nR11: I x¥*[n(y} R18: Zn R25: best rR12: I y*|n(x) R19: I In{x) R26: best cv type

Store call # in R0O6 and XEQ " Q"

O:clear/init, 1: £+ 2:solve type | 3: Y 4: X5:Solve Best Type 6: L-(when F10 set) 9:stop in CV

XROM: 20,08 SIZE: 027 SRL: 4 7 yes F: CV C: 42

8 PPC ROM POCKET GUIDE

Page 11: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

(o9@ - CURTAIN TO ABSOLUTE DECIMAL LOCATION IN X

Places hex version of x into the appropriate 3-nybble slot (the pointer to R00) in status register c.

Values 17 through 192 (mod 1024) or greater than 512(mod 1024) will result in "MEMORY LOST". VY preserved

in X5 X, Z, T, and L are Tlost.

[ihOM: 10,33 SIZE: 000 SRL: 5 I? INP F: VM c: 60]

-DECIMAL TO CHARACTERAppends to alpha contents the character correspondingto the decimal integer (mod 256) in X. Y, Z preserved

in X, ¥; X, T, L lost.

XROM: 10,11 SIZE: 000 SRL: 6 I? YES F: LF C: 5§]

m-DECIMAL TO FRACTION

SIZE 011. Store display setting (0-9) in RO7. Setflag 10 to display fraction in alpha or clear flag 10for no display. Enter decimal in X and XEQ " E@".Reduced fraction is left In Y (numerator) and X(denominator) and in addition, If flag 10 was set thefraction Is displayed In alpha.

[%M: 20,13 SIZE: O11 SRL: 4 I? yes F: FR C: 36]

13- oecovan To pRosrAM POINTERThe inverse to G . Converts a decimal byte addressin X to a program pointer that via a STO b can resumeprogram operation where desired. See Ab regardingprogram pointers. Byte addresses begin with 0 atthe bottom of status register memory through 111; thisis followed by a 'hole' from 112 to 1343; then followsuser memory from 1344 to 3583 (for the full complementof user registers). Among possibilities offered

by @ (but requiring great care) are execution ofprograms set up in data registers or the stack. Only

Y is preserved; X, Z, T, L are lost.

XROM: 10,53 SIZE: 000 SRL: 5 I? YES F: IF C: 60]

RO7: 1st register of entire fileRO8: number of reglsters per recordRO9: number of records in the file

DELETE RECORD

PPC ROM POCKET GUIDE 9

Page 12: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

To delete the kth record key In k and XEQ " EXB".RO9 Is automatically updated. Inverse routine is EGB

[XROM: 20,38 SIZE: var. SRL: 5 |7 yes F: M2 C: GTI

m- DISPLAY SET

BB provides a capabllity similar to the HP-67/97DSP function, which sets the number of decimal placesto be displayed without changing the display modetype (FiX, ENG, or SCI), If FIX, SCl or ENG n Is setthen keylng m XEQ "B " changes the display mode foFIX, SCl, or ENG m. .

IXROM: 10,29 SIZE: 000 SRL: 6 I? YES F: VM C: 60

0D DISPLAY TEST

Turns on all 12 commas for 1 second {execution can beinterrupted at this point), then all display segmentsand annunciators except for the comma tails. Reviewthe display, then push the PRGM switch and R/S toclean up. X, Y, and Z are preserved.

[XROM: 10,17 SIZE: 000 SRL: 6 I? NO F: ML C: 64

B3 oo rooerReturns the absolute decimal address of the registercontaining .END. in its Tast 3 bytes (bytes 02-00).This is done by decoding the appropriate pointerdigits in status register c. X, Y preserved in Y, Z;Z, T, L lost.

[XROM: 10,62 SIZE: 000 SRL: 5 I? YES F: IF C: 60

T3- crise ProGrAM MEMORY

As Tlong as Flag 14 is clear and there is a programlabeled '//' (as described below) in RAM, XEQwill clear programs following that labeled '//'.

LBL *//!

RCL b

END or RTN

(followed by at least 6 bytes before .END.)If Flag 14 is set or if there is no program '//' asdescribed, all programs will be erased. XEQshould be followed by PACK to reinstate Catalog 1.

IfiiOM: 10,31 SIZE: 000 SRL: 0 I? YES F: VM C:a

10 PPC ROM POCKET GUIDE

Page 13: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

B3 - oooF xReplaces X by its exponent portion, -99 to +99. The

old X is saved in L; Y, Z, and T are preserved

[XROM: 10,27 SIZE: 000 SRL: 6 1I? YES F: VM C: 60]

[SPdl - FREE REGISTER FINDER

Returns the number of free (available) registers be-tween the last used assignment register and the .END.

register; there will be a non-zero fractional part 0.5whenever the top assignment register contains only asingle assignment in the left half of the register.See EHS .

iXROM: 10,04 SIZE: 000 SRL: 3 I? YES F: MK C: 61

Y-Fst oerivaTive

SIZE 018. Calculates f'(a). Program function f(x).uses R10-R17. Store the following:

R10: function global label nameR11: pointer to register contalining x

R12: step sizeStore a in register pointed to by RI1.Flag FO9 set selects quick approximation. F09 clearselects adaptive procedure. |f FO9 Is clear then F10controls a display option. Set F10 to viewconvergence of optimal step size. Estimate of firstderivative is left in X and In addition, if FO9 Isclear an error estimate is left in Y,

[XROM: 20,11 SIZE: 018 SRL: 4 1? yes F: IG C: 44

-sivwciaL caccuLaTions

SIZE 010, 6TO "HWEM" and the following functions areon the top two rows of keys:

as 12x b: 12+ ¢: C/D? d: B/E? e: ClearA: n B: %1 C: PY D: PMT E: FV

H: CF Is PF J: Status

F08 set/clear = C/D. FO09 set/clear = B/E. Set F10(optional) to view convergence when solving for %1,

Store call # fn RO6 and XEQ " IGR" .O:clear/Init. 1:solve n 2:solve §1 3:solve PV4:solve PMT S5:solve FV 12:stop in Fi

XROM: 10,63 SI7E: 010 SRL: 4 1? yes F: FI C: 47]

PPC ROM POCKET GUIDE 1

Page 14: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

(S B - FLAG INPUTS FOREE

This routine provides the g@ bytes for a synthetictext 1ine from the flags set inputs. To use XEQ |,key first flag set, R/S. If X is negative, key nextflag, R/S. 1If TONE sounds, record byte number. Keyflags set in order of Towest to highest. Seven bytesare needed. Use 56 as last input if required. Touse start with 247, followed by seven bytes. Ina program use sequence: Text Tine, RCL M, STO d.Related routines are BL and XL .

IXROM: 10,43 SIZE: 000 SRL: 4 I? YES F: BL C: 46

G- sreomions

GTO "EB". The following functions are on the toprow of keys:

a: G b: c: ged ds e: 03A: + B: - C: * D: = E: Reduce

Set F10 to display fractional forms In alpha. Use FIX0 and clear flag 29.

Store call # tn R06 and XEQ " GE@"T:+ 2:~ 3:% 43/ 5:Reduce Y/X 6:6CD(x,y)

IXROM: 20,12 SIZE: 000 SRL: 4 1? yes F: FR C: 36—|

&3-« w0 .ew.Places program pointer at line 00 of the last programfile in memory (the one that contains the .END. ofprogram memory). If you switch to PGM mode, thenumber of available registers is displayed (as whenGTO.. is executed). provides a handy way tomove out of ROM back to RAM.

IXROM: 10,60 SIZE: 000 SRL: 0 I? YES F: IF C: 60]

m- GAUSSTAN RANDOM NUMBER GENERATOR

Use any data register to hold the seeds, say registerk. Store Initlal seed in Rk. Store mean in R06 andstore standard deviation = s In RO7. 68% +1s 95% +2s99.7% + 3s. Use DEGREES mode. Enter k In X and XEQ "X" to generate two random numbers, one in X and oneIn Y. Pointer k Is returned in Z and T. @M calisthe related routine .

[XROM: 20,15 SIZE: 001 SRL: 4 |? yes F: FR C: 36

12 PPC ROM POCKET GUIDE

Page 15: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

I3 HicH RESOLUTION HISTOGRAM WITH AXIS

Prints a bar-chart bar whose height is proportional tothe input in X where X is between Ymin (stored in ROQ)and Ymax (stored in ROl). Plot width (1 to 168 col-umns) is integer part and column position of the axis(1 to 168) is fractional part of R02. Bar is printedfrom axis to value, either up or down. Character(ACCHR #) to print the bar is stored in R03. Partialcharacter (ACCOL #) to print portion of bar is storedin RO5. Store values in ROO to RO3 and RO5, place thenumber in X, XEQEand a bar is added to the printbuffer.

kBpM{ 20,25 SIZE: 006 SRL: 5 I? YES F: LG C: 29

Y- nioe para RecrsTersIf size > k+6, the sequence k, XEQ raises the cur-tain by k registers, and places in former Rk (ROO after

the curtain is raised) an alpha constant used byto easily reinstate the curtain position before the?hift by GB . Y, Z, T preserved in X, Y, Z; X, Lost.

[}ROM: 10,20 SIZE: X+6 SRL: 6 I? INP F: ML C: 64

m- HEX TO NNN

Converts up to 14 hex characters in alpha to an NNN inX. Leading zeros need not be entered, and the spacecharacter can be used instead of zero. There aretwo acceptable characters for each hex digit greaterthan 9: 'A' is equivalent to ':'; 'B' to ';'; 'C' to'<'5 D' to '='; E' to '>'; 'F' to '?'. Unlike theinverse function QOB ., the status of Flag 10 is irrele-vant. X, Y, Z are preserved in Y, Z, T.

IXROM: 10,41 SIZE: 000 SRL: 6 I? YES 'F: NH C: 3;]

m- HIGH RESOLUTION PLOT

Plots 1 to 9 user RAM functions simultaneously in highresolution in the X direction (7 plot points perprinted Tine). Store Ymin in ROO, Ymax in ROl, plotwidth (1 to 168 columns) in RO2, Xmin in R0O8, Xmax inRO9, X increment in R10. Function names (global 1a-bels 6 char's or less) are stored in R15 to R23.Place the number of functions in X and XEQ @, SeeB@writeup for flag usage and other options.

XROM: 20,29 SIZE: 040 SRL: 3 I? YES F: MP C: sfl

PPC ROM POCKET GUIDE 13

Page 16: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

ZE) - 116k RESOLUTION HISTOGRAM

Prints a bar-chart bar whose height is proportional tothe input in X where 0 < X < 1. Plot width (1 to 168columns) is stored in ROF. Tharacter (ACCHR #) toprint bar is stored in R03. Partial character (ACCOL#) to print portion of the bar is stored in RO5.Store values in RO3 to RO5, place the number in X, XEQ

EBand a bar is added to the print buffer.

[XROM: 20,26 SIZE: 006 SRL: 5 I? YES F: LG C: ZQ—I

H3-vt fae

Toggles flag (changes state: clear to set or viceversa) specified in X (0 through 55). Y, Z preservedin X, Y3 X, T, L Tost.

{XROM: 10,49 SIZE: 000 SRL: 6 I? YES F: IF C: 60]

m- INTEGRATE

SIZE Q30. Program function f(x). uses R10-R29

and flag 09. Store global label function name In R10.Set flag 10 to display, iterations. Set display mode.Key in limits a ENTER’ b and XEQ " HW". [Integralapproximation is returned in X.

R10: functlon label name R15: Sk

R11: counter k R16: (b=-a)/4R12: uI R17: (a+b)/2

R13: 1 - u? R18: M(k,0)R14: 21K R19: MCk,1)

[iROM: 20,09 SIZE: 030 SRL: 4 I? yes F: IG C: 43

BozpraeStore information from status register ¢ in absoluteTocation 256 (decimal), the bottom register of theexternal portion of memory. This stored informationwill be used by BB to restore the proper pointerswhen the page is switched back on line. If you decidenot to switch the page off line immediately after ex-

ecuting MR, execute B (without actually switchingpages--just R/S in response to the switching prompt)to clear location 256.

[XROM: 10,45 SIZE: 000 SRL: 3 1I? YES F: BL C: 46

14 PPC ROM POCKET GUIDE

Page 17: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

m- INSERT RECORD

RO7: 1st register of entire fileR0O8: number of registers per recordR09: number of records in the file

To make room to insert a new kth record, key in k andXEQ "WGEM". RO9 Is updated. Inverse routine is [ER}

{XROM: 20,37 SIZE: var. SRL: 5 1% yes F: M2 C: 61

JC B JULTAN DAY NUMBER TO CALENDAR DATE

Clear flag 10 for Gregorian (modern) calendar. Setflag 10 for Jullan calendar. Key JDN In X and XEQ"EB". Date is returned in stack as:

Z: yearY: monthX: day of month Inverse routine Is

lXROM: 20,22 SIZE: 000 SRL: 5 I? yes F: BD C:;’

-I__OAD PART OF LB

and B8 permit construction of programs than canwrite (create) other programs. Prepare the programarea (1den1':1'f1'ed by LBL '++') as for . In theprogram-writing program place the instruction XEQto initialize the byte-loading process and returnwithout prompting for bytes. See B for the loadingof individual bytes.

IXROM: 10,23 SIZE: 012 SRL: 4 I? YES F: LB C: 71

(W3- LOAD BYTES

Permits the Toading of arbitrary bytes into programmemory, to facilitate synthetic coding. At locationin program where bytes are to be loaded, key in LBLY+, 4+, 4, +, ..., XROM . The number of +'sshould be at Teast n+6, where n is the smallestmultiple of 7 not less than the number of bytes youintend to load using . With the program pointersomewhere in this keyed-in sequence, switch to RUNmode and press R/S. The prompt 'HEX/DEC INPUT' whichprecedes the prompt for byte #1 reminds you that eitherhex or decimal input is acceptable, depending only uponwhether the mode is ALPHA or not, at the time you keyin an input. You can change the mode at will duringthe sequence. Press R/S after each entry. Pressing

PPC ROM POCKET GUIDE 15

Page 18: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

1

FUNCTIONAL GROUPING OF ROM ROUTINES

ALPHA REGISTER

DO D 3 2

BLOCK OPERATIONS

32 E B

oo E o0 €83 CE

CURTAIN

B @@'

[ DISPLAY

O @ B8]

KEY ASSIGNMENTS

m o E e0 E I

[_LOADBYTES|

oo M[xi|

MATHMATICS

@O E O .U ) A 3 BND@ E @ ;.B @ @ e2 3 ) C3 DM 3 3 m

6

MATRIX

o M 00 B @@

m G o Db CB o B0 @6 = B0 €3 @

m G EE o

NON-NORMALIZED NUMBERS

@ 56 o mo

PERIPHERALS

=3

s 2]

2] l

PROGRAM POINTER

S 2 @ @

ga

RETURN STACK

3 SRl

PPC ROM POCKET GUIDE

Page 19: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

HP-41C STATUS REGISTER USEAGE (0 THRU 15 ABSOLUTE)

6 i 5 | 4 i 3 2 } 1 i 0 «— BYTE

1 T 1 NUMBERScR- |LINEe SHIFTED KEY ASSIGN. arci |no. | 015

| | I ! fd USER FLAGS (0-29) 1+ |SYSTEM FLAGS 014| (0 ,9) “|(30-55){ S0LD I

¢ |zmes S0 |rea 00 £10, 013i

ADDRESb |34 |2nd ReTurn| 1st reTure |pomNER |012

2 [5th RETURN fsth RETURN Jatn RETURN are |out

! [ |oF UNSHIFTED KEY ASSIGN. SCRATCH 010

2 —t——g Q TEMPORARY ALPHA, SCRATCH 009= 1 T T= SCRATCH FOR ALPHA REGISTER= ALPHA 25-28 22-24 008A i I |& f { ig0 ALPHA REGISTER 15-21 CHAR. 007

% 1 T 1N ALPiA REGIISTER ?-14 cTAR. 006

8 T T 1M ALPHA REGIISTER I1-7 CHAR. 005

| iL STACKI REGISlTER L 004

. | |X STACKI REGISITER X 003

I !Y STACK REGISlTER Y 002

I |z STACKI REGISITER z 001

| fT STACK[ REGISITER T 000

REG.u: ) w NO.u—;lo—— mantissa ————u| exp= : =S

PPC ROM POCKET GUIDE 17

Page 20: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

R/S without an entry tells the program you're through.You can back up a byte by XEQ 03 (even if you've toldthe program you're through, providing you haven't begunto carry out the terminating instructions),

The prompt "SST, MORE +'S" indicates you don't haveenough +'s to load even one byte. Pushing SST oncewill get you to LBL "++", where in PRGM mode you caninsert more +'s and restart.

The terminating procedure is prompted. The SST is inRUN mode. The DEL is in PRGM mode. Following yourloaded bytes, there may be some final +'s (at most6).The X-register contains a number of the form p.00q.The termination prompt called for DEL 00p. Positionedat the first of any final +'s in PRGM mode, DEL 00qwill remove these excess +'s and the XROMinstruction.

IEOM: 10,22 SIZE: 012 SRL: 0 I? YES F: LB C: 71

LF -LOCATE FREE REGISTER BLOCK

Add 16.016 to returned value to get bbb.eee wherebbb and eee are the absolute decimal addresses ofUnused registers between the Tast used assignmentregister (if any) and the register containing .END.If flag 10 is set on completion of . the left halfof the bbb register is occupied by a keyassignment.

[XROM: 10,05 SIZE: 000 SRL: 4 I? YES F: LF C: SQ—I

(el - prc LOGO

XEQUEES, ADV or PRBUF to print PPC Logo. SF12 for dou-ble wide. 21 columns. Use to identify PPC materials,business cards, "MEMBER PPC" with PPC being the LOGO,etc.

b(ROM: 20,24 SIZE: 000 SRL: 5 1I? YES F: LG C: 29]

(NS Q- LENGTHEN RETURN STACK

Stores <5 return pointers (calls prior to that on o)in data registers RX and Rx+1 in a format permittingreinstatement by E@. Allows call depths as deep asavailable data storage space permits, providing thatsuccessive calls on are separated by no more than5 levels of subroutine nesting. For example, callsat the 5th and 10th levels of nesting (together withthe associated calls on B3 ) would permit successfulreturn from calls nested 16 deep (and would use only

18 PPC ROM POCKET GUIDE

Page 21: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

4 data registers). Y, Z, T preserved in X, Y, Z; X,L Tost.

[XROM: 20,02 SIZE: 002 SRL: » [I? YES F: SR C: 40]

E- 1#Rix, INTERCHANGE TWO ROWS

RO7: start. reg. of matrix R08: # columns in matrix

To Interchange rows ! and j, key 1 ENTERf J XEQngR".

{XROM: 20,33 SIZE: var. SRL: 4 1? yes F: M2 C: 611

[E] - vATRIX, MULTIPLY ROW BY CONSTANT

See @E. . To multiply row ] by the constant k, keyk ENTER?JXEQ "B,

[XROM: 20,31 SIZE: var. SRL: 4 1? yes F: M2 C: 61J

\T KJ - MATRIX, ADD MULTIPLE OF ROW TO ANOTHER

see W, To, add k times row | to row j, key ]ENTER} ENTERf k XEQ "IE". Row j will change. Row

T will not change.

IXROM: 20,32 SIZE: var. SRL: 4 1? yes F: M2 C 61]

m,— MATRIX, REGISTER ADDRESS TO (i,)

See M. Key in register r and XEQ " EZB". Rownumber | is returned in Y, column number J is returned

in X. Inverse routine is EB.

I?ROM: 20,35 SIZE: var. SRL: 4 1? yes F: M2 C: 61]

m’ MATRIX, (i,j) TO REGISTER ADDRESS

See . Key 1 entert Jj and XEQ " EE". Reglsternumber r is returned in X. Inverse routine is EIB.

[XROM: 20,36 SIZE: var. SRL: 5 1? yes F: M2 C: 61

LYrevory 1o ALPHA

This routine alpha recalls the contents of a block ofdata registers using a control number in X of the formbbb.eeeii. Inverse of BB . Using the EXDexample:

PPC ROM POCKET GUIDE 19

Page 22: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

1.004 XEQ QXY "brings back" the previously stored alpharegister contents.

hROM: 20,54 SIZE: 005 SRL: 5 I? YES F: NS C: 16]

[UIT8- vAKE MAKE MULTIPLE KEY ASSIGNMENTS

XEQ @I first reports the number of registers availablefor assignments. (Should "NO ROOM" be reported, takecorrective action before continuing, by pressing R/S ifyour corrective action did not move the programpointer.) Then the program prompts "PREAPOSTAKEY".Key in decimal equivalent of the first byte (prefix),ENTERY, decimal equivalent of the second byte (post-fix), ENTER+, user keycode, R/S. After each successfulassignment, the program will either prompt for anotherassignment or indicate no more available room with themessage "DONE, NO MORE". (In the latter case, proceedas with the "NO ROOM" message.) If you don't wish tomake any more assignments, there is no terminationprocedure; simply go on to whatever subsequent taskyou intended.

The messages "KEY TAKEN" followed by "KEYCODE?" issuggesting you select another keycode, since the oneyou specified is already in use. Your options are:

(1) enter another keycode and press R/S; (2) enterzero, indicating your desire to restart the assignment

in process, and press R/S; (3) delete the previousassignment to the key you want to use and press R/S.

The messages "NO SUCH KEY" followed by "KEYCODE?"indicate that your keycode entry is illegal. Options(1) and (2) in the preceding paragraph apply to theseerror messages.

At times (whenever Flag 20 is clear) the @B programwill recount key-assignment registers to ensure nooverlaps or gaps occur.

&ROM: 10,01 SIZE: 012 SRL: 3 I? NO F: MK C: 61]

I- mevorv Loss Resze To 017@@should only be executed immediately after MASTER

CLEAR, when the curtain and .END. are at their MEMORYLOST positions. XEQ (E@is essentially equivalentto XEQ SIZE 017, making more registers available forloading in long programs.

XROM: 10,12 SIZE: - SRL: 0 I? YES F: ML C: g;}

20 PPC ROM POCKET GUIDE

Page 23: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

m- MULTIPLE VARIABLE PLOT (1-9)

Plots 1 to 9 user RAM functions or numerical valuessimultaneously in standard resolution {1 plot pointper printed 1ine). Store Ymin in ROO, Ymax in RO,plot width (1 to 168 columns) in RO2, Xmin in RO8, Xmax in RO9, X increment in R10. Function names (glo-bal labels 6 char's or less) are stored in Ri5 to R23.Place the number of functions in X and XEQ M. See Iwriteup for flag usage and other options.

IXROM: 20,28 SIZE: 035 SRL: 3 I? YES F: MP C: 8%]

EY- #emory 1o sTACK

This routine recalls five data registers in sequenceand stores them in X, Y, Z, T, and L. RO6 must containthe Towest register of the five register block. Touse: N STO 06, XEQ @B .

[{EOM: 10,48 SIZE: 005 SRL: 5 1I? YES F: BL C: 46]

WAL - MANTISSA OF X

Replaces X by its mantissa. 01d X to Ly Y, Z, Tpreserved.

[XROM: 10,28 SIZE: 000 SRL: 6 I? YES F: VM C: 66]

O3-characTeRExtracts the Nth character (1<N<10) from the right endof alpha register. This extracted character becomesthe new contents of X and the alpha register. 01d Xpreserved in L; Y, Z preserved; T, L Tost.

XROM: 10,38 SIZE: 000 SRL: 6 I? YES F: VK C: 63|

- NNN TO HEXDecodes an NNN in X to 14 hex characters in alpha. X,Y, Z are preserved; T, L lost. The characters forhexadecimal digits greater than 9 depend upon whetheror not Flag 10 is set. See table below. The conver-sion is much faster when Flag 10 is set.

Flag 10: Set Clear

: A

B

< c

= D

PPC ROM POCKET GUIDE 21

Page 24: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

> E

? F&EOM: 10,40 SIZE: 000 SRL: 6 I? YES F: HN C: 33

-wexr erive

Key Integer n In Y and starting trial divisor d in X.d=2 or d is an odd number greater than 2. XEQ " GR"n Is returned in Y and next divisor p Is returned In

X. Press R/S for the next factor.

(XROM: 20,14 SIZE: 000 SRL: 5 1? yes F: FR C: 36]

CLY- v recauRecalls NNN stored by @&in RX and Rx+1‘ The NNN

replaces the contents of X. Y, Z, T, L are preserved.

IXROM: 20,50 SIZE: 002 SRL: 6 I? YES F: NS C: 16

m- NNN STORE

Stores Y in RX and Rx+1 in a format that allows recall

by BiBof the NNN in Y. Y, Z, T preserved in X, Y, Z;X, L Tost.

[XROM: 20,49 SIZE: 002 SRL: 6 1I? YES F: NS C: 16

1T- oren HemoryPlaces curtain at absolute decimal address 16 (justabove the status registers). Used by various ROMroutines to permit access to key assignments andprogram memory. BBreturns with the formercontents of status register ¢ in X. Former X, Y,

Z, L preserved inY, Z, T, L; T lost.

[XROM: 10,58 SIZE: 000 SRL: 5 I? YES F: IF C: 601

G-Procram POINTER ADVANCE@3is a selectable byte jumper. In PRGM mode

position the program pointer to the line from which youwant to byte jump. In RUN mode fetch the pointer witha RCL b. With this pointer in Y and an integer decre-ment in X (a negative integer would be an increment--i.e., backward in program memory), XEQ Edyields apointer in X moved the specified number of bytes inthe specified direction: a plus integer in X moves

22 PPC ROM POCKET GUIDE

Page 25: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

the pointer downward in user memory--i.e., forward inthe program. In RUN mode a STO b on the output of 3will then effect the actual byte jump. Switch to PRGMmode and see a Tine 00 display. Press SST to seewhere the pointer is located. (This SST from line 00does not advance the program pointer: the HP-41merely displays what it believes to be 1ine 01.)A GTO.. (any line) or a BST will re-establish correctTine numbers. Only the original X (the decrement) ispreserved in Y; X, Z, T, L are lost.

IXROM: 10,59 SIZE: 000 SRL: 0 I? YES F: IF C: 60

23- Procram pornTeR TO DECIMALConverts a program pointer (from the last 2 bytesof status register b in RAM format) to a decimal byteaddress. See inverse EIregarding byte addresses.

IXROM: 10,52 SIZE: 000 SRL: 5 I? YES F: IF C: 60]

I8 - Prck KEY ASSIGNMENT REGISTERSIf key assignments deleted leave a number of assignmentregisters with only one active key assignment, PACKingwill not merge two half-registers into one. To recoveras many registers as possible, XEQ E@after severalassignment deletions.

[XROM: 10,09 SIZE: 000 SRL: 4 I? YES F: LK C: 59

G- FervuraTions

P(n,k) = number of permutations of n objects taken kat a time. Key n ENTER} k and XEQ "EB". Pln,k) isreturned In X.

IXROM: 20,19 SIZE: 000 SRL: 5 12 yes F: BD C: 53]

G- ercx recisTer

R10: base b R11: register pointer |

To store the number n In position k In register RJ,key n ENTER? k XEQ "EZD". Inverse routine is .

Data Range Base b Position Numbers === —— — T2

0-1 2 1-300-2 3 1-190-3 4 1-15

PPC ROM POCKET GUIDE 23

Page 26: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

0-4 5 1-130-6 7 1-10-9 10 1-100-13 14 1-80-20 21 1-70-36 37 1-60-99 100 1-50-214 215 1-40-1413 1414 1-30-99999 100000 1-2

|XROM: 20,45 SIZE: var. SRL: 4 1? yes F: M2 C: Gll

Ge)- peeer our

This routine advances the paper in the 82153A Printerfive times. When printer is not connected and on itmay be used as a delay of about 1/5 second.

IXROM: 20,51 SIZE: 000 SRL: 5 1I? YES F: NS C: 16‘

XY- prce surtenWith flag 10 clear, put the name of the destinationprogram in ALPHA, and place the two page numbers inY and X, then XEQ EEMfrom the keyboard or in aprogram. G implements a switch from page Y topage X as follows. AR first stores informationfrom status register ¢ into absolute location 256(decimal) of page Y, the bottom register of. theswitchable part of memory. The program then promptsfor the user to switch page Y off and page X on. When

EE¥is restarted location 256 of page X, which waspreviously initialized by EEor K&, is recalledand placed in status register c. Execution is thentransferred to the destination program.

{XROM: 10,46 SIZE: 000 SRL: O I? YES F: BL C: 46—|

L)- uortent RevatnoerReplaces Y and X by (Y-Y mod X) /X (the quotient)and Y mod X (the remainder). Z, T are preserved;old X to L; L lost. Also, up to 14 characters inalpha will be preserved.

[xRoM: 10,54 SIZE: 000 SRL: 6 I?YES F:IF C: 60G5} - RecaLt p1spLay mobe

Restores an earlier display mode stored in Rx by EB.

24 PPC ROM POCKET GUIDE

Page 27: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

(Actually restores the earlier state of flags 16through 55.) X, Y, Z, T preserved in L, X, Y, Z;L lost.

[XROM: 20,05 SIZE: 001 SRL: 6 12 YES F: SR C: EI

LIresersStores hex 00 00 00 2C 02 80 00 in status registerd; this resets flags to Master Clear status (except(except for FIX 2, rather than FIX 4). X, Y, 12, T,L are unchanged.

[XROM: 10,13 SIZE: 000 SRL: 6 1? YES F: ML C: GTll

SJT@- Ri - REACTIVATE KEY ASSIGNMENTS

Transfers assignment bit maps stored in RX and Rx+1(?y B3

)

into status registers } and E. This reac-tivates the suspended assignments. Y, Z, T preservedin X, Y, Z; X, L lost (L contains original X incre-mented by 1). I nere

XROM: 20,06 SIZE: 002 SRL: 6 I? YES F: SR C: 40

m- RANDOM NUMBER GENERATOR

Use any'dafa register to hold seeds, say register k.Store Initial seed In Rk. To generate next randomnumber r, 0<r<1, key in k and XEQ " GID".

IXROM: 20,16 SIZE: 001 SRL: 5 % yes F: FR C: 36J

(ALl - RETURN ADDRESS TO DECIMAL

Converts a RAM return address (first return address:bytes 03 and 02-~third and fourth from the end-of-status register b) placed in X {by a RCL b, forexample) to a decimal byte address. See €Il regardinglegal byte addresses.

[}ROM: 10,51 SIZE: 000 SRL: 5 1? YES F: IF C: 66]

X8recei From AssoLuTE ADDRESS TN XOnly valid decimal addresses are 192 to 511. Contentof register accessed.is normalized (so USE WITH CARE)and that is the form returned in X. WARNING: if"NONEXISTENT" occurs, the alpha constant in X mustbe stored in status register ¢ to regain the former

PPC ROM POCKET GUIDE 25

Page 28: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

curtain position. Avoid using EEIwith flag 25 set.Y, Z preserved; X, T, L lost; L will contain the oldX - 16.

IXROM: 10,57 SIZE: 000 SRL: 4 TI? YES F: IF C: 60J

fii- RECALL bYields an address in the PPC ROM permitting identifica-tion of the port it is plugged into. XEQ €18, XEQ€ ; the last 4 nybbles will be xF12, where x = 9,

B, D, F for ports 1 through 4, respectively.

|;ROM: 20,52 SIZE: 000 SRL: 6 I? YES F: NS C: 161

m -STACK SORT

This routine arranges (sorts) the stack registers, X,

Y, Z, and T in numerical order, Towest value in T,

highest in X. If Flag 10 is set, the lowest value

will be placed in X, highest in T.

[XROM: 20,46 SIZE: 000 SRL: 5 I? YES F: S1 C: zfl

E- SMALL ARRAY SORT (< 32)

This routine sorts any block of registers in memoryinto ascending order (lowest numerical value in lowestregister) using a block control number in X of theform bbb.eeeii. Optimum time is obtained if block is< 32. For larger arrays use EXB. Routine finisheswith block control number in X. No ALPHA allowed.

BROM: 20,48 SIZE: A/R SRL: 5 1?2 NO F: S1 C: 47]

X)) - Laroe ARRAY SORT (> 32) ’

This routine sorts a block of registers in memory

from RO3 up,into ascending order (Towest numericalvalue in lowest register) using a block control numberin X of the form bbb.eee. For arrays of 32 or lessuse EZB. No ALPHA allowed.

IXROM: 20,47 SIZE: A/R SRL: 4 I? YES F: S1 C: 47l

- SIZE FINDERReturns # of data registers (above curtain) in X. X,Y, preserved in Y, Z.

h(ROM: 10,15 SIZE: 000 SRL 5 I? YES F: ML C: 64]

26 PPC ROM POCKET GUIDE

Page 29: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

EL:) - srore prspuay mooe

Saves a display mode in RX (actually the status of

flags 16 through 55). If display mode (any of flags16 through 55) is then altered, the earlier mode canbe restored via &I . Y, Z, T preserved in X, Y, Z;X, L Tost.

IXROM: 20,03 SIZE: 001 SRL: 6 I? YES F: SR C: 40

E- SELECTION WITHOUT REPLACEMENT

Applies only to block of consecutive registers. Firststore the following:

RO6: 1st register of selection blockRO7: number of registers in biock

As with @@ , use any data register to hold seeds, sayregister k. Initialize Rk with starting seed. Tomake next selection key in k and XEQ "E@". RO7counts number of items remaining.

lfitOM: 20,56 SIZE: var. SRL: 4 1? yes F: SM C: 26

B[@ - SUSPEND KEY ASSIGNMENTS

Stores assignment bit maps from status registers ande into Rx and Rx+1’ respectively, and clears both of

these status registers. Without these bit maps, theHP-41 assumes no user key assignments are in effect.Y, Z, T preserved in X, Y, Z; X, L Tost (L containsoriginal X incremented by 1).

[XJ{OM: 20,04 SIZE: 002 SRL: 5 1I? YES F: SR C: 40—1

BBs7ack To MEMoRY

This routine stores the stack registers X, Y, Z, T,and L into a continuous block of five registers, thelowest register number being stored in R06. To storethe stack into RO1-R05: 1 STO 06, XEQ BE3. Theinverse routine is @3.

[XROM: 20,565 SIZE: 005 SRL: 5 I? YES F: SM C: 26]

m- SHORTEN RETURN STACK

Recalls 5 return -pointers stored in Rx and Rx+1

by WL, combining them in status registers a and bwith the return to the routine calling 3. Every

PPC ROM POCKET GUIDE 27

Page 30: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

call on E@must be preceded (in time) by a call onM. Y, Z, T preserved in X, Y, Z; X, L lost (L

contains old X plus 1).

IXROM: 20,00 SIZE: 002 SRL: «» I? YES F: SR C: 6;'

m- SUBSTITUTE CHARACTER

With a single character in Y and an integer in therange of 1 through 10 in X (and with at most 13characters in alpha), XEQ E¥Breplaces the x-thcharacter {counting from the right) of alpha by the§ha€acter in Y. X, Y, Z preserved in L, X, Y; T, Lost.

IXROM: 10,39 SIZE: 000 SRL: 6 17 YES F: VK C: 63]

INA - SOLVE

SIZE 010 minimum. Program f(x) function. usesR0O6-R09. Store f(x) global label name in R06. Select

display se+fln?. Set flag 10 to view Iterations. Keystepsize ENTER} guess XEQ " E".

RO6: function label name RO8: f(x.)RO7: X RO9: dx,

IXROM: 20,10 SIZE: 010 SRL: 4 1? yes F: IG C: 43

IEX§ - s70Re ¥ IN ABSOLUTE ADDRESS XOnly valid decimal addresses are 192 to 511. Contentof register accessed is replaced by content of X.WARNING: If 'NONEXISTENT' occurs, the code in Z mustbe stored in status register ¢ to regain the formercurtain position.

[XROM: 10,56 SIZE: 000 SRL: 4 1I? YES F: IF C: 60

Y- srore bProvides a STO b with the ROM-mode interpretation.This permits ultra-fast ROM entry. See

YROM: 20,01 SIZE: 000 SRL:A/R 17 YES F: SR C: 40]

PRI - BceP ALTERNATIVE ‘

This roufine may be used in place of BEEP to produce ashort sound burst to be used as an audio prompt.

IXROM: 10,47 SIZE: 000 SRL: 5 I? YES F: BL C: 46

28 PPC ROM POCKET GUIDE

Page 31: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

B - BASE TEN TO BASE B

Store base b in R06 (2<=b<=19), Key base 10 number inX and XEQ "EI". Base b result is limited to 13digits in aipha and will automatically be displayed Ifflag 10 is set. The stack is left cleared. Inverse

routine 1s ED .

[XROM: 20,18 S1ZE: 007 SRL: 4 I? yes F: BD C: 53—[

NIV - TONE N (0-127)

This routine is effectively a TONE IND instructionwhich will produce all 128 synthetic tones. Placethe TONE number in X, XEQ EiB. Valid inputs: 0-127for TONE, 128-255 for TONE IND, 256-383 TONE, etc.

is most suitable for quick test/Demo. purposes.

[XRDM: 10,32 SIZE: 000 SRL: 3 1? YES F: VM C: 60]

I2)- urcover paTa ReaIsTERS

XEQ EMuses the contents of ROO established by thelast call on @@ to lower the curtain to its previousposition. Every call on @@must be preceded (intime) by a call on EEB. Otherwise you'll get MEMORYLOST. (See B®.) X, Y, Z, T, L preserved.

[XROM: 10,08 SIZE: A/R SRL: 6 I? YES F: LF C: 59

m- UNPACK REGISTER

R10: base b R11: register pointer = j

To recall the number stored in position k in registerJ» key k In X.and XEQ "{TB". The unpacked number Isreturned in X. See also W for |ist of bases anddata ranges. Inverse routine 1s .

LXROM: 20,44 SIZE: var. SRL: 5 17 yes F: M2 C: 61]

\ZLW - VIEW ALPHA

Like AVIEW, but EI¥never causes the program to stop.If the printer is plugged in, turned on, and-enabledby Flag 21 being set, then the alpha register is alsoprinted. The status of Flag 21 remains unchanged andno stack registers are used.

[XROM: 10,07 SIZE: 000 SRL:.6 I? YES F: LF C: 59

PPC ROM POCKET GUIDE 29

Page 32: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

A4S - ViEw FLAGS

XEQ W@ displays the numbers of those flags which areset in groups of four (although the last group maycontain Tess than four). X and Y are preserved, Z, TL are Tost.

’XROM: 20,58 SIZE: 000 SRL: 4 TI? YES F: SM C: 26

s

VK E VIEW KEY ASSIGNMENTS

Defaults to 82143A Printer function PRKEYS if printeris connected. Otherwise, displays keycodes assigned,key by key from top to bottom, and from left to rightof the keyboard. The consecutive displays show eitherone number or two for a single key: negative numberscorrespond to shifted keys. On compietion of EIAthestack is cleared.

|XROM: 10,36 SIZE: 000 SRL: 2 1? YES® F: VK C: 63|

WAJ- VIEW MANTISSA

Views full mantissa of number in X. Leaves stackintact, but alters L and alpha register.

[XROM: 10,26 SIZE: 000 SRL: 5 I? NO F: VM C: 60]

&) - veriFy size

Insert the sequence n, XROM &EB, FC?C 25, PROMPT in aprogram to verify that the SIZE is at Teast n. If itis not, the message "RESIZE>=n" will be displayedfollowing a quick tone. X, Y, Z, and T are preservedin L, X, Y, and Z. Alpha is not disturbed if SIZE issufficient.

IXROM: 10,30 SIZE: 000 SRL: 6 I? YES F: VM C: 60

E5) - vex 7o pecivaLConvert two hex digits--no more, no less--from thealpha register to the decimal equivalent (0 through255). X is preserved in Y, Z, and T.

b(ROM: 10,25 SIZE: 000 SRL: 5 I? YES F: LB C: 71]

m- XROM ENTRY

This routine first constructs a local return pointer(to the PPC ROM) between (in status register b) theprogram pointer in EXland the return to the RAM

30 PPC ROM POCKET GUIDE

Page 33: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

routine calling EI®. It then proceeds to replacethis return with what were the last two bytes inalpha register M at the time of entry to EH.These two bytes constitute a pointer to any ROMprogram line, set up by the user prior to calling EX.A RTN activates this ROM entry address, and any sub-sequent END or RTN in the ROM program returns thepointer to the RAM program which called E&.

To set up the pointer in alpha register M, prior toprogram execution, position the pointer at the desiredROM Tine entry and manually perform the sequence (inRUN mode) CLA, RCL b, STO M, ASTO n, where Rn is any

data register you want to use. In the RAM programwhich is to enter the specified ROM line place thesequence CLA, ARCL n, XEQ ER. X, Y, Z, T and L arepreserved and aipha is cleared.

[XROM: 10,19 SIZE: 000 SRL: 5 I? YES F: ML C: Jl

PR - XROM INPUTS FOREED

This routine provides the M or BI3 bytes for use insynthetic instructions or synthetic key assignments.An XROM number of the form AA, BB is converted by AENTER B XEQ . The Y register will contain the Bbyte, the X register the A byte. Example. AssignPRA to key 31. PRA = XROM 29,08. E8- 167, 72.Assign with 167, ENTER, 72, ENTER, 31, XEQ &I®.The printer is not required.

lXROM: 20,57 SIZE: 000 SRL: 4 I? YES F: SM C: 26

- ZREG FINDERXEQ € yields. the number of the first register of thestatistical block of 6 registers. If the result isnegative, the statistical block Ties below the curtain,but is subject to statistical commands (at the user'sriskY.

[XROM: 10,14 SIZE: 000 .SRL:5

-

I? YES F: ML C: 64

E- LREG CURTAIN EXCHANGE

Interchanges pointers in status register ¢ to thestatistical register block and to R00. ProvidedSIZE > k+6, the sequence IREG k, XEQ E&makes theformer Rk now ROO, {(but statistical registers commands

should not be used: EERyields -k). A second XEQ

PPC ROM POCKET GUIDE 31

Page 34: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide

re-establishes the former position of the curtain (ROOagain becomes Rk). X, Y, Z preserved; T lost.

BROM: 10,21 SIZE: A/R SRL: 6 I? INP F: ML C: (;]

NOTES

32 PPC ROM POCKET GUIDE

Page 35: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide
Page 36: PPG ROM POCKET Q@UIDE · 2020. 11. 22. · PPC ROM POCKET GUIDE This pocket guide is preliminary. A lack of time, and inadequate inputs did not permit a "fine tuned" pocket guide