{"id":20017,"date":"2023-01-20T07:35:47","date_gmt":"2023-01-20T07:35:47","guid":{"rendered":"https:\/\/www.booksofall.com\/?post_type=product&#038;p=20017"},"modified":"2023-01-20T07:35:47","modified_gmt":"2023-01-20T07:35:47","slug":"calling-conventions-for-different-c-compilers-and-operating-systems","status":"publish","type":"product","link":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/","title":{"rendered":"Calling conventions for different C++ compilers and operating systems"},"content":{"rendered":"<p>Introduction<\/p>\n<p>This is the fifth in a series of five manuals:<\/p>\n<ol>\n<li>Optimizing software in\u00a0<a href=\"https:\/\/www.techtarget.com\/searchdatamanagement\/definition\/C\">C++<\/a>: An optimization guide for\u00a0<a href=\"https:\/\/docs.docker.com\/desktop\/install\/windows-install\/\">Windows<\/a>,\u00a0<a href=\"https:\/\/www.redhat.com\/en\/topics\/linux\/what-is-linux\">Linux<\/a>, and\u00a0<a href=\"https:\/\/www.computerhope.com\/jargon\/m\/mac.htm\">Mac<\/a>\u00a0platforms.<\/li>\n<li>Optimizing subroutines in assembly language: An optimization guide for\u00a0<a href=\"https:\/\/www.pcmag.com\/encyclopedia\/term\/x86\">x86 platforms<\/a>.<\/li>\n<li>The microarchitecture of Intel, AMD and VIA CPUs: An optimization guide for assembly programmers and compiler makers.<\/li>\n<li>Instruction tables: Lists of instruction latencies, throughputs and micro-operation breakdowns for Intel, AMD and VIA CPUs.<\/li>\n<li>Calling conventions for different C++ compilers and operating systems.<\/li>\n<\/ol>\n<p>The latest versions of these manuals are always available from www.agner.org\/optimize. Copyright conditions are listed on page 60 below.<\/p>\n<p>The present manual describes technical details about compilers that are often poorly documented or not documented at all. This includes differences between various C++ compilers that affect binary compatibility, such as memory model, data storage, function calling conventions, and name mangling. These details are described in detail for each compiler or for each platform, where appropriate.<\/p>\n<p>The purposes of publishing this information are:<\/p>\n<p>\u2022 Point out incompatibilities between compilers.<\/p>\n<p>\u2022 Make new compilers compatible with old ones.<\/p>\n<p>\u2022 Solve compatibility problems between function libraries produced by different compilers.<\/p>\n<p>\u2022 Facilitate linking different programming languages together.<\/p>\n<p>\u2022 Facilitate the making of assembly subroutines that are compatible with multiple compilers and multiple operating systems.<\/p>\n<p>\u2022 Solve compatibility problems for data stored in binary files.<\/p>\n<p>\u2022 Facilitate the construction of debugging, profiling and disassembly tools.<\/p>\n<p>\u2022 Facilitate the construction of object file conversion utilities.<\/p>\n<p>\u2022 Provoke compiler vendors to use open standards.<\/p>\n<p>\u2022 Inspire future standardization.<\/p>\n<p>Hardware platforms covered:<\/p>\n<p>\u2022 x86 microprocessors with 16 bit, 32 bit and 64 bit architectures from Intel, AMD, VIA and possibly other vendors.<\/p>\n<p>The IA64 architecture, which is implemented in Intel&#8217;s Itanium processor, is not compatible with the x86 architecture, and is not covered in this report.<\/p>\n<p>Operating systems covered:<\/p>\n<p>\u2022 DOS, 16 bit.<\/p>\n<p>\u2022 Windows, 16 bit, 32 bit and 64 bit.<\/p>\n<p>\u2022 Linux, 32 bit and 64 bit.<\/p>\n<p>\u2022 FreeBSD etc. 32 bit and 64 bit.<\/p>\n<p>\u2022 Mac OS X, Intel based, 32 bit and 64 bit.<\/p>\n<p>C++ compilers tested:<\/p>\n<p>\u2022 Borland, 16 bit v. 3.0 and 5.0<\/p>\n<p>\u2022 Microsoft, 16 bit, v. 8.0<\/p>\n<p>\u2022 Watcom, 16 bit v. 1.2<\/p>\n<p>\u2022 Borland 32 bit v. 5.0<\/p>\n<p>\u2022 Microsoft, 32 bit, v. 9.0, 13.10, 16.3<\/p>\n<p>\u2022 Gnu, 32 bit, v. 2.95, 3.3.3, 4.1.0 and several other versions under Linux, FreeBSD and Windows.<\/p>\n<p>\u2022 Watcom, 32 bit, v. 1.2<\/p>\n<p>\u2022 Symantec, 32 bit, v. 7.5<\/p>\n<p>\u2022 Digital Mars, 32 bit, v. 8.3.8<\/p>\n<p>\u2022 Codeplay VectorC, 32bit, v. 2.1.7<\/p>\n<p>\u2022 Intel, 32 bit for Windows and Linux, v. 8.1 and 9.1<\/p>\n<p>\u2022 Microsoft, 64 bit, v. 14.00, 16.3<\/p>\n<p>\u2022 Gnu, 64 bit, v. 3.3.3, 4.1.0, 7.4.0, 9.2.0 for Linux and Windows<\/p>\n<p>\u2022 Clang, 64 bit, v. 5.0, 9.0 for Linux and Windows<\/p>\n<p>\u2022 Intel, 64 bit for Windows and Linux, v. 8.1 and 9.1<\/p>\n<p>This document provides information that is typically difficult to find. The documentation of calling conventions and binary interfaces of compilers and operating systems is often shamefully poor and sometimes completely absent.<\/p>\n<p>As most of the information given here is based on my own experiments, it is obviously not authoritative, and it is not guaranteed to be accurate or complete. This document tells how things are, not how they are supposed to be. Some details appear to be the haphazard consequences of how compilers happen to be implemented rather than results of careful planning. Calling &#8220;conventions&#8221; may not be the most appropriate term in this case, but it may be necessary to copy the quirks of existing compilers when full compatibility is desired. I have no knowledge about whether any information provided here is protected by patents or other legal restrictions, but I have found no specific patent markings on the compilers.<\/p>\n<p>I have gathered this information mainly by converting C++ code to assembly. All the compilers I have tested are capable of converting C++ to assembly, either directly or via object files. The reader is encouraged to do your own research, if necessary, to get additional information needed or to clarify any questions you may have. The easiest way of doing this research is to make the compiler convert a C++ test file to assembly. Other possible methods are to use object file dump utilities, disassembly utilities, or provoke error messages from a linker. If you find any errors in this document then please let me know.<\/p>\n<p>Please note that I don&#8217;t have the time and resources to help people with their programming problems. If you Email me with such questions, you will not get any answer. You may send your questions to appropriate internet forums instead.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><iframe style=\"width: 100%; height: 700px; border: none;\" src=\"https:\/\/online.visual-paradigm.com\/share\/book\/calling-conventions-18a505grpi?enforceShowPromotionBar=true&amp;p=1\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"featured_media":20020,"template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":""},"product_brand":[],"product_cat":[268],"product_tag":[],"class_list":{"0":"post-20017","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-assembly-language","8":"first","9":"instock","10":"shipping-taxable","11":"product-type-simple"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Calling conventions for different C++ compilers and operating systems - BooksOfAll Portuguese<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Calling conventions for different C++ compilers and operating systems - BooksOfAll Portuguese\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/\" \/>\n<meta property=\"og:site_name\" content=\"BooksOfAll Portuguese\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png\" \/>\n<meta name=\"twitter:label1\" content=\"Tempo estimado de leitura\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/\",\"url\":\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/\",\"name\":\"Calling conventions for different C++ compilers and operating systems - BooksOfAll Portuguese\",\"isPartOf\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png\",\"datePublished\":\"2023-01-20T07:35:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#primaryimage\",\"url\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png\",\"width\":\"719\",\"height\":\"725\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.booksofall.com\/pt\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categories\",\"item\":\"https:\/\/www.booksofall.com\/pt\/categories\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calling conventions for different C++ compilers and operating systems\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/#website\",\"url\":\"https:\/\/www.booksofall.com\/pt\/\",\"name\":\"BooksOfAll Portuguese\",\"description\":\"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.\",\"publisher\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.booksofall.com\/pt\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-PT\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/#organization\",\"name\":\"BooksOfAll Portuguese\",\"url\":\"https:\/\/www.booksofall.com\/pt\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2022\/06\/booksofall-logo-2.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2022\/06\/booksofall-logo-2.png\",\"width\":166,\"height\":30,\"caption\":\"BooksOfAll Portuguese\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Calling conventions for different C++ compilers and operating systems - BooksOfAll Portuguese","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/","og_locale":"pt_PT","og_type":"article","og_title":"Calling conventions for different C++ compilers and operating systems - BooksOfAll Portuguese","og_url":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/","og_site_name":"BooksOfAll Portuguese","og_image":[{"url":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png","twitter_misc":{"Tempo estimado de leitura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/","url":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/","name":"Calling conventions for different C++ compilers and operating systems - BooksOfAll Portuguese","isPartOf":{"@id":"https:\/\/www.booksofall.com\/pt\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#primaryimage"},"image":{"@id":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#primaryimage"},"thumbnailUrl":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png","datePublished":"2023-01-20T07:35:47+00:00","breadcrumb":{"@id":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/"]}]},{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#primaryimage","url":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png","contentUrl":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/01\/img_63ca421ab02fc.png","width":"719","height":"725"},{"@type":"BreadcrumbList","@id":"https:\/\/www.booksofall.com\/pt\/calling-conventions-for-different-c-compilers-and-operating-systems\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.booksofall.com\/pt\/"},{"@type":"ListItem","position":2,"name":"Categories","item":"https:\/\/www.booksofall.com\/pt\/categories\/"},{"@type":"ListItem","position":3,"name":"Calling conventions for different C++ compilers and operating systems"}]},{"@type":"WebSite","@id":"https:\/\/www.booksofall.com\/pt\/#website","url":"https:\/\/www.booksofall.com\/pt\/","name":"BooksOfAll Portuguese","description":"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.","publisher":{"@id":"https:\/\/www.booksofall.com\/pt\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.booksofall.com\/pt\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-PT"},{"@type":"Organization","@id":"https:\/\/www.booksofall.com\/pt\/#organization","name":"BooksOfAll Portuguese","url":"https:\/\/www.booksofall.com\/pt\/","logo":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/www.booksofall.com\/pt\/#\/schema\/logo\/image\/","url":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2022\/06\/booksofall-logo-2.png","contentUrl":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2022\/06\/booksofall-logo-2.png","width":166,"height":30,"caption":"BooksOfAll Portuguese"},"image":{"@id":"https:\/\/www.booksofall.com\/pt\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product\/20017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/media\/20020"}],"wp:attachment":[{"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/media?parent=20017"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product_brand?post=20017"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product_cat?post=20017"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product_tag?post=20017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}