# Treatments from [/home/crudel/Dev/U2I-Serial/FileCommands-FC-PI.txt]... # Set termio parameters... # Send '?' character for 'autobaud'... U2I 1.78 0x800000 0 0x64-0> write 0x0000 NOP # Calcul du nombre PI a partir de sa fraction continue avec 8 coefficients # 1 # PI = 3.14159... = 3 + -------- = [3;7,15,1,292,1,1,1,...] # 7 + 1 # ------- # 15 + ... # Definitions --------------- #define REG_RealValue 10 # reg[10]: Valeur reelle #define REG_ResultValue 11 # reg[11]: Resultat #define REG_X 20 # reg[20]: X_0; reg[21]: X_1, etc. #define FORMAT_0_0 0 # Formatage au mieux #define FORMAT FORMAT_0_0 # Utilisation de 'FORMAT_0_0' # Fin des definitions ------- # Debut du programme -------- # Initialisation 0x64-1> write 0x000214 SELECTX,REG_X # REG_X vu comme reg[X] 0x64-2> write 0x0070020000000300000007 WRBLK,2,3,7 # Set value to X, X+1, ... 0x64-3> write 0x0070020000000f00000001 WRBLK,2,15,1 # avec [X_0, X_1, ..., X_7] 0x64-4> write 0x0070020000012400000001 WRBLK,2,292,1 # ... 0x64-5> write 0x0070020000000100000001 WRBLK,2,1,1 # ... # Get the real value 0x64-6> write 0x005e LOADPI # reg[A] = PI = 3.141592... 0x64-7> write 0x00080a COPYA,REG_RealValue 0x64-8> write 0x001f00 FTOA,0 # Formatage 0x64-9> write 0x00f2 READSTR # Affichage 0x64-10> reada # Lecture 'string buffer' en ASCII jusqu'au '\0' "3.1415927" 0x64-11> write 0x0000 NOP # Execution de X_0 + 1 / (X_1 + 1 / (X_2 + 1 + 1 / ...)) 0x64-12> write 0x000214 SELECTX,REG_X # REG_X vu comme reg[X] 0x64-13> write 0x0014 LEFT # temp1 vu comme reg[A] 0x64-14> write 0x000d ALOADX # temp1 = reg[A] = X_0, X = X + 1 0x64-15> write 0x0060 FLOAT 0x64-16> write 0x0014 LEFT # temp2 vu comme reg[A] 0x64-17> write 0x000d ALOADX # temp2 = reg[A] = X_1, X = X + 1 0x64-18> write 0x0060 FLOAT 0x64-19> write 0x0014 LEFT 0x64-20> write 0x000d ALOADX # temp3 = reg[A] = X_2, X = X + 1 0x64-21> write 0x0060 FLOAT 0x64-22> write 0x0014 LEFT 0x64-23> write 0x000d ALOADX # temp4 = reg[A] = X_3, X = X + 1 0x64-24> write 0x0060 FLOAT 0x64-25> write 0x0014 LEFT 0x64-26> write 0x000d ALOADX # temp5 = reg[A] = X_4, X = X + 1 0x64-27> write 0x0060 FLOAT 0x64-28> write 0x0014 LEFT 0x64-29> write 0x000d ALOADX # temp6 = reg[A] = X_5, X = X + 1 0x64-30> write 0x0060 FLOAT 0x64-31> write 0x0014 LEFT 0x64-32> write 0x000d ALOADX # temp7 = reg[A] = X_6, X = X + 1 0x64-33> write 0x0060 FLOAT 0x64-34> write 0x0014 LEFT 0x64-35> write 0x000d ALOADX # temp8 = reg[A] = X_7, X = X + 1 0x64-36> write 0x0060 FLOAT 0x64-37> write 0x0040 FINV # 1 / (X_7 + 1) 0x64-38> write 0x0015 RIGHT 0x64-39> write 0x002a FADD0 # X_6 + 1 / (X_7 + 1) 0x64-40> write 0x0040 FINV # 1 / (X_6 + 1 / (X_7 + 1)) 0x64-41> write 0x0015 RIGHT 0x64-42> write 0x002a FADD0 # X_5 + 1 / (X_6 + 1 / (X_7 + 1)) 0x64-43> write 0x0040 FINV # 1 / (X_1 + 1 / (X_2 + 1 / (X_3 + 1))) 0x64-44> write 0x0015 RIGHT 0x64-45> write 0x002a FADD0 # etc. 0x64-46> write 0x0040 FINV # etc. 0x64-47> write 0x0015 RIGHT 0x64-48> write 0x002a FADD0 0x64-49> write 0x0040 FINV 0x64-50> write 0x0015 RIGHT 0x64-51> write 0x002a FADD0 0x64-52> write 0x0040 FINV 0x64-53> write 0x0015 RIGHT 0x64-54> write 0x002a FADD0 0x64-55> write 0x0040 FINV 0x64-56> write 0x0015 RIGHT 0x64-57> write 0x002a FADD0 # X_0 + 1 / (X_1 + 1 / (X_2 + 1 / (X_3 + 1 / ...))) 0x64-58> write 0x0015 RIGHT # Resultat dans reg[0] et restauration de reg[A] # Fin: Execution de X_0 + 1 / (X_1 + 1 / (X_2 + 1 + 1 / ...)) 0x64-59> write 0x00100b COPY0,REG_ResultValue # Sauvegarde du resultat a partir de reg[0] # Impression du resultat 0x64-60> write 0x0029 FSET0 0x64-61> write 0x001f00 FTOA,FORMAT # Formatage 0x64-62> write 0x00f2 READSTR # Affichage 0x64-63> reada # Lecture 'string buffer' en ASCII jusqu'au '\0' "3.1415927" 0x64-64> write 0x0000 NOP # Difference avec la valeur reelle 0x64-65> write 0x00200a FSET,REG_RealValue 0x64-66> write 0x00220b FSUB,REG_ResultValue 0x64-67> write 0x001f00 FTOA,FORMAT # Formatage 0x64-68> write 0x00f2 READSTR # Affichage 0x64-69> reada # Lecture 'string buffer' en ASCII jusqu'au '\0' "0.0" 0x64-70> write 0x0000 NOP # Fin du programme ---------- 0x64-71> # End of program (successful ;-)