afchapt3.html
p. 21
III) S I G N I F I C A T 1 0 N D E C M H I F F R E S

The 4ç, similar in that to all the computers, treats only electric signals. Whatever the zone ménoire, these signals are transcribed in the form of ehiffres, these figures are gathered by Registres, Octets or groups of bytes.

DOES III-1 NUMBER OR LETTERS?  NNN, STANDARDIZATION:

Certain instructions of the 4Ç act on a complete register. Most known are STO or RCL, but we have also ASTO, ARCL, VIEV and AVIEV...

To quote these instructions simply shows that the contents of these registers can be regarded either as a number, or like characters (letters, signs or figures).

How to know?

a) a register contains 7 bytes or 14 digits or 56 bits. These three ways of speaking indicate the same contents.

b) **time-out** one agree by par convenience to give with certain zone of a register a name related to representation of number and to number the digit of 0 with 13 (of right-hand side on the left). The number + 1,234567890 10+21, for example, is represented by:

0 1 2 3 4 5 6 7 8 9 0 0 2 1  
13 12 11 10 9 8 7 6 5 4 3 2 1 0 < - number of the bit

sign

mantissa

(ms)

mantissa

sign

of the exhibitor

(XS)

exhibitor

 

c) we can find in a register:

- a positive or negative figure, with a positive or negative exhibitor,


p. 22

- alphanumeric caractéres,

- other thing., which we will appelerons Nombre Not Standardized (NNN).

d) If digits 0 and 1 and from 3 to 12 lie between 0 and 9, if MS=0 or 9 and XS=0 or 9, the register contain a decimal number. The sign + is represented by 0, the sign - by 9. Of surcroit, if the exhibitor is negative it is represented by his complement.

For example, to know the representation of E-21 (E for exhibitor of 10) to make 1000-21=979, the 3 digits of right-hand side (sign included/understood) are obtained:

+1,234567890 -21 gives:

:0:1:2:3:4:5:6:7:8:9:0:9:7:9:

Also let us notice that the number is always stored in SCI 10 and that neither the comma nor the E of the exhibitor is coded, being always in the same place. Alternatives FIX or ENG intervene only with the display.

E) If the first digit is 1, the HP considers that:

- the first byte is only one indicator,

- the 6 following bytes are characters and displayed like such.

The null bytes present on the left, on the right or in the medium of character strings are ignored with the display, this one being then justified on the left.

F) All other value of the digits, for example a value higher than 9, entraine the existence of a NNN.

A NNN can be stored and recalled without problem in a register of state.

A NNN can be stored in a usual register but it is then modified by the instructions RCL, VIEV or X< > - -. Attention, this modification intervenes not only on the pointed out value, but still on the register him even. This modification is called.standardization.

**time-out** if the sign of mantissa be 0 or 9 the NNN be transform in decimal ordinary, contain no digit higher with 9, a digit higher with 9, for example B, be then interpret like its against value decimal 11 and the 1 of " reserve " add with digit of left:

lB ===> 21

If only XS is abnormal, standardization defers on the digit of left possible reserve. If, so there remains 0 in XS (case of the digit A) this 0 is maintained. If not one 9 is set up.


p. 23

In all the other cases " standardization " amounts replacing value ms by 1, the register being then regarded as alphanumeric.

An " abnormal " exhibitor, in addition to the problems of standardization, causes a curious display, without much known practical application until now.

The synthetic programming not making it possible to avoid the disadvantages of standardization, of the functions microcodes some were create by club PPC for that, but to make use of it... to see chap VI.

H) the NNN in fact are made of hexadecimal digits. Under certain conditions (FIX 9...) the HP is able to display these hexadecimal digits. It uses the characters available following figures 0-9 in the table of the codes. One calls that the " natural notation ".

Natural notation

Hex

displayed

With

Å

B

;

C

<

D

=

E

>

F

?

III.2 OF THE CHARACTERS:

a) We saw that the HP treats only numbers, but that those are sometimes interpreted like characters, letters, signs or figures.

Why make simple, when one can make complicated? According to moments', a same character could be represented by a code or another. For the moment 3 cases are indexed:

