Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8018402
Transcription of Bundle 9 - ATAN.ASM Code and Listing
the-grue Jun 11, 2026
41eb4a9
Transcription of Bundle 9 - CHAIN.ASM Code and Listing
the-grue Jun 12, 2026
ca35977
Fixed data entry error in CHAIN.ASM Listing
the-grue Jun 12, 2026
f0beb91
Transcription of Bundle 9 - CONASC.ASM Code and Listing
the-grue Jun 12, 2026
cdc7df7
Transcription of Bundle 9 - CONST.ASM Code and Listing
the-grue Jun 13, 2026
e482388
Transcription of Bundle 9 - CONV.ASM Code and Listing
the-grue Jun 14, 2026
faddab9
Transcription of Bundle 9 - DATAN.ASM Code and Listing
the-grue Jun 14, 2026
b3b2cb8
Transcription of Bundle 9 - DEXP.ASM Code and Listing
the-grue Jun 16, 2026
dd5fcef
Transcription of Bundle 9 - DLOG.ASM Code and Listing
the-grue Jun 18, 2026
435f307
Transcription of Bundle 9 - INVOLD.ASM Code and Listing
the-grue Jun 19, 2026
3141d4f
Transcription of Bundle 9 - DSIN.ASM Code and Listing
the-grue Jun 20, 2026
a7a8133
Transcription of Bundle 9 - DMATH.ASM Code and Listing
the-grue Jun 21, 2026
099a01f
Transcription of Bundle 9 - DOSDAT.ASM Code and Listing
the-grue Jun 22, 2026
843eaa6
Transcription of Bundle 9 - DOSIO.ASM Code and Listing
the-grue Jun 22, 2026
8efb98d
Transcription of Bundle 9 - DSQRT.ASM Code and Listing
the-grue Jun 24, 2026
df935b3
Transcription of Bundle 9 - ERROR.ASM Code and Listing
the-grue Jun 24, 2026
697ff26
Transcription of Bundle 9 - EXP.ASM Code and Listing
the-grue Jun 26, 2026
9c57f07
Transcription of Bundle 9 - FCOMP.ASM Code and Listing
the-grue Jun 26, 2026
488cf00
Transcription of Bundle 9 - FIELD.ASM Code and Listing
the-grue Jun 27, 2026
3301118
Transcription of Bundle 9 - FIN.ASM Code and Listing
the-grue Jun 28, 2026
f00df94
Transcription of Bundle 9 - FLOAT.ASM Code and Listing
the-grue Jun 29, 2026
bbcc90c
Transcription of Bundle 9 - FOUT.ASM Code and Listing
the-grue Jul 1, 2026
c02934e
Corrected data entry error in FOUT.ASM
the-grue Jul 2, 2026
f5d012a
Transcription of Bundle 9 - GOSTOP.ASM Code and Listing
the-grue Jul 4, 2026
0c10a1d
Transcription of Bundle 9 - GOSUB.ASM Code and Listing
the-grue Jul 4, 2026
8ff2a5d
Transcription of Bundle 9 - HEXOCT.ASM Code and Listing
the-grue Jul 4, 2026
d1fd8a0
Transcription of Bundle 9 - INPDSK.ASM Code and Listing
the-grue Jul 4, 2026
8569a6c
Transcription of Bundle 9 - INPTTY.ASM Code and Listing
the-grue Jul 4, 2026
8f525d0
Transcription of Bundle 9 - INPUT.ASM Code and Listing
the-grue Jul 8, 2026
dfb0e78
Transcription of Bundle 9 - INPUTF.ASM Code and Listing
the-grue Jul 8, 2026
36810bf
Transcription of Bundle 9 - IODATA.ASM Code and Listing
the-grue Jul 9, 2026
47a7563
Transcription of Bundle 9 - IODEV.ASM Code and Listing
the-grue Jul 11, 2026
4169f76
Transcription of Bundle 9 - IODISK.ASM Code and Listing
the-grue Jul 15, 2026
31569d9
Corrected data entry error in IODISK.ASM
the-grue Jul 15, 2026
f359871
Corrected number alignment error in IODISK.ASM
the-grue Jul 16, 2026
8dadb6e
Transcription of Bundle 9 - IOFILM.ASM Code and Listing
the-grue Jul 17, 2026
c97d069
Transcription of Bundle 9 - IOLPT.ASM Code and Listing
the-grue Jul 17, 2026
a13f12a
Transcription of Bundle 9 - IOTTY.ASM Code and Listing
the-grue Jul 18, 2026
9f01a7d
Transcription of Bundle 9 - LININP.ASM Code and Listing
the-grue Jul 20, 2026
9b742a8
Transcription of Bundle 9 - LOG.ASM Code and Listing
the-grue Jul 21, 2026
ec822bf
Removed formatting remnants accidentally left in source code
the-grue Jul 21, 2026
c864222
Transcription of Bundle 9 - MID.ASM Code and Listing
the-grue Jul 21, 2026
e1002ef
Transcription of Bundle 9 - NUMFCN.ASM Code and Listing
the-grue Jul 24, 2026
501f1be
Transcription of Bundle 9 - OUT.ASM Code and Listing
the-grue Jul 24, 2026
3b06a1a
Transcription of Bundle 9 - POLY.ASM Code and Listing
the-grue Aug 4, 2026
7150fd7
Corrected data entry error in OUT.ASM
the-grue Aug 4, 2026
7080a36
Transcription of Bundle 9 - PR0A.ASM Code and Listing
the-grue Aug 4, 2026
99a3821
Transcription of Bundle 9 - PR0B.ASM Code and Listing
the-grue Aug 5, 2026
ed81533
Transcription of Bundle 9 - PRNVAL.ASM Code and Listing
the-grue Aug 5, 2026
90566f6
Removed formatting remnants accidentally left in source code
the-grue Aug 5, 2026
70525eb
Transcription of Bundle 9 - PRTU.ASM Code and Listing
the-grue Aug 6, 2026
1573543
Transcription of Bundle 9 - PUFOUT.ASM Code and Listing
the-grue Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 240 additions & 0 deletions 2_printed_files/bundle_09/ATAN.ASM
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
ATAN - Arc tangent Macro-86 %1(12) 0:58:20 13-Nov-81 Page 1-1



