Thanks again to the community for the continued enthusiasm for the hp41 system.
This is a basic program for in flight navigation of light aircraft. It is intended for an HP41CX and makes use of the timer functions and extended memory.
Attached is a 4K .MOD file and a PDF manual. The principal functions are contained in SLANTR and will operate in a stock CX. The auxiliary routines in RNAVFX presume the package is operating in ROM or HEPAX memory.
The package currently does not apply magnetic variation to the computed heading.
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; IN-FLIGHT AVIGATION PACKAGE FOR AREA NAVIGATION BETWEEN TWO FIXES
; USES GROUND BASED VOR NAVIGATION AIDS TO UPDATE DEDUCED POSITION(S)
; CREATES A NAVIGATION LOG OF POSITION, COURSE, HEADING, DISTANCES AND
; CLOSEST FIX EVERY 5 MINUTES
;
; COPYRIGHT 2013 TODD DECKARD. THIS PROGRAM IS SUPPLIED WITHOUT REPRESENTATION ; OR WARRANTY OF ANY KIND. TODD DECKARD ASSUMES NO RESPONSIBILITY AND WILL
; HAVE NO LIABILITY, CONSEQUENTIAL OR OTHERWISE, OF ANY KIND ARISING FROM
; THE USE OF THIS PROGRAM MATERIAL OR ANY PART THEREOF.
;
; REQUIRES HP41CX (OR TIME MODULE AND EXTENDED MEMORY FUNCTIONS)
; REQUIRES DATABASE OF WAYPOINTS WITH LAT AND LONG IN EXTENDED MEMORY
; REQUIRES SUPPLEMENTAL FILES FOR MAGNETIC VARIATION
;
;
; 124 REGISTERS OF EXTENDED MEMORY AFFORDS 9 WAYPOINTS
;
; 1. BEFORE TAKEOFF NAVIGATOR ENTERS ANY ADDITIONAL WAYPOINTS IN
; EXTENDED MEMORY FOR THE INTENDED ROUTE OF FLIGHT
; 2. INITIALIZE SLANTR WHICH PROMPTS FOR DEPARTURE, DESTINATION, IAS,
; CURRENT BARO, PLAN ALTITUDE, FORECAST WINDS, TEMP
; FIRST NAVIGATION LOG OUTPUT PROVIDES COURSE, DISTANCE,
; RECOMMENDED MAGNETIC HEADING, ANTICIPATED ETE
; 3. DURING BEFORE-TAKE-OFF CHECK EXECUTE HACKTO, WHICH MARKS
; TAKE OFF AND BEGINS REPEATING FIVE MINUTE INTERVAL UPDATE
; OF DED RECON POSITION
;
; AT FIVE MINUTE INTERVALS SYSTEM WILL DISPLAY NEW NAVIGATION LOG OUTPUT
;
; 4. ENROUTE NAVIGATOR MARKS CHECKPOINT PAIRS AND DISTANCES TO UPDATE
; GROUND SPEED, AND TIME AND BEARING FROM KNOWN WAYPOINTS TO UPDATE POSITION
;
; HACKC1, HACKC2 - MARKS OVERFLIGHT OF KNOWN CHECKPOINTS AND PROMPTS
; FOR DISTANCE, UPDATES GROUND SPEED
;
; VOR1B1, VOR1B2 - MARKS TWO BEARINGS FROM WAYPOINT TO UPDATE POSITION
; VOR1B1, VOR2B1 - MARKS TWO INTERSECTING BEARINGS TO UPDATE POSITION
; 5. ENDFLT - SUSPENDS DEDUCED RECKONING UPDATES
;
; NOTE: WINDS ALOFT ARE USED TO PREDICT AN ANTICIPATED GROUND SPEED
; UNTIL AT LEAST TWO FIXES ARE DETERMINED FROM GROUND CHECKPOINTS
;
; NOTE: CLOSEST FIX IS DISPLAYED IN BEARING TO, NAVIGATION PLOTS
; ARE INPUT IN BEARING FROM
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; 02 SLANTR MAIN
; 03 M% INTERRUPT FUNCTION TO UPDATE AND DISPLAY DEDUCED POSITION
; 04 MENU%%
; 05 OUTPUT OUTPUT NAVIGATION POSITION
; 46-57 DISPLA DISPLAY NAVIGATION VARIABLES
; 08 DIVERT TRACK NEW COURSE
; 10 HACKTO HACK TIME OF TAKEOFF; CREATE ALARM FOR MAIN LOOP EVERY 5 MIN
; 12 HACKOV HACK TIME OVER CHECKPOINT; PROMPT FOR IDENT; UPDATE POSITION
; 14 ALTMTR PROMPT FOR INDICATED ALTITUDE; KOLSMANN SETTING; TEMP C
; 16 VOR1B1 HACK TIME OF BEARING, PROMPT FOR VOR AND BEARING FROM
; 18 VOR1B2 HACK TIME OF FIX, PROMPT FOR BEARING FROM; COMPUTE POSITION
; 20 VOR2B1 HACK TIME OF FIX, PROMPT FOR VOR, BEARING FROM; COMPUTE POSITION
; 22 FCSTWD ENTER FORECAST WINDS ALOFT
; 26 PREFLT PROMPT FOR ORIGIN AND DESTINATION AND FLT PLAN ALTITUDE
; 28 WAYPTS PROMPT FOR WAYPOINTS
; 30 CATWPT DISPLAY WAYPOINTS
; 32 ENDFLT FLIGHT ARRIVED, TERMINATE PROGRAM
; 34 *UPDATE UPDATE NAVIGATION POSITION LOG
; 36 *INIPOS LOOKUP DEP&DST LAT/LON, SET FIX AND DED POSITIONS TO DEP
; 38 *DEDREC HACK TIME OF DED RECKON POSITION; UPDATE DED RECKON LAT/LON
; 40 *CRSHDG COMPUTE COURSE, HDNG, ETE, DISTANCES REMAINING AND FLOWN
; 42 *SPEEDS COMPUTE SPEEDS
; 44 *DSTFLN COMPUTE DISTANCE FLOWN, DISTANCE REMAINING
; 60 *CLSEST COMPUTE CLOSEST WAYPOINT
; 62 *DENALT COMPUTE DENSITY ALTITUDE
; 64 *ACTLWD COMPUTE OBSERVED WINDS ALOFT
; 66 *FCSTWD INTERPOLATE FROM FORECAST WINDS ALOFT
; 68 *LSTFIX LAST PLOTTED FIX
; 70 *MAGVAR INTERPOLATED MAGNETIC VARIATION
; 72 *CRSDST COMPUTE COURSE AND DISTANCE BETWEEN TWO WAYPOINTS
; 74 *GCLINE
; 76 *GCPOS
; 78 *SIGHT
;
; FILES: NAVREG TEXT FILE OF KEY NAVIGATION VARIABLES
; WPTLST TEXT FILE OF AIRPORTS AND VOR BEACONS
; XXX DATA FILE FOR WAYPOINT; DECIMAL LAT/LON;
; KXXX DATA FILE FOR AIRPORT; DECIMAL LAT/LON
; MAGVAR DATA FILE FOR MAGNETIC VARIATION POLYNOMIAL
; NAVPOS TEXT FILE OF NAVIGATION POSITION
;
; FLAGS: <NOTE FLAG TESTS ARE LARGELY UNIMPLEMENTED>
; 01 FIRST BEARING RECORDED IF TRUE (VOR 1 BEARING 1)
; 02 NEW ALTITUDE, UPDATE DENSITY ALTITUDE, WINDS, AND AIRSPEEDS
; 03 NEW INDICATED AIRSPEED, UPDATE TRUE AIRSPEED AND GROUND SPEED
; 04 WINDS ALOFT FORECAST/OBSERVED (OBSERVED WINDS ALOFT IF TRUE)
; 05 GROUND SPEED EXPECTED/OBSERVED (OBSERVED GROUND SPEED IF TRUE)
; 06" SUSPEND TIMER INTERRUPT/DED RECON UPDATE BETWEEN FIXES
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; NAVREG FILE
; R00 0DEPART ;0 ALPHA
; R01 0DEST ;1 KTS
; R02 5TIMOFF ;2 NM
; R03 4TRUCRS ;3 TEMPERATURE CELSIUS
; R04 4MAGHD ;4 DEGREES
; R05 2DISTRM ;5 TIME IN HOURS MINUTES SECONDS
; R06 2DISTFN ;6 LATITUDE DISPLAYED IN HOURS MINUTES SECONDS
; R07 1GS ;7 LONGITUDE DISPLAYED IN HOURS MINUTES SECONDS
; R08 1TAS ;8 BAROMETRIC PRESSURE (KOLLSMAN SETTING)
; R09 1IAS ;9 FEET
; R10 3TEMPC
; R11 8ALTSET
; R12 9ALTITD
; R13 4MAGVAR
; R14 4WINDIR
; R15 1WINSPD
; R16 9DENALT
; R17 6FIXLAT
; R18 7FIXLON
; R19 5TIMOFF
; R20 6DEDLAT
; R21 7DEDLON
; R22 5DEDTIM
; R23 5LASTIM
; R24 0LSTFIX
; R25 0VOR1
; R26 4BRNG1
; R27 4BRNG2
; R28 5TIME1
; R29 5TIME2
; R30 0VOR2
; R31 4BRNG3
; R32 2CRSTRK ; NOT IMPLEMENTED CONSIDER REPLACING WITH FUELRM
; R33 6DEPLAT
; R34 6DEPLON
; R35 6DSTLAT
; R36 6DSTLON
; R37 0CLSWPT ; OVERWRITTEN TEMPORARILY BY MAGAR
; R38 2CLSBRG ; OVERWRITTEN BY FUELBN
; R39 2CLSDST ; OVERWRITTEN BY FUELBN
; R40 TEMP COUNTER VARIABLE
; R41 TEMP LAT1 INPUT TO *GCLINE, INPUT TO *GCPLOT
; R42 TEMP LON1 INOUT TO *GCLINE, INPUT TO *GCPLOT
; R43 TEMP LAT2 INPUT TO *GCLINE, OUTPUT FROM *GCPLOT
; R44 TEMP LON2 INPUT TO *GCLINE, OUTPUT FROM *GCPLOT
; R45 TEMP COURSE FROM 1->2,OUTPUT FROM *GCLINE, INPUT TO *GCPLOT
; R46 TEMP DISTANCE FROM 1->2,OUTPUT FROM *GCLINE, INPUT TO *GCPLOT
; R47 TEMP COUNTER VARIABLE
;
; EXTENDED MEMORY FILES
;
; NAVREG USED BY “DISPLA” FUNCTION A043 EACH RECORD IS A LABEL
; FOR THE ASSOCIATED MEMORY REGISTER; A NUMERICAL PREFIX
; INDICATING THE TYPE AND A SIX DIGIT MNEMONIC. LABELS ARE USED
; ONLY WHEN DISPLAYING NAVIGATION REGISTERS. “DISPLA” FUNCTION
; LOOPS OVER FILE AND DISPLAYS EACH REGISTER CONTENTS PREFIXED
; WITH ITS LABEL
;
; MAGVAR USED BY “*MAGVAR” FUNCTION D010 USED TO STORE POLYNOMIAL
; COEFFICIENTS FOR INTERPOLATED MODEL OF US MAGNETIC VARIATION
; { -65.6811, 0.99,0.0128899, -0.0000905928,2.87622, -0.0116268,
; -0.00000603925,- 0.0389806,-0.0000403488,0.000168556 }
;
; WAYPTS USED BY “CATWPT”,”CLSEST”, A008 EACH ENTRY IS A WAYPOINT
; OR NAVIGATION FIX FOR THE FLIGHT. ENROUT POSITION IS DISPLAYED ; RELATIVE TO THESE FIXES. THIS FILE IS OF ARBITRARY LENGTH AND
; IS EDITED BY THE USER FOR EACH FLIGHT. EACH ENTRY MUST
; CORRESPOND TO AN EXTENDED MEMORY FILE OF THE SAME NAME
; CONTAINING THE DECIMAL LAT/LON FOR THAT FIX
;
; NAVPOS CREATED BY “UPDATE”, PRINTED BY “OUTPUT” A012
; NAVIGATION LOG FILE CONTAINING MOST RECENT POSITION,
; RECREATED EVERY FIVE MINUTES
;
;
; KXXX INDIVIDUAL WAYPOINT FILE D002 WAYPOINT FILE
; CONTAINING DECIMAL LATITUDE, DECIMAL LONGITUDE
;
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
import 41cx
;;
01 LBL "SLANTR" ; MAIN ENTRY POINT FOR /R AREA NAVIGATION
02 .04501 ; ASSUMES SIZE 046
03 CLRGX ; CLEAR REGISTERS 00 THRU 46
04 CLRALMS ; CLEAR ALARMS
05 CF 00 ; FIRST BEARING RECORDED IF TRUE (VOR 1 BEARING 1)
06 CF 01 ; UPDATE DENSITY ALTITUDE AND AIRSPEEDS
07 CF 02 ; UPDATE TRUE AIRSPEED AND GROUND SPEED
08 SF 03 ; USE FORECAST WINDS ALOFT FOR NAVIGATION
09 CF 04 ; USE EXPECTED GROUND SPEED FOR NAVIGATION
10 CF 05 ; PROMPT USER TO CONFIRM TIME (GMT)
11 "TIME?"
12 AVIEW
13 PSE
14 CLA
15 FIX 04
16 TIME
17 HMS
18 ATIME
19 AVIEW
20 STOP
21 SETIME
22 XEQ 26 ; PREFLT - ENTER DEPART, DEST, ALTITUDE, TEMP
23 XEQ 36 ; INITPOS - INITIALIZE POSITIONS AT START OF FLIGHT
24 XEQ 86 ; UPDATE NAVIGATION
25 TIME ; RECORD A TIME HACK; BACKUP IF A PROPER HACK MISSED
26 STO 02 ; [TIMOFF]
27 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
28 LBL "HACKTO" ; HACK TAKEOFF CREATE ALARM FOR MAIN LOOP EVERY 5 MIN
29 LBL 10
30 TIME
31 STO 02 ; [TIMEOF] TIME OF TAKEOFF
32 STO 22 ; [DEDTIM] TIME OF LAST DEDUCED POSITION
33 STO 23 ; [LASTIM] TIME OF LAST FIXED POSITION
34 CLRALMS
35 .0500 ; MAIN SHOULD RUN EVERY FIVE MINUTES
36 0 ; TODAY
37 TIME ;
38 .05 ; STARTING FIVE MINUTES FROM NOW
39 + ; DOES NOT HANDLE MIDNIGHT DATE ROLLOVER
40 "^^M%"
41 XYZALM
42 BEEP
43 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
44 LBL "HACKOV"
45 LBL 12
46 TIME
47 STO 40
48 "OVER FIX"
49 AVIEW
50 AON
51 STOP
52 AOFF
53 ASTO 24 ; [LSTFIX]
54 0
55 SEEKPTA
56 17.018 ; WRITE POSITION OF FLYOVER WAYPOINT AS LAST FIX
57 GETRX
58 RCL 17 ; FIXLAT
59 STO 20 ; DEDLAT ; UPDATE LAST DEDUCED POSITION (LAT)
60 RCL 18 ; FIXLON
61 STO 21 ; DEDLON ; UPDATE LAST DEDUCED POSITION (LON)
62 RCL 40
63 STO 22 ; DEDTIM ; UPDATE DEDUCED TIME
64 STO 23 ; LASTIM ; UPDATE TIME OF LAST FIX
65 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
66 LBL "HACKC1" ; HACK TIME OF CHECKPOINT (FIRST OF PAIR),
67 TIME ; COMPUTE GROUND SPEED AFTER SECOND HACK TIME
68 STO 29 ; [TIME2] DO NOT INTERLEAVE VOR FIXES AND CHECKPOINTS
69 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
70 LBL "HACKC2" ; HACK TIME OF SECOND CHECKPOINT, UPDATE GROUND SPEED
71 TIME
72 RCL 29 ; [TIME2]
73 HMS-
74 HR
75 "DIST?"
76 PROMPT
77 X<>Y
78 /
79 STO 07 ; [GS]
80 SF 05 ; FLAG 05 = TRUE PREVENTS GROUND SPD FROM BEING
81 RTN ; DERIVED FROM FORECAST WINDS
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
82 LBL "M%" ; COMPUTE NEW DED RECKON POSITION
83 XEQ 38 ; UPDATE DED RECON POSITION
84 XEQ 86 ; RECOMPUTE NAVIGATION VARIABLES
85 RTN
86 LBL 86 ; SUBROUTINE UPDATE NAVIGATION PARAMETERS
87 XEQ 70 ; COMPUTE MAGNETIC VARIATION BASED ON CUR POSITION
88 XEQ 62 ; COMPUTE DENSITY ALT BASED ON TEMPERATURE AND PRESSURE
89 XEQ 40 ; COMPUTE COURSE,HEADING,ETE FROM CUR POS TO DEST
90 XEQ 42 ; COMPUTE TAS FROM IAS, WIND CORRECTION , GS, HEADING
91 XEQ 60 ; COMPUTE BEARING AND DISTANCE TO CLOSEST WAYPOINT
92 XEQ 34 ; UPDATE NAVIGATION LOG
93 XEQ 05 ; OUTPUT NAVIGATION LOG
94 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; INPUT FUNCTIONS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
95 LBL "PREFLT" ; PROMPT USER FOR DEPARTURE, DESTINATION ALTITUDE
96 LBL 26 ; TEMP ALOFT, BARO, AIRSPEED, WINDS ALOFT
97 "DEP APT?"
98 AON
99 STOP
100 AOFF
101 ASTO 00 ; [DEPART]
102 "DST APT?"
103 AON
104 STOP
105 AOFF
106 ASTO 01 ; [DEST]
107 XEQ 96
108 XEQ 97
109 XEQ 98
110 RTN
111 LBL "ALTMTR"
112 LBL 96
113 CF 02
114 "ENR ALTITD?"
115 PROMPT
116 STO 12 ; [ALTITD]
117 "TEMP?"
118 PROMPT
119 STO 10 ; [TEMPC]
120 "ALT SET?"
121 PROMPT
122 STO 11 ; [BARO]
123 RTN
124 LBL 97
125 "AIRSPD?"
126 PROMPT
127 STO 09 ; [IAS]
128 RTN
129 LBL "FCSTWD"
130 LBL 98
131 "WIND DIR?"
132 PROMPT
133 STO 14 ; [WINDIR]
134 "WIND SPD?"
135 PROMPT
136 STO 15 ; [WINSPD]
137 RTN
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; OUTPUT FUNCTIONS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
138 LBL "OUTPUT" ; OUTPUT LOG STORED AS “NAVPOS” IN EXTENDED MEMORY
139 LBL 05 ; ADAPTED FROM EXTEND YOUR HP-41
140 BEEP
141 "NAVPOS" ; FORMATTED OUTPUT FOR LOG STORED IN EXTENDED MEMORY
142 CF 25
143 0
144 SEEKPTA
145 RDN
146 SF 25
147 LBL 06
148 GETREC
149 FC? 25
150 GTO 07
151 AVIEW
152 PSE
153 PSE
154 GTO 06
155 LBL 07
156 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
157 LBL "CATWPT" ; CATALOG ALL WAYPOINTS IN EXTENDED MEMORY
158 LBL 30
159 FIX 04
160 0
161 STO 40
162 CF 25
163 LBL 31
164 "WAYPTS" ; WAYPOINTS FILE LISTS INDIVIDUAL ENTRIES
165 RCL 40
166 SEEKPTA
167 RDN
168 SF 25
169 GETREC ; RETRIEVE WAYPOINT NAME
170 AVIEW
171 PSE
172 FC? 25
173 GTO 33
174 0
175 SEEKPTA
176 41.042
177 GETRX ; GET LAT/LONG FROM DATA FILE OF SAME NAME
178 RCL 41
179 HMS
180 "LA="
181 ATIME24
182 AVIEW ; OUTPUT LATITUDE AS HH:MM:SS
183 RCL 42
184 "LO="
185 ATIME24
186 AVIEW ; OUTPUT LONGITUDE AS HH:MM:SS
187 1
188 ST+ 40
189 GTO 31
190 LBL 33
191 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
192 LBL "UPDATE" ; CREATE NAVIGATION LOG ENTRY IN EXT MEMORY “NAVPOS”
193 LBL 34
194 "NAVPOS"
195 SF 25
196 FIX 00
197 PURFL
198 12
199 CRFLAS
200 APPREC
201 "TIMEGMT=" ; TIMEGMT=24:44 TIMESTAMP
202 FIX 02
203 TIME
204 ATIME24
205 APPREC ; [DSTFLN]
206 RCL 05 ; [DISTRM] C000H360E0:11 TRUE CRS, MAG HEADING, ETE
207 RCL 07 ; [GS]
208 /
209 FIX 02 ; COMPUTE ETE FROM DISTANCE AND SPEED
210 HMS
211 CLA
212 ATIME
213 ATOX
214 ASTO 41 ; CACHE RESULT IN TEMP
215 "C"
216 RCL 03 ; [TRUCRS]
217 XEQ 35
218 >"H"
219 RCL 04 ; [MAGHD]
220 XEQ 35
221 >"E"
222 ARCL 41
223 APPREC
224 "I" ; I100T120G090 IAS, TRUE AIRSPEED, GROUNDSPEED
225 RCL 09 ; [IAS]
226 XEQ 35
227 >"T"
228 RCL 08 ; [TAS]
229 XEQ 35
230 >"G"
231 RCL 07 ; [GNDSPD]
232 XEQ 35
233 APPREC
234 "FLN" ; FLN999RMG999 DISTANCE FLOWN, DISTANCE REMAINING
235 RCL 06 ; [DISTFN]
236 XEQ 35
237 >"RMG"
238 RCL 05 ; [DISTRM]
239 XEQ 35
240 APPREC
241 CLA
242 ARCL 37 ; [CLSWPT] XXXX999@360 CLOSEST WAYPOINT DIST @ BRNG (TO)
243 RCL 39 ; [CLSDST]
244 XEQ 35
245 >"T"
246 RCL 38 ; [CLSBRG]
247 XEQ 35
248 APPREC
249 RTN
250 LBL 35 ; HELPER FUNC, APPEND X REG TO ALPHA AS 3 DIGIT NUMBER
251 FIX 00
252 99
253 X<>Y
254 X>Y?
255 GTO 85
256 >"0"
257 9
258 X<>Y
259 X>Y?
260 GTO 85
261 >"0"
262 LBL 85
263 ARCL X
264 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
265 LBL "DISPLA" ; FORMATTED DISPLAY OF NAVIGATION REGISTERS
266 .03901
267 STO 40
268 LBL 46
269 RCL 40
270 INT
271 XEQ 47
272 ISG 40
273 GTO 46
274 RTN
275 LBL 47 ; HELPER FUNCTION FOR FORMATTED DISPLAY, REG NUM IN X
276 "NAVREG"
277 SEEKPTA ; LOOKUP REGISTER TYPE AND NAME IN EXT MEMORY FILE
278 GETREC
279 >":"
280 RCL IND X
281 ATOX
282 ASTO Z
283 X<>Y
284 FIX 00
285 XEQ IND Y
286 AVIEW
287 RTN
288 LBL 48 ; ALPHA
289 ARCL X
290 RTN
291 LBL 49 ; KTS
292 ARCL X
293 >"KTS"
294 RTN
295 LBL 50 ; NM
296 ARCL X
297 >" NM"
298 RTN
299 LBL 51 ; CELCIUS
300 LBL 52 ; DEGREES
301 LBL 56 ; BAROMETRIC PRESSURE
302 LBL 57 ; FT
303 ARCL X
304 RTN
305 LBL 53 ; HMS
306 CLK24
307 FIX 04
308 ATIME
309 RTN
310 LBL 54
311 LBL 55 ; LAT LONG
312 FIX 04
313 HMS
314 ATIME24
315 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; NAVIGATION FUNCTIONS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
316 LBL "*INIPOS" ; LOOKUP DEP LAT/LOT, LOOKUP DST LAT/LON,
317 LBL 36 ; INITIALIZE FIX AND DED POSITIONS TO DEPARTURE
318 CLA
319 ARCL 00 ; DEPART
320 0
321 SEEKPTA ; LOOKUP DEPARTURE WAYPOINT
322 33.034 ; DEPLAT.DEPLON
323 GETRX
324 CLA
325 ARCL 01 ; DEST
326 0
327 SEEKPTA ; LOOKUP DESTINATION WAYPOINT
328 35.036 ; DSTLAT.DSTLON
329 GETRX
330 RCL 33 ; DEPLAT
331 STO 17 ; FIXLAT SET LAST “FIX” TO DEPARTURE LATITUDE
332 STO 20 ; DEDLAT SET LAST “DEDUCED” POS TO DEPART LAT
333 RCL 34 ; DEPLON
334 STO 18 ; FIXLON SET LAST “FIX” TO DEPARTURE LONGITUDE
335 STO 21 ; DEDLON SET LAST “DEDUCED” POS TO DEPARTURE LONG
336 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
337 LBL "*CRSHDG" ; COMPUTE TRUE COURSE AND MAGNETIC HEADING,
338 LBL 40 ; DISTANCE REMAINING AND DISTANCE FLOWN
339 RCL 20 ; [DEDLAT] DEDUCED LAT
340 STO 41
341 RCL 21 ; [DEDLON] DEDUCED LON
342 STO 42
343 RCL 35 ; [DSTLAT] DESTINATION LAT
344 STO 43
345 RCL 36 ; [DSTLON] DESTINATION LON
346 STO 44
347 XEQ 74 ; *GCLINE
348 RCL 45
349 STO 03 ; TRUCRS UPDATE TRUE COURSE
350 RCL 46
351 STO 05 ; [DISTRM] UPDATE DISTANCE REMAINING
352 RCL 33 ; [DEPLAT] DEPARTURE LATITUDE
353 STO 43
354 RCL 34 ; [DEPLON] DEPARTURE LONGITUDE
355 STO 44
356 XEQ 74 ; *GCLINE
357 RCL 46
358 STO 06 ; [DISTFN] UPDATE DISTANCE FLOWN
359 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
360 LBL "*GCLINE" ; COMPUTE COURSE AND DISTANCE BETWEEN TWO LAT/LON PAIRS
361 LBL 74 ; FROM HP “NAVIGATION” APPLICATION PAC
362 RCL 44
363 RCL 42
364 -
365 RCL 41
366 RCL 43
367 XEQ 78 ; *SIGHT
368 90
369 -
370 CHS
371 60
372 *
373 X<>Y
374 360
375 MOD
376 X<>Y
377 FIX 05
378 RND
379 STO 46
380 X<>Y
381 STO 45
382 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
383 LBL "*SIGHT" ; ADAPTED FROM HP “NAVIGATION” APPLICATION PAC
384 LBL 78
385 1
386 P-R
387 R^
388 X<>Y
389 P-R
390 R^
391 STO 40
392 X<>Y
393 P-R
394 X<> 40
395 R^
396 P-R
397 X<> 40
398 +
399 X<> 40
400 -
401 R-P
402 RDN
403 180
404 +
405 RCL 40
406 ASIN
407 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
408 LBL "*GCPLOT" ; COMPUTE COURSE, BEARING BETWEEN TWO LAT/LON POSITIONS
409 LBL 76 ; ADAPTED FROM HP “NAVIGATION” APPLICATION PAC
410 RCL 45 ; <HEADING>
411 90
412 RCL 46 ; <DISTANCE>
413 60
414 /
415 -
416 RCL 41 ; Latitude 1
417 X<>Y
418 XEQ 78
419 STO 43 ; RESULTING POSITION (LATITUDE)
420 X<>Y
421 RCL 42 ; Longitude 1
422 +
423 1
424 P-R
425 R-P
426 X<>Y
427 FIX 05
428 RND
429 STO 44 ; RESULTING POSITION (LONGITUDE)
430 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
431 LBL "*DEDREC"
432 LBL 38
433 TIME ; HACK TIME
434 STO 40
435 RCL 22 ; [DEDTIM] TIME SINCE LAST UPDATED DED RECON POSITION
436 HMS-
437 HR ; CONVERT TO DECIMAL HOURS
438 RCL 07 ; [GNDSPD] EXPECTED GROUND SPEED NM/HR
439 *
440 RND
441 STO 46 ; DISTANCE FLOWN
442 RCL 20 ; [DEDLAT]
443 STO 41 ; LAST DEDUCED LATITUDE
444 RCL 21 ; [DEDLON]
445 STO 42 ; LAST DEDUCED LONGITUDE
446 RCL 03 ; [TRUCRS]
447 STO 45 ; ASSUME TRACKING TRUE COURSE
448 RCL 40
449 STO 22 ; [DEDTIM]
450 XEQ 76 ; *GCPLOT
451 RCL 43
452 STO 20
453 RCL 44
454 STO 21
455 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
456 LBL "VOR1B1" ; HACK TIME OF SECOND BEARING, PROMPT FOR BEARING FROM
457 TIME ; ADAPTED FROM HP “AVIATION” APPLICATION PAC
458 STO 28 ; [TIME1]
459 STO 29 ; [TIME2]
460 "VOR ID?"
461 AVIEW
462 CLA
463 AON
464 STOP
465 AOFF
466 ASTO 25 ; VOR1 -- NO ERROR CHECKING FOR NON-EXISTENT WAYPOINTS
467 XEQ b
468 STO 26 ; [BEARING1]
469 SF 01 ; MARK FIRST BEARING
470 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
471 LBL "VOR1B2" ; HACK TIME OF SECOND BEARING, PROMPT FOR BEARING FROM
472 TIME ; ADAPTED FROM HP “AVIATION” APPLICATION PAC
473 STO 29 ; [TIME2]
474 FC? 01 ; HAS FIRST BEARING BEEN TAKEN
475 GTO 80
476 XEQ b ; PROMPT FOR BEARING FROM (SCRIMPING ON REGISTERS)
477 STO 45
478 XEQ a ; CALCULATE RECIPROCAL (TO) FOR FORMULA
479 STO 27 ; [BRNG2]
480 RCL 29 ; [TIME2] DIST = (GS * T) * SIN (COURSE - R1) / SIN (R1 - R2)
481 RCL 28 ; [TIME1]
482 HMS-
483 HR
484 RCL 07 ; [GNDSPD]
485 *
486 RCL 03 ; [TRUCRS] MAGNETIC COURSE
487 RCL 04 ; [BEARING1]
488 +
489 RCL 26
490 XEQ a ; CALCULATE RECIPROCAL (TO) FOR FORMULA
491 -
492 SIN
493 *
494 RCL 26 ; [BEARING1]
495 RCL 27 ; CALCULATE RECIPROCAL (TO) FOR FORMULA
496 - ; [BEARING2]
497 SIN
498 /
499 ABS
500 STO 46 ; DISTANCE FROM VOR
501 "D="
502 ARCL X
503 AVIEW
504 CLA
505 ARCL 25 ; MARK VOR AS LAST FIX
506 STO 24 ; [LSTFIX]
507 0
508 SEEKPTA ; RETRIEVE VOR LAT/LON
509 41.042
510 GETRX
511 XEQ 76 ; *GCPLOT CALCULATE POSITION FROM VOR
512 XEQ 65
513 XEQ 86 ; UPDATE ALL NAVIGATION VARIABLES
514 RTN
515 LBL 80
516 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
517 LBL "VOR2B1"
518 "VOR ID?" ; ADAPTED FROM HP “AVIATION” APPLICATION PAC
519 AVIEW
520 CLA
521 AON
522 STOP
523 AOFF
524 ASTO 30 ; [VOR2]
525 0
526 SEEKPTA
527 43.044 ; LAT2, LON2 inputs to *GCLINE
528 GETRX
529 XEQ b ; PROMPT FOR BEARING FROM (SCRIMPING ON REGISTERS)
530 STO 31 ; [BRNG3]
531 CLA
532 ARCL 25 ; [VOR2]
533 0
534 SEEKPTA
535 41.042 ; LAT1, LON1, inputs to *GCLINE
536 GETRX
537 XEQ 74 ; *GCLINE
538 RCL 31 ; [BRNG3]
539 RCL 45 ; COURSE FROM 1->2
540 -
541 SIN
542 RCL 46 ; DISTANCE FROM 1->2
543 *
544 RCL 31 ; [BRNG3]
545 RCL 26 ; [BRNG1]
546 STO 45 ; BEARING FROM VOR2
547 -
548 SIN
549 /
550 ABS
551 STO 46 ; DISTANCE FROM VOR1
552 "D=" ; TEMPORARY DEBUGGING OUTPUT!
553 ARCL X
554 AVIEW
555 RCL 26 ; [BRNG1] ; BEARING FROM VOR1
556 STO 45
557 XEQ 76 ; *GCPLOT ;
558 XEQ 65
559 XEQ 86
560 RTN
561 LBL 65
562 RCL 43
563 STO 17 ; [FIXLAT]
564 STO 20 ; [DEDLAT]
565 RCL 44
566 STO 18 ; [FIXLON]
567 STO 21 ; [DEDLON]
568 RCL 29 ; [TIME2]
569 STO 22 ; [DEDTIM]
570 STO 23 ; [LASTIM]
571 RTN
572 LBL a ; COMPUTE RECIPROCAL BEARING
573 180
574 +
575 360
576 MOD
577 RTN
578 LBL b
579 "BRNG FROM?"
580 PROMPT
581 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
582 LBL "*CLSEST" ; CLOSEST WAYPOINT IN DATABASE, VOR OR AIRPORT
583 LBL 60
584 0
585 STO 47
586 1000 ; INITIALIZE CLOSEST DISTANCE TO 1000 NM
587 STO 39 ; CLSDST CURRENT LAT/LON FROM DEDUCED POSITION
588 RCL 20 ; DEDLAT
589 STO 41
590 RCL 21 ; DEDLON
591 STO 42
592 CF 25
593 LBL 61
594 "WAYPTS"
595 RCL 47
596 SEEKPTA
597 RDN
598 SF 25
599 LBL 82
600 GETREC
601 FC? 25
602 GTO 84
603 ASTO 30 ; USE VOR 2 AS TEMPORARY VARIABLE
604 0
605 SEEKPTA
606 43.044
607 GETRX
608 XEQ 74 ; *GCLINE
609 RCL 39 ; CLSDST CURRENT DISTANCE TO CLOSEST WAYPOINT
610 RCL 46 ; DISTANCE TO WAYPOINT BEING TESTED
611 X>Y?
612 GTO 83
613 STO 39 ; CLSDST
614 RCL 45
615 STO 38 ; CLSBRG
616 CLA
617 ARCL 30
618 ASTO 37 ; CLSWPT
619 LBL 83
620 1
621 ST+ 47
622 GTO 61
623 LBL 84
624 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
625 LBL "*MAGVAR" ; INPUTS DED RECON LAT (N) =R19
626 LBL 70 ; DED RECON LONG (W) = R20
627 "MAGVAR"
628 0
629 SEEKPTA
630 38.047 ; NOTE OVERWRITES CLOSEST WAYPOINT BEARING AND DISTANCE
631 GETRX ; FROM ED WILLIAMS (REPRODUCED WITHOUT PERMISSION)
632 RCL 38 ; -65.6811
633 RCL 20 ; x ;CONUS
634 RCL 39 ; x=latitude (N deg) y=longitude (W deg) var= variation
635 *
636 + ; var=-65.6811+0.99*x+0.0128899*x^2-0.0000905928*x^3+2.87622*y-
637 RCL 20 ; 0.0116268*x*y - 0.00000603925*x^2*y - 0.0389806*y^2 -
638 X^2 ; 0.0000403488*x*y^2 + 0.000168556*y^3
639 RCL 40 ; 0.0128899
640 * ; (24 < x < 50, 66 < y < 125)
641 +
642 RCL 20 ; x
643 3
644 Y^X
645 RCL 41 ; -0.000905928
646 *
647 +
648 RCL 21
649 RCL 42 ; 2.87622
650 *
651 +
652 RCL 20 ; x
653 RCL 21 ; y
654 *
655 RCL 43 ; -0.0116268
656 *
657 +
658 RCL 20 ; x
659 X^2
660 RCL 21 ; y
661 *
662 RCL 44 ; -0.00000603925
663 *
664 +
665 RCL 21 ; y
666 X^2
667 RCL 45 ; -0.0389806
668 *
669 +
670 RCL 20 ; x
671 RCL 21 ; y
672 X^2
673 *
674 RCL 46 ; -0.0000403488
675 *
676 +
677 RCL 21 ; y
678 3
679 Y^X
680 RCL 47 ; 0.000168556
681 *
682 +
683 STO 13
684 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
685 LBL "*DENALT"
686 LBL 62
687 FS? 02 ; ONLY RECALCULATE IF ALTIMETER OR BARO CHANGES
688 GTO 63
689 RCL 12
690 STO 16
691 FIX 02
692 RCL 11 ; [ALTSET]
693 29.92126
694 /
695 .190261
696 Y^X
697 CHS
698 1
699 +
700 145442.2
701 *
702 RCL 12 ; [ALTITD]
703 +
704 STO 40
705 RCL 10
706 273.15
707 +
708 STO 41
709 288.15
710 .0019812
711 RCL 09
712 *
713 -
714 STO 42
715 RCL 41
716 /
717 .0234969
718 Y^X
719 CHS
720 1
721 +
722 RCL 42
723 *
724 .0019812
725 /
726 RCL 40
727 +
728 STO 16 ; [DENALT]
729 SF 02
730 LBL 63
731 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
732 LBL "*SPEEDS"
733 LBL 42
734 FIX 00
735 RCL 16 ; DENALT COMPUTE TRUE AIRSPEED
736 6.8755856 E-6
737 *
738 CHS
739 1
740 +
741 2.127940
742 Y^X
743 1/X
744 RCL 09 ; IAS
745 *
746 STO 08 ; TAS
747 FS? 05 ; SKIP GROUND SPEED ESTIMATION IF AN OBSERVED GROUND
748 GTO 92 ; SPEED HAS BEEN DETERMINED, APPLY WIND VECTOR
749 RCL 03 ; TRUCRS
750 RCL 08 ; TAS
751 P-R
752 RCL 14 ; WINDDIR
753 XEQ a ; WINSPD
754 RCL 15
755 P-R
756 X<>Y
757 RDN
758 +
759 RDN
760 +
761 R^
762 R-P
763 STO 07
764 RDN
765 RCL 03
766 -
767 CHS
768 RCL 03
769 +
770 360
771 MOD
772 STO 04
773 LBL 92
774 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
775 LBL "ACTWND"
776 "MAG HD?"
777 PROMPT
778 RCL 13
779 -
780 RCL 08
781 P-R
782 "CRS MADE?"
783 PROMPT
784 RCL 07
785 P-R
786 X<>Y
787 RDN
788 -
789 RDN
790 -
791 R^
792 R-P
793 STO 15
794 RDN
795 360
796 MOD
797 STO 14
798 RTN
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
799 LBL "ENDFLT"
800 CLRALMS
801 END