الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ما اللغة التى صممت compiler الأسمبلى

مغلق
بدأه egy_soft في 8 مايو 2004 · 10 رد · 4,413 مشاهدة · في أرشيف قسم الـــ Assembly
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

بسم الله الرحمن الرحيم

لو تكرمتم عندى سؤال بسيط مكون من قسمين فمن خلاله سوف أعرف حاجات كثيرة تحيرنى فى عالم اللغات .

ماهى اللغة التى صمموا بها MASM أو TASM أو بمعنا أدق الـ compiler الخاص بهم وكيف تم تصميمهم ؟

شكراً

#2

هل ما يحيرك هو الدجاجة ام البيضة اولا؟ في هذه الحالة البيضة اولا ثم دجاجة ثم بيضة وهكذا.

ان اول برنامج كان ولا بد ان يكون بلغة الالة وقد تم يدويا وليس بالاسمبلي وكان يتم ادخال الادرس العنوان والمعلومة بايت بمفاتيح فتح واغلاق ثم مفتاح لتسجيل المعلومة (البايت) يتم بعدها تشغيل البرنامج بمفتاح آخر للتنفيذ. ومن ثم يصبح عندك برنامج وهذا البرنامج ممكن يكون اسمبلر. ثم تكتب برنامج بالسمبلي لتكون كمبايلر للغة مثل ال C . ثم تستخدم ال C لانتاج برامج مثل compiler الاسمبلي.

ان compiler الاسمبلي الحالى يكتب الان بلغة مثل لغة C .

والله اعلم

39_22.gif

تزود من التقوى فإنك لا تدري *** إذا جن ليل هل تعيش إلى الفجر

فكم من فتى أمسى وأصبح ضاحكاً *** وقد نسجت أكفانه وهو لا يدري

لقراءة القرآن الكريم و سماعه و تفسيره ........

ماذا يعني انني مسلم سني؟

قصة غريبة

ConflictResolution.gif

#3

السلام عليكم

لا اعرف بالنسبه ل 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 : يجب ان تدرك انه هناك حد ادنى للمعرفة المطلوبة قبل البدء في عمل أي شئ.

#4

السلام عليكم,

لنعلم أن برمجة كمبايلر للأسمبلر يكون أسهل من برمجة كمبايلر للغة متطورة وذلك لأن الأسمبلر هو الأقرب للغة الآلة.

ولبرمجة كمبايلر يمكن أن نستعمل أية لغة والطريقة البدائية يمكن أن تكون كالتالي :

نضع علاقة مباشرة بين أمر الأسمبلر وكود الآلة الخلص لهذا الأمر. فمثلا لو يعثر الكمبايلر على الكلمة inc ax فسوف يبحث عن مقابلها في Table للعلاقة نكون قد هيأناه مسبقا ويقوم بكتابة الكود الخاص بها .

هذا بعجالة وإلى اللقاء.

#5

صمموهم بلاسمبلي نفسها

قطرة الماء تـثـقب الحجر.. لا بالعنف. لكن بتكرار المحاولة

at4re.gif

منتديات الفريق العربي للهندسة العكسية 不喜欢的勿入! www.at4re.com

#6
اقتباس
لا اعرف بالنسبه ل masm و Tasm اى كومبيلر استخدم فى تصميمها ولكن هناك ما يسمى lexical analyses generator امثال Lex,Flex,Yacc,Bison, Ox,Jack,PCCTS و غيرهم الكثير.

هذا الكلام صحيح اعتقد هذة هي الطريقة

#7

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

Programmer&Cracker CS

MyBlog: Blog.Amahdy.com

MyWebSite: www.Amahdy.com

#8

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

Programmer&Cracker CS

MyBlog: Blog.Amahdy.com

MyWebSite: www.Amahdy.com

#9

كلام جميل جدا ...

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]

#10
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

Programmer&Cracker CS

MyBlog: Blog.Amahdy.com

MyWebSite: www.Amahdy.com

#11
عماد الخليل كتب:
ان اول برنامج كان ولا بد ان يكون بلغة الالة وقد تم يدويا وليس بالاسمبلي وكان يتم ادخال الادرس العنوان والمعلومة بايت بمفاتيح فتح واغلاق ثم مفتاح لتسجيل المعلومة (البايت) يتم بعدها تشغيل البرنامج بمفتاح آخر للتنفيذ.

الموضوع: بأي لغة صنع برنامج فيجيوال بيسك؟؟ يحتوى على توضيح بسيط للعلاقة بين الاسمبلى Assembly ولغة الآلة Machine Code ، واللذان يعتبران وجهان لعملة واحدة

Eng. Usama El-Mokadem

Nothing is impossible, the word impossible itself says that: I M - Possible

هذا الموضوع مغلق.

مواضيع مشابهة