1 TITLE ATAN - Arc tangent
2
3 0000 DATA SEGMENT WORD PUBLIC 'DATA'
4
5 EXTRN $FAC:BYTE, $AC:WORD, $ARG:WORD, $TEMP:WORD
6
7 0000 DATA ENDS
8
9 0000 CONST SEGMENT WORD PUBLIC 'CONST'
10
11 EXTRN $ONE:WORD,$HALFPI:WORD,$SIXTHPI:WORD,$SQRT3:WORD
12 EXTRN $TANTWELFTHPI:WORD
13
14 ;Coefficients for Hart 4940, relative error 7.69
15 ;ATAN(x) = xP(x^2)
16 ; These constants have been checked with MuMath
17
18 0000 0003 ATANTAB DW 3 ;Degree
19 0002 62 35 83 7E DB 062H,035H,083H,07EH ;-0.12813 3334
20 0006 50 24 4C 7E DB 050H,024H,04CH,07EH ;+0.19935 72694
21 000A 79 A9 AA 7F DB 079H,0A9H,0AAH,07FH ;-0.33332 42344 5
22 000E 00 00 00 81 DB 000H,000H,000H,081H ;+0.99999 99797 73
23
24 0012 CONST ENDS
25
26
27 DC GROUP DATA,CONST
28
29
30 0000 CODE SEGMENT BYTE PUBLIC 'CODE'
31
32 PUBLIC $ATN
33
34 EXTRN $SAVREG:NEAR, $SPOLYX:NEAR
35 EXTRN $SDIV:NEAR, $SMUL:NEAR, $SADD:NEAR, $SSUB:NEAR, $SCMP:NEAR
36
37 ASSUME CS:CODE, DS:DC, ES:DC
38
39
40 ;$ATN - Arc tangent
41 ;
42 ; Inputs:
43 ; BX = Address of argument
44 ; Outputs:
45 ; Result in FAC
46 ; Registers:
47 ; Only F affected.
48
49 0000 $ATN:
50 0000 E8 0000 E CALL $SAVREG
51 0003 8B F3 MOV SI,BX
52 0005 BF 0000 E MOV DI,OFFSET DC:$AC
53 0008 A5 MOVSW ;Put in FAC
54 0009 AD LODSW


ATAN - Arc tangent Macro-86 %1(12) 0:58:20 13-Nov-81 Page 1-2



