اطلاعیه

Collapse
No announcement yet.

کدام کامپایلر برای طرح های صنعتی معتبر است؟

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    #16
    پاسخ : کدام کامپایلر برای طرح های صنعتی معتبر است؟

    سلام به همه
    کامپایلر داکیومنت خوبی داره اون ها (فقط و فقط زبان اصلی فقط فقط خود کامپایلر) مطالعه بشه تو بعضیهاشون انقد تمیز توضیح داده که کدوم دستور برای چه کاری و چه عملیاتی بهتره
    تابه حال داکیومنتی در مورد کامپایلر نخوندم به چه اسمی دنبالش بگردم؟
    compiler document درسته؟ :rolleyes:
    ای خدا ، من باید از نظر علم از همه برتر باشم، تا مبادا که دشمنان مرا از این راه طعنه زنند. باید به آن سنگدلانی که علم را بهانه کرده و به دیگران فخر میآ*فروشند، ثابت کنم که خاک پای من هم نخواهند شد. باید همه آن تیره دلان مغرور و متکبر را به زانو در آورم، آنگاه خود خاضع ترین و افتاده ترین مرد روی زمین باشم.
    شهید دکتر مصطفی چمران
    اللهم صل علی محمد و ال محمد و عجل فرجهم
    ; C is not for children

    دیدگاه


      #17
      پاسخ : کدام کامپایلر برای طرح های صنعتی معتب&

      نوشته اصلی توسط مهدی رهی
      سلام به همهتابه حال داکیومنتی در مورد کامپایلر نخوندم به چه اسمی دنبالش بگردم؟
      compiler document درسته؟ :rolleyes:
      اینجا مورد بحث خود کامپایلر نیست اگه داکیومنت های اونو بخای بخونی مفاهیمش چیزای دیگن
      منظور اینجا داکیومنت های اون زبان مورد نظر هست تحت اون کامپایلر
      اول اینو بزارم که الان به چشمم خورد در مورد اون سی99 که میگفتم از سایت avr gcc هست
      کد:
      In general, it has been the goal to stick as best as possible to established standards while implementing this library. Commonly, this refers to the C library as described by the ANSI X3.159-1989 and ISO/IEC 9899:1990 ("ANSI-C") standard, as well as parts of their successor ISO/IEC 9899:1999 ("C99"). Some additions have been inspired by other standards like IEEE Std 1003.1-1988 ("POSIX.1"), while other extensions are purely AVR-specific (like the entire program-space string interface).

      هرکس یه جا میزاره سایت سازنده اینارو اعلام میکنه مثال

      avr gcc
      http://www.nongnu.org/avr-libc/

      یا پایتون
      https://docs.python.org/3/reference/index.html
      بعضی زبون ها که خدا خیرشون بده تو لایبرری ها سورس های زبون هدر ها هرجا رو که نگاه کنید کلی داکیومنت و اطلاعات داره باور کن جک هم یعضی جاها دیدم توش میزارن یا به قول خودشون تخم مرغ شانسی :biggrin:

      باز از پایتون لایبرری مثال
      کد:
      """An FTP client class and some helper functions.
      
      Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
      
      Example:
      
      >>> from ftplib import FTP
      >>> ftp = FTP('ftp.python.org') # connect to host, default port
      >>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
      '230 Guest login ok, access restrictions apply.'
      >>> ftp.retrlines('LIST') # list directory contents
      total 9
      drwxr-xr-x  8 root   wheel    1024 Jan 3 1994 .
      drwxr-xr-x  8 root   wheel    1024 Jan 3 1994 ..
      drwxr-xr-x  2 root   wheel    1024 Jan 3 1994 bin
      drwxr-xr-x  2 root   wheel    1024 Jan 3 1994 etc
      d-wxrwxr-x  2 ftp   wheel    1024 Sep 5 13:43 incoming
      drwxr-xr-x  2 root   wheel    1024 Nov 17 1993 lib
      drwxr-xr-x  6 1094   wheel    1024 Sep 13 19:07 pub
      drwxr-xr-x  3 root   wheel    1024 Jan 3 1994 usr
      -rw-r--r--  1 root   root     312 Aug 1 1994 welcome.msg
      '226 Transfer complete.'
      >>> ftp.quit()
      '221 Goodbye.'
      >>>
      
      A nice test that reveals some of the network dialogue would be:
      python ftplib.py -d localhost -l -p -l
      """
      
      #
      # Changes and improvements suggested by Steve Majewski.
      # Modified by Jack to work on the mac.
      # Modified by Siebren to support docstrings and PASV.
      # Modified by Phil Schwartz to add storbinary and storlines callbacks.
      # Modified by Giampaolo Rodola' to add TLS support.
      #
      
      import os
      import sys
      import socket
      from socket import _GLOBAL_DEFAULT_TIMEOUT
      
      __all__ = ["FTP","Netrc"]
      
      # Magic number from <socket.h>
      MSG_OOB = 0x1              # Process data out of band
      
      
      # The standard FTP server control port
      FTP_PORT = 21
      اگه کامل کپی میکردم خودش یه کتاب آموزشی کامل هست

      هدر فایل ها توی سی :
      کد:
      #define LCD_IO_MODE   1     /**< 0: memory mapped mode, 1: IO port mode */
      #if LCD_IO_MODE
      /**
       * @name Definitions for 4-bit IO mode
       * Change LCD_PORT if you want to use a different port for the LCD pins.
       *
       * The four LCD data lines and the three control lines RS, RW, E can be on the 
       * same port or on different ports. 
       * Change LCD_RS_PORT, LCD_RW_PORT, LCD_E_PORT if you want the control lines on
       * different ports. 
       *
       * Normally the four data lines should be mapped to bit 0..3 on one port, but it
       * is possible to connect these data lines in different order or even on different
       * ports by adapting the LCD_DATAx_PORT and LCD_DATAx_PIN definitions.
       * 
       */
      همه جا هست
      ولی اصل قضیه رفرنس های خود شرکت ها هستند
      مثال از avr gcc تابع delay که همه استفاده کردیم صد در صد
      http://www.nongnu.org/avr-libc/user-manual/group__util__delay.html
      یا مثل اون avr gcc و پایتون که فرستادم

      حالا مطلب مهم
      این نکته رو کپی میکنم که خوب بخونی
      کد:
      The macro F_CPU is supposed to be defined to a constant defining the CPU clock frequency (in Hertz).
      
      The maximal possible delay is 768 us / F_CPU in MHz.
      
      If the user requests a delay greater than the maximal possible one, _delay_us() will automatically call _delay_ms() instead. The user will not be informed about this case.
      
      If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long) support, maximal possible delay is 4294967.295 us/ F_CPU in MHz. For values greater than the maximal possible delay, overflow results in no delay i.e., 0us.
      خط آخر میگه اگه تحت شرایطی تاخیری که به میکرو میدیم از یه حدی بیشتر بشه اون متغییر سر ریز میشه over flow و باعث میشه که تاخیر 0 میکرو ثانیه در نظر گرفته بشه خط های بالا تر هم کلی چیز دیگه رو داره میگه
      این واسه تابعی هست که صبح تا شب داریم باهاش کار میکنیم فرط و فرط استفاده میکنیم اگه تو یه پروژه حالا این قضیه پیش بیاد تقصیر کامپایلرهه ؟ نههههههه
      اینا همه حساب کتاب داره معماری اون سیستم این محدودیت رو داره
      حالا فک کن به جای اینکه ویت صفر شه فلان پایه صفر یا یک شه یا فلان قسمت حافظه از نو نوشته شه و خیلی چیزای دیگه
      این تازه مثال از یه تابع بود (ماکرو) که همش داریم باهاش کار میکنیم
      بلافاصله خط بعد داره چی میگه ؟
      Conversion of __us into clock cycles may not always result in integer. By default, the clock cycles rounded up to next integer. This ensures that the user gets atleast __us microseconds of delay.
      البته میکرو ثانیه مقدار خیلی کمیه ولی تو یه سیستم بحرانی چی ؟
      من دوست ندارم خودم را درگیر مسئله بهشت یا جهنم بکنم ، چون در هر دو قسمت دوستان خوبی دارم !

      دیدگاه

      لطفا صبر کنید...
      X