6-16 The Development Library
You can define the field mask by using the
D<:74EG where n is a number between 1 and 7 to define the field Fn
using the mask in Cw as in this example:
EO!7788888888888877!D<:7E43!
EB!3HVaQceRXBSO4<78!
EO!87<4OSBXRecQaVH3!
B[B•Od73!
A is now equal to:
37VaQceRXBSO4<73!
ie: the instruction on F fields equate to:
reg1= (reg1 & ~ mask) | ((reg1 & mask) operation (reg2 & mask))
These new fields are available for all instructions that previously used the so called ‘f’ encoding and includes the
following instructions:
Reg=Reg&Reg.f, Reg=Reg!Reg.f, DATx=Reg.f, Reg=DATx.f, Reg=Reg+Cte.f, Reg=Reg-Cte.f, RegSRB.f,
RReg=Reg.f, Reg=RReg.f and RegRRegEX.f.
4.2.1.2 Other notes
You should read documentations on the internal structure of RPL objects (
HTUwww.hpcalc.orgUTH has good documentation)
D0, D1, Ba and Da are used by the system (next RPL instruction pointer, RPL stack pointer (@@object on level 1
of the stack), start of free memory and free memory in 5 nibble blocks). The SAVE instruction will save these
registers in dedicated memory areas, the LOADRPL instruction will restore them and continue the execution in the
system.
Please consult documentation on memory map for more information.
4.2.1.3 New instructions
In addition to the F fields, the following new instructions have been created:
r=s.f, r=r+s.f, r=r-s.f, r=r*s.f, r=r/s.f, r=r%s.f (modulo) r=-s-1.f (logical not), r=-s.f (mathematical not), r=r<s.f
(left shift), r=r>s.f (right shift), r=r^s.f (logical xor).
r=1.f (alias for r=r/r.f) has also been created.
Note 1: any combination of the A, B, C and D registers can be used (notated r and s here)
Note 2: all field (including F1-F7 fields) are valid
Note 3: MASD will always choose the shortest version of the instruction (e.g.:
B[B'SdB will use the standard!O8
encoding AND affect the carry)
Note 4: the carry is not affected by these instructions.
The following other new instructions have been added (see description in the ASM syntax section):
=B:6N<b!…y)?! >LDELY! K<ML=! OL=76>4!
;D:[3d?! YDOK<<=! D<K6BE! S6>B22b!
b;D:[3d?!f!h! D<::6M<! L5:SP:! K<D<:LD!
D<:7E4-30e/! D<:E=<4! MLN<52! K<7K<D;4!
L77! D<:L774! MLN<4=! B5:L:<D:!
K2EH! ;DOK<<=! BKMDPD! BOO<DDD4!
r<P4=! 5=O=7>4! BKMDB:! 2LK::B>b!
OK:M2! ><::6M<! K<ML77! M64B22b!
S<<2H! !
4.2.2 Skips
Skips are a first step from ML to a third generation language, even if they are only another way to write ASM
instructions.
Skips are wonderful as they allow you to:
- structure your program
- avoid using gotos
- make programs and piece of code that can be easily copied and past (because there is no label)
The foundation of Skips is the Block structure.