12.07.2015 Views

CAD in Civil Engineering - Baustatik-Info-Server

CAD in Civil Engineering - Baustatik-Info-Server

CAD in Civil Engineering - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Page 6 Computer Languages for Eng<strong>in</strong>eer<strong>in</strong>g - SS 13often be either directly executed on a virtual mach<strong>in</strong>e (i.e. <strong>in</strong>terpreter), or it may be further compiled<strong>in</strong>to mach<strong>in</strong>e code for better performance. Languages which are designed for the executionof bytecode are Java, Smalltalk, Python, Forth, TCL and C#.1.2 Some History1.2.1 MotivationTo understand the importance of the development of the FORTRAN language, the code for the calculationof the nth fibunacci number is given <strong>in</strong> mach<strong>in</strong>e and assembler code.The fibunacci number are def<strong>in</strong>ed as follows.f n = f n−1 + f n−2 for n > 2, with f 0 = 1 and f 1 = 1 (1.1)The implementation of the calculation of the nth fibunacci numberis given below <strong>in</strong> mach<strong>in</strong>e code1 8B542408 83FA0077 06B80000 0000C3832 FA027706 B8010000 00C353BB 010000003 B9010000 008D0419 83FA0376 078BD98B4 C84AEBF1 5BC3The implementation of the calculation of the nth fibunacci numberis given below <strong>in</strong> x86 assembler.1 fib:2 mov edx, [esp+8]3 cmp edx, 04 ja @f5 mov eax, 06 ret78 @@:9 cmp edx, 210 ja @f11 mov eax, 112 ret1314 @@:15 push ebx16 mov ebx, 117 mov ecx, 11819 @@:20 lea eax, [ebx+ecx]21 cmp edx, 322 jbe @f23 mov ebx, ecx24 mov ecx, eax25 dec edx26 jmp @b2728 @@:29 pop ebx30 retE. Baeck

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!