- display

- printers

- microcodes

The first two cases, that any programmer can meet are indicated in the table of the codes. The third case is given fig. 8, p. 24.

Let us notice that in the three cases these codes will be regarded as characters only If the HP " were prevented " that it must be thus, i.e.:

- in the register ALPHA, when one uses the specialized functions or AON, it considers whereas all that is in this register represents a character,

- in a normal register in the conditions indicated to III.l.e, p. 22,

- in a normal register with function ARCL, if the contents are numerical, it is transformed into its equivalent in characters and is placed in alpha.


Display

Printer

Fig 8 Characters microcodes

Code characters when they are used by microcodes

(reference: PPC-T Australia and Robert Groom, revised by John McGechie)


p. 25

Easy way HP (buffer): Understand you now that (in a register):

10 4D 4F 4TH 54 52

mean

10: the characters according to are alphanumeric

4d: M

4f: O

4th: N

49: I

54: T

52: R

If we could point out this register we let us have MONITR with the display. In fact if you have the means of testing with the buffer, you undoubtedly have also access to the functions microcodes of them PPC or to PPC ROM.

It should then be noticed that a primitive version of this module, diffused on EPROM within the club was called HP IT MONITOR. In the monitor as in the HP IT Development one finds, with addresses 879 (HEX) and following of the code the characters which are established in the register of state of the buffer.

In an unobtrusive machine (MEMORY LOST) made 5, BSIZEX (SETBUFX with the EPROM MONITOR) follow-up of 194 CHS NRCL (microcodes) or 194 X-ray (PPC ROM), you obtain " MONITR well ".

b) The table of the codes (p. 26) is a summary of the most current significances of the codes of the HP-4Ç. It is organized so that each possible vaLor that can take a byte is represented by a box.

A byte perhaps represented by 2 hexadecimal digits, for example: Á=digit 3 and digit A

In the table, the digit of left is that of the row, it must thus be read with the extreme right-hand side of the table.

Digit 3 thus indicates the fourth line starting from the top of the table, that which starts with STO 00.

The digit of right-hand side is that of the column; it must thus be read with the top or the backhander. Digit A thus indicates the column starting with LBL 09.

With the intersection of this line and this column is the box of the byte Á.

  STO 10 < - zone 1
zone 4 - > 58: Å < -zone 2 (2 characters)
zone 5 - > 58: < - zone 3

We distinguish 5 zones in this box, which will be analyzed hereafter. Let us say immediately that the zoroe 5 represents the decimal value of the byte considered.


page 26

Figure 9: count of the codes

This version of the table of the codes is due to Keith Jarret.

This table exists in version of pocket, with the format card to be played, and with a répérage color of the instructions (available to the Editions of Cagire)

Note edition Web: In the edition paper, I did not have the means of making color impression. Here Ca is worth the blow to give you the true model...

If you find that the two images above are not enough readable, here the files jpg in full width

card one (182ko)

card two (227ko)


p. 27

c) zone 2 of the box represents the interpretation made by the display of the code. Never forget that the display is a peripheral of the HP like the card reader or the printer. The HP sends codes to him, the display does of them what he wants. See in appendix X, p. l13, its exact behavior. The bytes 2c, 2nd and Á (that of the example), are two represented in zone 2. Notice that it is about ", ", ". " and ": ", who have with the display a special column. The second character appears only in very rare situations.

The display represents nova Å for all the bytes of second half of the table, this zone was thus removed there.

d) Zone 3 of the box represents the interpretation, made by the thermal printers HP, of the codes. It is interpretation with the standard HP (" 8 bits "), the printer HP IT can in certain cases react differently (to refer to the handbook).

It is significant to notice that the printer reacts normally only to the characters of first half of the table (code 00 with 7F).

The codes of second half are sometimes ignored, sometimes printed, it is for that that they are nevertheless announced.

But especially certain codes, when they are transmitted to the printer, cause the éxécution of functions of the printer.

One can thus cause jumps of characters or columns (SKPCHR or SKPCOL), print the buffer of the printer or obtain the same effect as flags 12 and 13 (double width or tiny, to see fig, 10, p. 28). The printer HP IT goes even further.