55 000A AB STOSW
56 000B 0A E4 OR AH,AH ;Is it zero?
57 000D 74 11 JZ DONE ;If so, result is too
58 000F A8 80 TEST AL,80H ;Check sign
59 0011 79 0E JNS POSATAN
60 0013 24 7F AND AL,7FH
61 0015 A2 FFFF E MOV [$FAC-1],AL ;Make it positive
62 0018 E8 0021 R CALL POSATAN ;Take arctan of positive number
63 001B 80 36 FFFF E 80 XOR [$FAC-1],80H ;Invert sign back
64 0020 C3 DONE: RET
65
66 0021 POSATAN:
67 0021 80 FC 81 CMP AH,81H ;Is it >= 1?
68 0024 72 15 JB LESSTHAN1
69 0026 BE 0000 E MOV SI,OFFSET DC:$ONE
70 0029 BF 0000 E MOV DI,OFFSET DC:$AC
71 002C E8 0000 E CALL $SDIV ;It's reciprocal is < 1
72 002F E8 003B R CALL LESSTHAN1 ;Compute arc-cotan on number < 1
73 0032 BE 0000 E MOV SI,OFFSET DC:$HALFPI
74 0035 BF 0000 E MOV DI,OFFSET DC:$AC
75 0038 E9 0000 E JMP $SSUB ;Correct by subtracting from PI/2
76
77 003B LESSTHAN1:
78 003B BE 0000 E MOV SI,OFFSET DC:$TANTWELFTHPI
79 003E BF 0000 E MOV DI,OFFSET DC:$AC
80 0041 E8 0000 E CALL $SCMP ;Compare argument to PI/12
81 0044 73 40 JAE DOATAN ;Range reduction complete if <= PI/12
82 0046 BE 0000 E MOV SI,OFFSET DC:$AC
83 0049 BF 0000 E MOV DI,OFFSET DC:$ARG
84 004C A5 MOVSW ;Save X in ARG
85 004D A5 MOVSW
86 004E BE 0000 E MOV SI,OFFSET DC:$SQRT3 ;Point to TAN(PI/6) (PI/6 = 30 degrees)
87 0051 BF 0000 E MOV DI,OFFSET DC:$AC
88 0054 E8 0000 E CALL $SADD ;FAC = X + TAN(PI/6)
89 0057 BE 0000 E MOV SI,OFFSET DC:$AC
90 005A BF 0000 E MOV DI,OFFSET DC:$TEMP
91 005D A5 MOVSW ;Save in TEMP
92 005E A5 MOVSW
93 005F BE 0000 E MOV SI,OFFSET DC:$SQRT3
94 0062 BF 0000 E MOV DI,OFFSET DC:$ARG
95 0065 E8 0000 E CALL $SMUL ;FAC = X * TAN(PI/6)
96 0068 BE 0000 E MOV SI,OFFSET DC:$AC
97 006B BF 0000 E MOV DI,OFFSET DC:$ONE
98 006E E8 0000 E CALL $SSUB ;FAC = X * TAN(PI/6) - 1
99 0071 BE 0000 E MOV SI,OFFSET DC:$AC
100 0074 BF 0000 E MOV DI,OFFSET DC:$TEMP
101 0077 E8 0000 E CALL $SDIV ;FAC = (X*TAN(PI/6) - 1)/(X + TAN(PI/6)
102 007A E8 0086 R CALL DOATAN ;Comput e arctan on argument < PI/12
103 007D BE 0000 E MOV SI,OFFSET DC:$SIXTHPI
104 0080 BF 0000 E MOV DI,OFFSET DC:$AC
105 0083 E9 0000 E JMP $SADD ;Correct for range reduction by adding PI/6
106
107 0086 DOATAN:
108 0086 BB 0000 R MOV BX,OFFSET DC:ATANTAB


ATAN - Arc tangent Macro-86 %1(12) 0:58:20 13-Nov-81 Page 1-3



109 0089 E9 0000 E JMP $SPOLYX
110
111 008C CODE ENDS
112 END




















































ATAN - Arc tangent Macro-86 %1(12) 0:58:20 13-Nov-81 Symbols-1



Segments and groups:

N a m e Size align combine class

CODE . . . . . . . . . . . . . . 008C BYTE PUBLIC 'CODE'
DC . . . . . . . . . . . . . . . GROUP
DATA . . . . . . . . . . . . . . 0000 WORD PUBLIC 'DATA'
CONST. . . . . . . . . . . . . . 0012 WORD PUBLIC 'CONST'

Symbols:

N a m e Type Value Attr

ATANTAB. . . . . . . . . . . . . L WORD 0000 CONST
DOATAN . . . . . . . . . . . . . L NEAR 0086 CODE
DONE . . . . . . . . . . . . . . L NEAR 0020 CODE
LESSTHAN1. . . . . . . . . . . . L NEAR 003B CODE
POSATAN. . . . . . . . . . . . . L NEAR 0021 CODE
$AC. . . . . . . . . . . . . . . V WORD 0000 DATA External
$ARG . . . . . . . . . . . . . . V WORD 0000 DATA External
$ATN . . . . . . . . . . . . . . L NEAR 0000 CODE Global
$FAC . . . . . . . . . . . . . . V BYTE 0000 DATA External
$HALFPI. . . . . . . . . . . . . V WORD 0000 CONST External
$ONE . . . . . . . . . . . . . . V WORD 0000 CONST External
$SADD. . . . . . . . . . . . . . L NEAR 0000 CODE External
$SAVREG. . . . . . . . . . . . . L NEAR 0000 CODE External
$SCMP. . . . . . . . . . . . . . L NEAR 0000 CODE External
$SDIV. . . . . . . . . . . . . . L NEAR 0000 CODE External
$SIXTHPI . . . . . . . . . . . . V WORD 0000 CONST External
$SMUL. . . . . . . . . . . . . . L NEAR 0000 CODE External
$SPOLYX. . . . . . . . . . . . . L NEAR 0000 CODE External
$SQRT3 . . . . . . . . . . . . . V WORD 0000 CONST External
$SSUB. . . . . . . . . . . . . . L NEAR 0000 CODE External
$TANTWELFTHPI. . . . . . . . . . V WORD 0000 CONST External
$TEMP. . . . . . . . . . . . . . V WORD 0000 DATA External

Warning Severe
Errors Errors
0 0

















Loading