بسم الله الرحمن الرحيم
لو تكرمتم عندى سؤال بسيط مكون من قسمين فمن خلاله سوف أعرف حاجات كثيرة تحيرنى فى عالم اللغات .
ماهى اللغة التى صمموا بها MASM أو TASM أو بمعنا أدق الـ compiler الخاص بهم وكيف تم تصميمهم ؟
شكراً
بسم الله الرحمن الرحيم
لو تكرمتم عندى سؤال بسيط مكون من قسمين فمن خلاله سوف أعرف حاجات كثيرة تحيرنى فى عالم اللغات .
ماهى اللغة التى صمموا بها MASM أو TASM أو بمعنا أدق الـ compiler الخاص بهم وكيف تم تصميمهم ؟
شكراً
هل ما يحيرك هو الدجاجة ام البيضة اولا؟ في هذه الحالة البيضة اولا ثم دجاجة ثم بيضة وهكذا.
ان اول برنامج كان ولا بد ان يكون بلغة الالة وقد تم يدويا وليس بالاسمبلي وكان يتم ادخال الادرس العنوان والمعلومة بايت بمفاتيح فتح واغلاق ثم مفتاح لتسجيل المعلومة (البايت) يتم بعدها تشغيل البرنامج بمفتاح آخر للتنفيذ. ومن ثم يصبح عندك برنامج وهذا البرنامج ممكن يكون اسمبلر. ثم تكتب برنامج بالسمبلي لتكون كمبايلر للغة مثل ال C . ثم تستخدم ال C لانتاج برامج مثل compiler الاسمبلي.
ان compiler الاسمبلي الحالى يكتب الان بلغة مثل لغة C .
والله اعلم

تزود من التقوى فإنك لا تدري *** إذا جن ليل هل تعيش إلى الفجر
فكم من فتى أمسى وأصبح ضاحكاً *** وقد نسجت أكفانه وهو لا يدري
لقراءة القرآن الكريم و سماعه و تفسيره ........