Notice that certain codes act even during the listing of a program, which gives rather curious results, as you can see it with the demonstration program Fig, It, p. 30.

For microcodes, the use is done with special instructions (see chap VI).

E) zone 4: give the value of the byte used like postfixe (cf III.3, B, p. 29).

III.3 OF the INSTRUCTIONS (zone 1)::

A byte allows 256 combinations. This significant number is however not it enough for a HP-41, and certain instructions comprise several bytes, even if they occupy only one line of program.

a) Functions with a seuL byte: They appear in the zone 1des boxes of the table, they use the Dl codes with 8F except the codes lD, lE and lF. When the HP meets these codes, it carries out the corresponding function. There is no problem particular to announce except...


p. 28

Figure 10

Check codes of the thermal printers HP

A0 with AF jump 0 with F characters
B0 with B7 jump 10 to 17 (decimal 16 to 23) characters
B8 with BF jump 0 to 7 columns
  Width type left Majuscule

minuscule

D0 simple character M
D1 simple character m
D2 simple column M
D3 simple column m
D4 double character M
D5 double character m
D6 double column M
D7 double column m
E0 like PRBUF    
E8 like ADV    

with moreover, for the printer HP IT in mode 8 bits:

0D

Carriage return

0A

With the line

80 with 8F

In column mode, prepares with reading and printing

1 to 16 bytes of code bars

C0

Format: if in the first cell, centered text

if in the medium, text separated into two (one justified on the left, the other on the right)

FC or FD

Mode exhaust (Escape)

FE

Active ADV

FF

Ignored ADV


p. 29

Byte 00 (no one). Met in a program, it is simply ignored, it will be generally eliminated with next " PACKING ".

' During a modification of a program, an unobtrusive function is replaced per as many null than it comprises bytes. An added function takes the place of null available where one wants to put it. If there is not of them enough the HP releases a whole register by pushing the following instructions downwards. The register thus released is filled of null.

If two numbers are present in report programs without separator (made 1 alpha, alpha, 2) they will be however separated by no irremovable.

The null ones can also exist like elements of functions to several bytes.

The byte F0, completely in bottom on the left of the table, is him also an instruction of only one byte. Taking into account its relationship with the lines of text it will be studied in III.3.d, p. 34 (character strings).

The bytes lB and lC represent EEX and NEG respectively. EEX is the Input of EXposant and appears in the form E (1 E2) in a program or in alpha.

NEG is the effect CHS acting directly on a numerical input (negation) as it - de1 E-2. Curieusement 25 CHS in a program is carried out more quickly than -25 (with the same effect, not to confuse with the Subtraction). Know why? (with the fact, to do it, 25 ALPHA ALPHA CHS).

Bytes AF and 80 are NOP (Not 0Pérants) like prefix.

b) Functions on two bytes:

The first byte is called Préfixe and second Postfixe. The prefixes are given to boxes 90 to BF more EC and CF. Zone 1 of the box represents the function. All the bytes of 00 to FF can be used like postfixes. The direction is then that of zone 4 of the box. As follows:

RCL 79 is coded 90 4f

RCL IND 32 are coded 90 A0

Let us notice that, for codes 00 to 63, the value of the postfixe is not different than the decimal value of the byte. Let us notice especially that, by means further described (chap. V), it is possible to affect indeed, with does not matter that it function with 2 bytes, any postfixe (the result is however not always useful).

Zone 4 gives the way in which this postfixe is displayed by the HP and, when it is different, interpretation by the printer:

M=[ P=1
N = \ Q = _
O = ] | - =ä

Also let us notice that the postfixes second half of the table correspond to the indirect functions. This indirection is given by the postfixe and not by the prefix.


p 30

Certain programs are quite difficult to list! With the display, O, sees for the lines of text:

02 äCÅV

05 äKÅK

08 ä2ÅD

11 äYÅÅ

Draw the conclusions which you will want!

(solution)


page 31

Byte AE has a double function: GTO IND if the postfixe comes from bytes OO-7F, XEQ IND if it comes from bytes 80 to FF.

