Post Reply 
(HP71B) ASM question
08-17-2024, 01:40 PM
Post: #23
RE: (HP71B) ASM question
Lets give more flexibility in working with the float stack in Forth.

the entry point listed in the new words..
Code:
=OX     EQU #2FBD0            X address

Code:
* X<> exchange the value in the variable with the value in X like the HP41 command
*       use: FVAR1 X<>   tested 15july2024
       WORD 'X<>'
       P=     0
       LC(5)  =OX             put X-address into C(A)
       CD0EX                 exchange data pointer address D0 with C(A)
       R2=C                  save D0
       A=DAT0 W              A = value of X from its address in C(A)
       R0=A                  R0 = X
       C=DAT1 A              copy data at address in D1 into C(A)
       CD0EX
       A=DAT0 W              copy data at address in D0 (in C(A)) into W in A
       R1=A                  R1 = Reg value
       P=     0
       LC(5)  =OX             put X-address into C(A)
       CD0EX                 exchange data pointer address D0 with C(A)
       A=R1
       DAT0=A W              X has now value of Reg
       C=DAT1 A              copy data at address in D1 into C(A)
       CD0EX                 exchange C(A) with D0
       A=R0
       DAT0=A W              value of X into reg
       C=R2
       D0=C                  restore D0
       D1=D1+ 5              return nothing on data stack
       RTNCC

Code:
* X<>Z exchange the HP41 registers. tested 12 July 2024
       WORD 'X<>Z'
       P=     0
       LC(5)  =OX             put X-address into field A of register C
*                               low order 5 nibbles
       CD0EX                 put data pointer D0 into C(A)
       R1=C                  save D0 into R1
       C=DAT0 W              C = value of X (which is in D0)
       D0=D0+ 16             D0 has now Y addr
       D0=D0+ 16             D0 has now Z addr
       A=DAT0 W              put value of Z into A via addr in D0
       DAT0=C W              Z = value of X
       D0=D0- 16
       D0=D0- 16             D0 -> X
       DAT0=A W              X = value of Z
       C=R1
       D0=C                  restore D0
       RTNCC

Code:
* X<>T exchange the HP41 registers, tested 12 July 2024
       WORD 'X<>T'
       P=     0
       LC(5)  =OX             put X-address into field A of register C
*                               low order 5 nibbles
       CD0EX                 put data pointer D0 into C(A)
       R1=C                  save D0 into R1
       C=DAT0 W              C = value of X
       D0=D0+ 16             D0 -> Y
       D0=D0+ 16             D0 -> Z
       D0=D0+ 16             D0--> T
       A=DAT0 W              put value of T into A
       DAT0=C W              T = value of X
       D0=D0- 16
       D0=D0- 16
       D0=D0- 16             D0 -> X
       DAT0=A W              X = value of T
       C=R1
       D0=C                  restore D0
       RTNCC

Code:
* X<>L exchange the HP41 registers, tested 12 July 2024
       WORD 'X<>L'
       P=     0
       LC(5)  =OX             put X-address into field A of register C
*                               low order 5 nibbles
       CD0EX                 put data pointer D0 into C(A)
       R1=C                  save D0 into R1
       C=DAT0 W              C = value of X
       D0=D0- 16             D0--> L
       A=DAT0 W              put value of L into A
       DAT0=C W              L = value of X
       D0=D0+ 16             D0 -> X
       DAT0=A W              X = value of L
       C=R1
       D0=C                  restore D0(A) from C(A)
       RTNCC

More words needed like example Z<>L ?
this word is
X<>Z
X<>L
X<>Z
therefore Z<>L could be a new Forth word (lower need since this is a combination of the 3 above new words).

As usual, remarks are welcomed.

HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(HP71B) ASM question - floppy - 07-15-2024, 04:50 PM
RE: (HP71B) ASM question - ThomasF - 07-16-2024, 06:05 AM
RE: (HP71B) ASM question - floppy - 07-16-2024, 07:22 AM
RE: (HP71B) ASM question - rprosperi - 07-16-2024, 12:07 PM
RE: (HP71B) ASM question - ThomasF - 07-16-2024, 07:00 AM
RE: (HP71B) ASM question - floppy - 07-23-2024, 05:54 PM
RE: (HP71B) ASM question - rprosperi - 07-23-2024, 06:10 PM
RE: (HP71B) ASM question - floppy - 07-29-2024, 09:25 AM
RE: (HP71B) ASM question - brouhaha - 07-30-2024, 06:47 AM
RE: (HP71B) ASM question - J-F Garnier - 07-30-2024, 07:54 AM
RE: (HP71B) ASM question - KeithB - 08-03-2024, 10:56 PM
RE: (HP71B) ASM question - brouhaha - 08-05-2024, 04:21 AM
RE: (HP71B) ASM question - J-F Garnier - 08-05-2024, 02:12 PM
RE: (HP71B) ASM question - J-F Garnier - 07-30-2024, 07:28 AM
RE: (HP71B) ASM question - brouhaha - 07-30-2024, 06:51 AM
RE: (HP71B) ASM question - floppy - 08-03-2024, 04:47 PM
RE: (HP71B) ASM question - rprosperi - 08-03-2024, 05:06 PM
RE: (HP71B) ASM question - floppy - 08-03-2024, 05:40 PM
RE: (HP71B) ASM question - floppy - 08-04-2024, 11:45 AM
RE: (HP71B) ASM question - rprosperi - 08-05-2024, 11:50 AM
RE: (HP71B) ASM question - floppy - 08-17-2024, 08:46 AM
RE: (HP71B) ASM question - floppy - 08-17-2024 01:40 PM
RE: (HP71B) ASM question - floppy - 08-22-2024, 09:32 AM
RE: (HP71B) ASM question - floppy - 08-23-2024, 07:37 AM
RE: (HP71B) ASM question - floppy - 09-03-2024, 03:36 PM
RE: (HP71B) ASM question - floppy - 09-24-2024, 12:00 PM
RE: (HP71B) ASM question - J-F Garnier - 09-25-2024, 07:18 AM
RE: (HP71B) ASM question - floppy - 10-07-2024, 11:24 AM
RE: (HP71B) ASM question - floppy - 10-16-2024, 10:00 AM
RE: (HP71B) ASM question - floppy - 10-18-2024, 08:55 AM



User(s) browsing this thread: 1 Guest(s)