Post Reply 
(HP71B) ASM question
08-03-2024, 05:40 PM (This post was last modified: 08-03-2024 05:55 PM by floppy.)
Post: #15
RE: (HP71B) ASM question
The HP41 freaks will enjoy? perhaps.. lets throw more to these persons.. (not sure it exist anywhere else. could not find anything like that except perhaps in an HP41Forth-Module-translator where I did not had a look at the code, but hereunder is for use with the standard Forth/ASM module)

Code:
* %CH : calculate [(x —-y) 100] / y, see %CH HP41 manual page 84
* tested 02 Aug 2024
       WORD '%CH'
       GOSBVL =SAVEFP
       P=     0
       LC(5)  =OX
       CD0EX
       A=DAT0 W
       D0=D0- 16
       DAT0=A W              X into L, A=X
       R0=A
*
       P=     0
       LC(5)  =OY
       CD0EX
       A=DAT0 W              A = Y
       SETDEC
       A=-A-1 S              A = -Y
       SETHEX
*       
       B=A    W
       C=B    W 
       A=R0                  A=X, C=-Y
*       
       SETDEC
       GOSBVL =AD2-12        (X-Y) in (A,B)
       SETHEX
       C=0    W
       D=C    W
       P=     0
       C=C+1  P              
       C=C+1  P              Exponent 10**2
       P=     14
       D=D+1  P              1 in D mantissa.. = 100 in (C,D)
*       
       SETDEC
       GOSBVL =MP2-15        Resut in A,B
       SETHEX
       GOSBVL =EXAB1         [(x —-y) 100] into (R0,R1)
*       
       P=     0
       LC(5)  =OY
       CD0EX
       A=DAT0 W              A = Y
       GOSBVL =SPLTAX         (A,B) = Y
       C=B    W
       D=C    W
       C=A    W              (C,D) = Y
       GOSBVL =EXAB1         (A,B) now = [(x —-y) 100]
       SETDEC
       GOSBVL =DV2-15        (A,B) = [(x —-y) 100] / Y
       GOSBVL =RESD1
       SETHEX
       A=C    W              A = Result
*
       D0=(5) =OX
       DAT0=A W              Result into X
       GOSBVL =GETFP
       RTNCC

Code:
* %OF : calculate (X*Y)/100, see % in HP41 manual page 83, =pdf 89
* use: 500.0 94.0 %OF  result 470.00 in X, 94 in LASTX
* tested 02 Aug 2024
       WORD '%OF'
       GOSBVL =SAVEFP
       P=     0
       LC(5)  =OX
       CD0EX
       A=DAT0 W
       D0=D0- 16
       DAT0=A W              X into L, A=X
       R0=A
*
       P=     0
       LC(5)  =OY
       CD0EX
       A=DAT0 W              A = Y
*       
       B=A    W
       C=B    W 
       A=R0                  A=X, C=Y
*
       SETDEC
       GOSBVL =MP2-12         (X*Y) in (A,B)
       SETHEX
* reduce exponent nb by 2 for divide by 100? not tested..
       C=0    W
       D=C    W
       P=     0
       C=C+1  P              
       C=C+1  P              Exponent 10**2
       P=     14
       D=D+1  P              1 in D mantissa.. = 100 in (C,D)
*
       SETDEC
       GOSBVL =DV2-15         Result in A,B
       GOSBVL =RESD1
       SETHEX
       A=C    W              A = Result
*
       D0=(5) =OX
       DAT0=A W              Result into X
*
       GOSBVL =GETFP
       RTNCC

UPDATE UPDATE I forgot the entry points (= existing routines which are listed in the IDS V2 or V3 and must be part of an ASM file for it to be assembled). I posted the list in the all first post.

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 - Yesterday, 01:44 PM
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)