AE 08 is GTO IND 08 whereas

AE 88 is XEQ INO 08

The bytes A0 in A7 are called XR0M. These bytes are prefixes, but not exactly in the same direction as the others.

Each function of a peripheral is associated with a code with two bytes. This one appears when the peripheral misses or if the program, recorded beforehand on card or cassette, is read by a machine not equipped with these functions. It is the case of WDTA (Write DaTA, recording of the data of the Card reader) or of ACSPEC (ACCumulate SPECiaL, processing of a special nature by the printer), including the nonprogrammable functions (VERification, of the card reader), the name of the modules like " CARD READER ", and even if the module is integrated in the machine, like the functions clock of the 4Çx.

Here it will be necessary to go down on the level from the bit to include/understand. Two bytes make 16 bits. The first five bits (on the left) are used as prefix (10100), remain 11 bits for the postfixe. These 11 bits are divided into 5 bits for the number of the peripheral and 6 bits for the number of function in the peripheral.

With 6 bits one can count into decimal up to 64 (in fact from 0 to 63), with 5 bits one can count up to 32. THERE are thus 32 possible numbers for the peripherals and 64 possible functions in Each peripheral.

Let us see an example:

WDTA has number XROM 30,07, that is to say into binary

XROM=10100

30=11110

07=000111i

that is to say

1010

0111

1000

0111

With

7

8

7

from where codes XROM 30,07=A7 87

Also let us notice that the byte of prefix leaves side the two bits of right-hand side of the number of peripheral. It is what explains why, to each box of the table, correspond 4 peripherals (2 bits=4 possibilities).

Boxes 90 and 91 : with an aim of gaining place in memory, HP envisaged functions STO and RCL with only one byte for the most used registers (rows 2 and 3 of the table). It is possible, but not very advantageous to build RCL and STO with two bytes with prefixes 90 and 91 and postfixes of 00 to 0F. In fact, before execution, in microcodes, the HP carries out this transformation of 1 towards 2 bytes.

A similar problem arises for the numerical labels. An additional remark is essential here. When one assigns to a Label (prefix CF) a postfixe 66 with 6F, the table shows that one obtains LBL A with LBL J which are " local " labels A-J. One sees thus that the local labels are only camouflaged numerical labels (from 102 to 111).


page 32

Figure 11

Complements on the XROW:

One can be astonished that I indicate like prefixes XROM a number of 5 bits. This is due to the fact that the XROM do not use that half of line A, the 5th bit is thus always nuL.

However iL is necessary for us to speak here about a particular phenomenon which is that of the displays of synthetic XROM.

You will see (v.3, p. 38) a program which enables you to assign with a key any pair of codes which will then come to be placed in the registers of assignements at the sites planned for the codes of function.

The only functions which can legally occupy two bytes in the registers of assignement are functions XROM. When the HP reads an assigned function, the program charged to display the name of the function is satisfied to check that the first digit of the function is different from 0 and then displays a number XR0M calculated starting from the 3 following digits.

Does the HP suppose (stupidly?) that if the first digit is 0, it can be only A. same message XROM -, - thus corresponds to 15 functions (first digit ranging between 1 and F). This type of XR0M (which is displayed, but does not fit in a program) thus can apparaitre until XROM 63,63.

If X is the decimal value of the first byte of the function and y the value of the second byte, XR0M i,j is calculated by:

I = 4 (X MOD 16) + INT (y/64)

J = y M0D 64

One can deduce from this Formula One a method to find without calculation number XROM starting from the table of the codes (method described by Keith Jarett).

To know number XROM of an instruction (ST+ IND M for example), to see that ST+ (the first byte) is in the same column (2) as XR 8-11, indeed the number of column is not different than the instruction code modulo 16; therefore we have a XROM 8, 9, 10 or 11 according to the second byte of the instruction code (IND M). the thick horizontal lines separate the table in 4 horizontal zones which correspond respectively to the number. Here, the first zone corresponds to XR0M 08, -; the second with XROM 09, -; the third with XROM 10, -; the fourth with XROM 11, -.

