.CREATE FIB4.PA#I// CALCULATE FIBONACCI SEQUENCE USING DOUBLE PRECISION ARITHMETIC/ ENTRY AT START (*210)/*200NH, 0NL, 0 /NN1H, 0N1L, 0 / N - 1N2H, 0N2L, 0 / N - 2C, -60/*210START, CLA CLL IACDCA N1L / N - 1 = 1DCA N1HDCA N2L / N - 2 = 0DCA N2HDCA NL / N = 0DCA NH/LOOP, CLA CLL / CLR RESULTTAD N1L / ADD N-1TAD N2L / ADD N-2DCA NLRALTAD N1HTAD N2HDCA NH / SAVE IN N/CLA CLLTAD N1L / COPY N1 TO N2DCA N2LTAD N1HDCA N2HTAD NL / COPY N TO N1DCA N1LTAD NHDCA N1H/JMS UDPRNTNH/JMS CRLF / PRINT NEWLINEISZ CJMP LOOP / ROUND AGAINJMP 7600 / BACK TO OS/8// CRLF - PRINT NEWLINECRLF, 0CLA CLLTAD K215JMS TYPETAD K212JMS TYPEJMP I CRLFK215, 215K212, 212// PRINT THE ASCII CHARACTER IN ACCTYPE, 0TSFJMP .-1TLSCLA CLLJMP I TYPE/*20/ DOUBLE WORD DECIMAL PRINTUDPRNT, 0CLA CLLTAD I UDPRNTDCA UDGETTAD I UDGETDCA UDHIGHISZ UDGETTAD I UDGETDCA UDLOWTAD UDLOOPDCA UDCNTTAD UDADDRDCA UDPTRISZ UDPRNTUDARND, TAD I UDPTRISZ UDPTRDCA UDHSUBTAD I UDPTRISZ UDPTRDCA UDLSUBUDDO, CLLTAD UDLSUBTAD UDLOWDCA UDTEMLRALTAD UDHSUBTAD UDHIGHSNLJMP UDOUTISZ UDBOXDCA UDHIGHTAD UDTEMLDCA UDLOWJMP UDDOUDOUT, CLATAD UDBOXTAD UDTWOTSFJMP .-1TLSCLA CLLDCA UDBOXISZ UDCNTJMP UDARNDJMP I UDPRNT/UDLOOP, -10UDADDR, UDCONLUDTWO, 260UDCNT, 0UDHIGH, 0UDLOW, 0UDHSUB, 0UDLSUB, 0UDBOX, 0UDTEML, 0UDGET, 0UDPTR, 0UDCONL, 3166460074136700774745407775436077776030777776347777776677777777/$(Control L to end input)#E
.COMPI FIB4.PAERRORS DETECTED: 0LINKS GENERATED: 1
.R ABSLDR*FIB4.BN*^C
.ODT00210G000000100000020000003000000500000080000013000002100000340000055000008900001440000233000037700006100000987000159700025840004181000676500109460017711002865700463680075025012139301964180317811051422908320401346269217830935245785702887
1 /2 / CALCULATE FIBONACCI SEQUENCE USING DOUBLE PRECISION ARITHMETIC3 / ENTRY AT START (*210)4 /5 0200 *2006 00200 0000 NH, 07 00201 0000 NL, 0 /N8 00202 0000 N1H, 09 00203 0000 N1L, 0 / N - 110 00204 0000 N2H, 011 00205 0000 N2L, 0 / N - 212 00206 7720 C, -6013 /14 0210 *21015 00210 7301 START, CLA CLL IAC16 00211 3203 DCA N1L / N - 1 = 117 00212 3202 DCA N1H18 00213 3205 DCA N2L / N - 2 = 019 00214 3204 DCA N2H20 00215 3201 DCA NL / N = 021 00216 3200 DCA NH22 /23 00217 7300 LOOP, CLA CLL / CLR RESULT24 00220 1203 TAD N1L / ADD N-125 00221 1205 TAD N2L / ADD N-226 00222 3201 DCA NL27 00223 7004 RAL28 00224 1202 TAD N1H29 00225 1204 TAD N2H30 00226 3200 DCA NH / SAVE IN N31 /32 00227 7300 CLA CLL33 00230 1203 TAD N1L / COPY N1 TO N234 00231 3205 DCA N2L35 00232 1202 TAD N1H36 00233 3204 DCA N2H37 00234 1201 TAD NL / COPY N TO N138 00235 3203 DCA N1L39 00236 1200 TAD NH40 00237 3202 DCA N1H41 /42 00240 4020 JMS UDPRNT43 00241 0200 NH44 /45 00242 4246 JMS CRLF / PRINT NEWLINE46 00243 2206 ISZ C47 00244 5217 JMP LOOP / ROUND AGAIN48 00245 5777@ JMP 7600 / BACK TO OS/849 /50 / CRLF - PRINT NEWLINE51 00246 0000 CRLF, 052 00247 7300 CLA CLL53 00250 1255 TAD K21554 00251 4257 JMS TYPE55 00252 1256 TAD K21256 00253 4257 JMS TYPE57 00254 5646 JMP I CRLF58 00255 0215 K215, 21559 00256 0212 K212, 21260 /61 / PRINT THE ASCII CHARACTER IN ACC62 00257 0000 TYPE, 063 00260 6041 TSF64 00261 5260 JMP .-165 00262 6046 TLS66 00263 7300 CLA CLL67 00264 5657 JMP I TYPE68 /00377 760069 0020 *2070 / DOUBLE WORD DECIMAL PRINT71 00020 0000 UDPRNT, 072 00021 7300 CLA CLL73 00022 1420 TAD I UDPRNT74 00023 3107 DCA UDGET75 00024 1507 TAD I UDGET76 00025 3101 DCA UDHIGH77 00026 2107 ISZ UDGET78 00027 1507 TAD I UDGET79 00030 3102 DCA UDLOW80 00031 1075 TAD UDLOOP81 00032 3100 DCA UDCNT82 00033 1076 TAD UDADDR83 00034 3110 DCA UDPTR84 00035 2020 ISZ UDPRNT85 00036 1510 UDARND, TAD I UDPTR86 00037 2110 ISZ UDPTR87 00040 3103 DCA UDHSUB88 00041 1510 TAD I UDPTR89 00042 2110 ISZ UDPTR90 00043 3104 DCA UDLSUB91 00044 7100 UDDO, CLL92 00045 1104 TAD UDLSUB93 00046 1102 TAD UDLOW94 00047 3106 DCA UDTEML95 00050 7004 RAL96 00051 1103 TAD UDHSUB97 00052 1101 TAD UDHIGH98 00053 7420 SNL99 00054 5062 JMP UDOUT100 00055 2105 ISZ UDBOX101 00056 3101 DCA UDHIGH102 00057 1106 TAD UDTEML103 00060 3102 DCA UDLOW104 00061 5044 JMP UDDO105 00062 7200 UDOUT, CLA106 00063 1105 TAD UDBOX107 00064 1077 TAD UDTWO108 00065 6041 TSF109 00066 5065 JMP .-1110 00067 6046 TLS111 00070 7300 CLA CLL112 00071 3105 DCA UDBOX113 00072 2100 ISZ UDCNT114 00073 5036 JMP UDARND115 00074 5420 JMP I UDPRNT116 /117 00075 7770 UDLOOP, -10118 00076 0111 UDADDR, UDCONL119 00077 0260 UDTWO, 260120 00100 0000 UDCNT, 0121 00101 0000 UDHIGH, 0122 00102 0000 UDLOW, 0123 00103 0000 UDHSUB, 0124 00104 0000 UDLSUB, 0125 00105 0000 UDBOX, 0126 00106 0000 UDTEML, 0127 00107 0000 UDGET, 0128 00110 0000 UDPTR, 0129 00111 3166 UDCONL, 3166130 00112 4600 4600131 00113 7413 7413132 00114 6700 6700133 00115 7747 7747134 00116 4540 4540135 00117 7775 7775136 00120 4360 4360137 00121 7777 7777138 00122 6030 6030139 00123 7777 7777140 00124 7634 7634141 00125 7777 7777142 00126 7766 7766143 00127 7777 7777144 00130 7777 7777145 /146 $No detected errors1 link generated