السلام عليكم
لا اعرف بالنسبه ل masm و Tasm اى كومبيلر استخدم فى تصميمها ولكن هناك ما يسمى lexical analyses generator امثال Lex,Flex,Yacc,Bison, Ox,Jack,PCCTS و غيرهم الكثير.
هذا النوع من الكمبيلر يحول قواعد الغه التى تريد إستخدامها من قواعد الى كود, مثلاً PCCTS تحول قواعد اللغه الى C-code , والقواعد تكتب بهذه الصيغه:
<start> ::= ENDSYM
| ’\n’ <start>
| <expr> ’\n’ <start>
<expr> ::= <term> { (’+’|’-’) <term> }
<term> ::= <factor> { (’*’|’/’) <factor> }
<factor>::= <prim> [ ’^’ <factor> ]
<prim> ::= NUMBERSYM
| ’-’ <prim>
| ’(’ <expr> ’)’هذى مثال بسيط يبين العمليات الحسابيه البسيطه, إذا اردت معرفة و دراسة هذه الغه الشيقه فعليك بكتاب إسمه "T W Parsons: Introduction to compiler construction",
والسلام
لا إله إلا الله محمد رسول الله
busbar : يجب ان تدرك انه هناك حد ادنى للمعرفة المطلوبة قبل البدء في عمل أي شئ.
السلام عليكم,
لنعلم أن برمجة كمبايلر للأسمبلر يكون أسهل من برمجة كمبايلر للغة متطورة وذلك لأن الأسمبلر هو الأقرب للغة الآلة.
ولبرمجة كمبايلر يمكن أن نستعمل أية لغة والطريقة البدائية يمكن أن تكون كالتالي :
نضع علاقة مباشرة بين أمر الأسمبلر وكود الآلة الخلص لهذا الأمر. فمثلا لو يعثر الكمبايلر على الكلمة inc ax فسوف يبحث عن مقابلها في Table للعلاقة نكون قد هيأناه مسبقا ويقوم بكتابة الكود الخاص بها .
هذا بعجالة وإلى اللقاء.
صمموهم بلاسمبلي نفسها
قطرة الماء تـثـقب الحجر.. لا بالعنف. لكن بتكرار المحاولة
منتديات الفريق العربي للهندسة العكسية 不喜欢的勿入! www.at4re.com
اقتباسلا اعرف بالنسبه ل masm و Tasm اى كومبيلر استخدم فى تصميمها ولكن هناك ما يسمى lexical analyses generator امثال Lex,Flex,Yacc,Bison, Ox,Jack,PCCTS و غيرهم الكثير.
هذا الكلام صحيح اعتقد هذة هي الطريقة
well first we don't compile assembly code
we ASSEMBLE it
there is nothing called assembly combiler and has no sense
you write assembly code to be assembled in a file
actually Tasm, Masm and all those assemblers are created with c++ , isn't something strange
JAVA compiler is created with c++, c++ comiler itself is upgreated with the c++ language
isn't nessesary because a compiler compile a languge to be implemented with a lowest level programming .. your question should be HOW compilers work ??
a compiler is not something that you can't write yourself
any good programmer when he has the compiler algorithm can write a compiler and the problem isn't how compiler work but how programming language rules are
first the compiler consists of some basic steps which are syntx analyzer, lexical analyzer, semmantic ,code optimizer and assembling
each one of those previously mentioned steps just follow some rules depending the language and they could be implementent also with a high-level programming language
second the assembler:
it's very easier than the compiler, finally it's embed in the compiler and the steps to assemble a program are very easy they are :
-index all the program lines with memory address and give each label its own address
-change the OP-code to its equivalent machine number
-concatinate the op code with the label adress
-the final step is what depends from operating system to another which is generating the executable file following the OS exec file structure and this also follow some rules and could be easily implemented
again the problem isn't at all coding compiler ot assembler
the problem is putting mathematical rules for a prgramming language aka formal language and proof its semmantics
lex , flex and all those tools generate LEXICAL ANALYZER following some given REGULAR EXPPRESSIONS
regular expressions are some expressions writen by a mathematical rules following some formal language rules and they could be similar to what exists on the post #3
then we use lex and flex to convert those Regular Expressions (RE) to a parser and lexical analyzer which helps in the compiler implementation sometimes
but generally lex , yacc and all those tools could not help in big projects like c++ and java
finally we don't need at all the regular expressions when we talk about assemblers
assemblers doesn't make any iniline parsing they assemble the given instructions as they are without any parsing or anything at all.
Hope those informations could helps.
تم تعديل هذه المشاركة بواسطة Amahdy في 23 نوفمبر 2007 في 05:02
كلام جميل جدا ...
actually Tasm, Masm and all those assemblers are created with c++ , isn't something strange JAVA compiler is created with c++, c++ comiler itself is upgreated with the c++ language
لكن لا مانع من كتابة اسمبلر بلغة برمجة اخرى والموضوع متوقف على اتقان المبرمج لهذه اللغة + مرونة اللغة ؟ صحيح الكلام ؟
mov eax, dword ptr ds:[0xffdf0308]
jmp dword ptr [eax+0xfc]
GamingMasteR كتب:كلام جميل جدا ...actually Tasm, Masm and all those assemblers are created with c++ , isn't something strange JAVA compiler is created with c++, c++ comiler itself is upgreated with the c++ languageلكن لا مانع من كتابة اسمبلر بلغة برمجة اخرى والموضوع متوقف على اتقان المبرمج لهذه اللغة + مرونة اللغة ؟ صحيح الكلام ؟
YES you can write an assembler with visual basic, it's not something hard
عماد الخليل كتب:ان اول برنامج كان ولا بد ان يكون بلغة الالة وقد تم يدويا وليس بالاسمبلي وكان يتم ادخال الادرس العنوان والمعلومة بايت بمفاتيح فتح واغلاق ثم مفتاح لتسجيل المعلومة (البايت) يتم بعدها تشغيل البرنامج بمفتاح آخر للتنفيذ.
الموضوع: بأي لغة صنع برنامج فيجيوال بيسك؟؟ يحتوى على توضيح بسيط للعلاقة بين الاسمبلى Assembly ولغة الآلة Machine Code ، واللذان يعتبران وجهان لعملة واحدة
Nothing is impossible, the word impossible itself says that: I M - Possible
هذا الموضوع مغلق.