The second part of the XROM is given by the position of the instruction in the zone. This position is the number of the box in the first zone; a simple carryforward at the first zone makes it possible to know it when the code comes from zones 2, 3 or 4. Ici, IND M has number 53, ST+ IND M will be thus XROM 11,53.

In the same way, if you assign with program KA (chap v) ADV IND E, therefore 143/255 (decimal) you will have with display XROM 63,63 and in program ADV, quite simply. Of course ADN IND E does not make any sense, and moreover the use of the table is not so convenient for the XROM higher than 31.


p. 33

Row B: Separately the box B0 which is not used like prefix, we deal with particular case of functions to two bytes.

The prefix is with him only the function, GTO 01 or GTO13. The deuxiéme byte is null with the introduction of the program. To the first execution of the GTO, the HP will calculate the distance from jump and will record it in this free byte. This operation is called compilation.

A byte number 2 no one indicates that compilation was not made. After compilation, this second byte is organized thus, if one numbers the bits 7 6 5 4 3 2 1 0 one a:

bit 7=sens of jump: 1 if the jump is done towards a line of program of larger number, 0 in the contrary case,

bits 0, 1, 2 and 3 = integer of registers,

bits 4, 5 and 6 = a number of remaining bytes.

The distance is counted as follows: " a number of bytes located between the end of the GTO and the beginning of the LBL ", with the result that in a jump ahead neither the GTO nor the LBL is counted, whereas in a jump behind two bytes of the GTO and the byte of the counted LBL sonit.

The maximum distance from the label is thus F registers and 7 bytes or l12 bytes. The minimal distance is 0.

If the label too is Far, the second byte of the GTO is Laissé with 0 and the HP carries out all this work each time...

c) Functions out of 3 bytes

They are the rows D " GTO " and E " XEQ ".

The case is similar to that of the GTO with 2 bytes but with a larger distance from jump which justifies the additional obstruction. To notice that it is the only possible form for the XEQ.

3 bytes make 24 bits, they are organized as follows:

2 bits are used as prèfixe: 11

2 bits give the type GTO = 01, XEQ = 10

3 bits give the remaining number of bytes (from 0 to 7)

9 bits give the number of complete registers (from 0 to 511)

1 bit gives the direction: 1 forwards, 0 backwards

7 bits give the description of the label for example:


p. 34

1101:

100

0:0000:0010:

1

000:0100

GTO

4 bytes

2 registers

+

LBL 04

This example was selected to show that it is perfectly possible to use a GTO with 3 bytes to seek a label with 1 byte... The codes here are D8 02 84.

The account of the bytes is done between the end of the first byte of the GTO or XEQ and the beginning of the LBL. Donc in a jump forwards, the two bytes of compilation of the GTO or XEQ are counted, but not the LBL. In a jump backwards, the first byte of the GTO or XEQ is counted thus that the 1 or 2 bytes of the LBL.

Functions with a number of variable bytes

d) Character strings:

The bytes of row F are prefixes announcing of the character strings in a program. We saw how one identifies the characters in a register. In a program, this identification is done by a Fn byte where N is the number of codes which, read after the prefix, must be regarded as characters and be placed in alpha.

The maximum is thus FF, that is to say 15 characters. The minimum is F0. There is no character to put in alpha and indeed alpha is not disturbed. In fact this code is used to characterize the registers of assignement and cannot be obtained simply in a program.

Introduced into a program in an artificial way, it consequently appears nonoperative (NOP) and, useful as stops hole in certain cases after ISG or DSE. Exemple:

" DODIN " = F5 44 4F 44 49 4TH

Character | - (7F) placed just after the prefix announces to the HP that the register alpha should not be unobtrusive before placing new the chains there (function SUSPENDS).

E) total-END Labels:

" Total " bytes CO-CD, play a double role: they identify at the same time the END and the labels alphanumeric.

End

If the third byte of a line starting with the byte Ca (with included/understood between 0 and D) is a byte of Fn text, then the line is a label. If not it is a END with 3 bytes.


p. 35

In the two cases the second, troisiéme and fourth digits (starting from the left) give the distance to which is the END or LBL preceding alpha in the memory (in the order of the CAT 1). This distance is coded as for the STO with 3 bytes (cf III.3, p. 33); it is counted of beginning of label at the beginning of END etc.

A label (or END) starts with Cx with into binary:

1 1 0 0 A B C D

l100 = C

ABC = remains bytes cash the distance

D, joint with the following byte = a number of registers.

Caution! EC = x< > - - and CF = numerical LBL, therefore one cannot have ABC = 111 bus whatever the value of D one would have EC or CF This is not serious except that, when the number of registers is maximum one can add to it only 6 bytes against 7 for the GTO and XEQ to three bytes.

This gets the " chaining " of the labels in memory. A GTO or XEQ alpha starts to seek a label from there fine memory. (the permanent END.), and goes up LBL in END until the first label which is thus identified by the first two bytes C0 00.

In the END 5th and 6th digits (starting from the left) are used to give information:

The 5th digit is 2 for permanent END (END.), 4 for a private END, 6 if it is the END. and that it is private.

The 6th digit is 0 for the END. after a MERORY LOST, 9 if the program is not packé, D if the program is packé.

Labels

They are the alphabetical labels. The first two bytes are thus made of C followed by the 3 digits of distance. The third byte is a prefix of text Fn, the fourth byte and first character, invisible for the utiLisator is used to record possible assignement (code of the key, the same one as in the registers of assignement). The following bytes spell the name. Blow, N of Fn is de1 larger than the number of letters of the name.

A LBL " OF ", only in memory, assigned with the key (A) is coded C0 00 F3 Ol 44 45.

Codes 16 and lE are those of GTO and XEQ alpha, they are followed of an ordinary pulpit of characters, for example:

GTO " DODIN " = 16 F5 44 4F 44 49 4TH

Finally the byte lF which is displayed Wä is inactive like prefix. At the end of 1983 various uses of this code were discussed in club PPC-T without a convenient application being still found.

The XEQ " ALPHA " change into XROM " ALPHA " if the program in question (ALPHA) is a program in current language (and not microcodes some) placed in a ROM. It is the case for example programs of the Math module.


p. 36

III-4 ORGANIZATION OF THE PROGRAMS IN ROM:

This organization is mainly required by the possibility of use of the function COPY, which makes it possible to recopy a program in read-write memory.

III.4.1 check words:

The program in ROM is preceded by a word by code indicating in hexa the number of registers necessary to copy the program, round with the top.

The second word gives (coding 244): If the program is private, digit of left equal to 2 (binaire11), à1 (01) if not. The digit of right-hand side is always to 0 (0000). The digit of the medium gives the number of bytes used in the incomplete register.

The following words are the bytes of the program. The two overhead bits (since the words in ROM make 10 bits instead of 8 in RAM) are on the left. They are worth 01 if the byte is the first of an instruction, 00 differently. At the end of the program, the last byte of the END (and thus of the program) is 22F.

Iii.4.2 Chainings

Of course, unless being maso, it is necessary to place in ROM of the compiled programs and thus with the bytes of distance suitably filled.

The jumps of the GTO and XEQ are coded directly in bytes, which allows a maximum distance slightly higher than that usable in RAM Because of compilation the labels are not more useful (except copying in RAM the program). The distance is calculated with: address last byte inclu, less addresses first byte inclu more 1.

The chaining of the alphabetical labels is made as in RAM (cf preceding page).

For the first label a remark is essential. At the time of the copy in RAM the HP releases the desired number of registers under the END.. This one is transformed into normal END. The block of registers thus released is at the bottom of the memory, its END is thus the new END. and must be tallied has right of its register. The whole of the program copied is thus packed downwards and it is the first register which is incomplete one a:

X X X X E N D programs preceding in RAM

X X X L A B E beginning of the program copied

L X X X X X X

For example. The number of occupied bytes of this first register being the number which appears in the second word of tète. It is necessary to take account of this provision to calculate the distance between the first label of the program and the following END: the empty bytes of the first register must be counted. See numerical example p. 80.

End of the third chapter.