{"id":6199,"date":"2018-04-19T06:25:15","date_gmt":"2018-04-19T06:25:15","guid":{"rendered":"https:\/\/9series-blog.staging9.com\/?p=6199"},"modified":"2026-03-03T10:46:19","modified_gmt":"2026-03-03T10:46:19","slug":"x-sharp-in-cosmos","status":"publish","type":"post","link":"https:\/\/www.9series.com\/blog\/x-sharp-in-cosmos\/","title":{"rendered":"X# IN COSMOS"},"content":{"rendered":"<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/X-IN-COSMOS.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2943\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/X-IN-COSMOS.jpg\" alt=\"X#-IN-COSMOS\" width=\"800\" height=\"500\" \/><\/a><\/p>\n<p>In our last article, we spoke about <a href=\"https:\/\/9series.com\/blog\/typescript-new-invention-to-write-javascript\/\" target=\"_blank\">TypeScript<\/a>. Today, we are going to discuss about X# in COSMOS.<\/p>\n<p><strong>What is X#?<\/strong><\/p>\n<p>X sharp is a high-level assembly language that targets x86 architecture and it is developed by Microsoft .Net. Design of X# is similar to C language but it is used as a low-level programming language. The X# compiler parses lines of code into tokens and compares them with patterns. Finally, matched X# code patterns are translated to Intel x86 assembly, usually for the NASM Netwide compiler.<\/p>\n<p><strong>Where is X# Used?<\/strong><\/p>\n<p>X# is high-level assembly language and it is used by COSMOS to make operating system developed much easier.<\/p>\n<p>COSMOS abbreviated as C# Open Source Managed Operating System. One can build their own operating system in Visual Studio 2017 by integrating COSMOS to Visual Studio and to test developed operating system virtual machines like Vmware Player is used.<\/p>\n<p><strong>Basics of X# language:<\/strong><\/p>\n<p><strong>Data-types:<\/strong><\/p>\n<p>X sharp supports 8 bits value as defined by the byte keyword, 16 bits value as defined by word keyword and 32 bits value as defined by dword keyword.<\/p>\n<p><strong>Literals:<\/strong><\/p>\n<p>A string literal is surrounded by single quote and backslash() is used as escape character. For example,<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/13.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2944\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/13.jpg\" alt=\"1\" width=\"800\" height=\"34\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">An Integer literal values are in two types, one is decimal and other is hexadecimal. The Dollar sign is used as a prefix in hexadecimal values. For example,<\/span><\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/23.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2945\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/23.jpg\" alt=\"2\" width=\"800\" height=\"34\" \/><\/a><\/p>\n<p><strong>Comments:<\/strong><\/p>\n<p>A comment must appear on its own line. You can&#8217;t mix code and comments on a single line. A comment line is one that starts with two consecutive slashes. Whitespaces may be inserted before the comment line. For example :<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/32.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2946\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/32.jpg\" alt=\"3\" width=\"800\" height=\"34\" \/><\/a><\/p>\n<p><strong>Namespaces:<\/strong><\/p>\n<p>A namespace is a naming scope that lets you organize your code to avoid naming collision. You declare a namespace by using the namespace keyword and giving it a name. The code inside a namespace has no way to reference or use code or data from another namespace. For Example,<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/42.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2947\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/42.jpg\" alt=\"4\" width=\"800\" height=\"178\" \/><\/a><\/p>\n<p><strong>Constants:<\/strong><\/p>\n<p>Constants are declared outside the function and it requires \u2018const\u2019 keyword before constant\u2019s name. For Example,<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/54.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2948\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/54.jpg\" alt=\"5\" width=\"800\" height=\"15\" \/><\/a><\/p>\n<p><strong>Labels:<\/strong><\/p>\n<p>Labels in X# are mostly equivalent to labels in other assembly languages. Keyword goto is used to jump between labels. For Example,<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/62.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2949\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/62.jpg\" alt=\"6\" width=\"800\" height=\"105\" \/><\/a><\/p>\n<p><strong>Functions:<\/strong><\/p>\n<p>Functions are defined by \u2018function\u2019 keyword. It does not support formal parameter declaration in the header of function. Conventional parenthesis after function name is not required. Because line-fixed patterns are specified in syntax implemented in code parser, the opening curly bracket can&#8217;t be placed on the next line, unlike in many other C-style languages. X# function calls do contain arguments enclosed in parentheses, unlike in function headers. Arguments passed to functions can be registers, addresses, or constants. These arguments are pushed onto the stack in reverse order. For Example,<\/p>\n<p><a href=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/7.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2950\" src=\"https:\/\/9series-blog.staging9.com\/wp-content\/uploads\/2018\/04\/7.jpg\" alt=\"7\" width=\"800\" height=\"160\" \/><\/a><\/p>\n<p><strong>Conclusion<\/strong><\/p>\n<p><span style=\"font-weight: 400\">9series has experts with experience in Xsharp. It is a high-level assembly language developed By Microsoft. We are among the <a href=\"http:\/\/www.9series.com\/top-best-microsoft-dot-net-mvc-experts-website-portal-application-developers-development-companies-india.html\" target=\"_blank\">top <\/a><\/span><span style=\"font-weight: 400\"><a href=\"https:\/\/www.9series.com\/services\/asp-dot-net-mvc-development.html\" target=\"_blank\">.net mvc development companies in India<\/a>. \u00a0Stay tuned for our next article!<\/span><\/p>\n<p><strong>Bibliography:<\/strong><\/p>\n<p>https:\/\/en.wikipedia.org\/wiki\/Cosmos_(operating_system)#X.23<br \/>\nhttps:\/\/www.xsharp.info\/<br \/>\nhttps:\/\/www.x-sharp.net\/<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"AoP0TYMpgq\"><p><a href=\"https:\/\/www.gocosmos.org\/\">COSMOS<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;COSMOS&#8221; &#8212; COSMOS\" src=\"https:\/\/www.gocosmos.org\/embed\/#?secret=Y8nnjdr6LS#?secret=AoP0TYMpgq\" data-secret=\"AoP0TYMpgq\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><br \/>\nhttps:\/\/www.visualstudio.com<br \/>\nhttps:\/\/www.vmware.com\/products\/workstation-player\/workstation-player-evaluation.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our last article, we spoke about TypeScript. Today, we are going to discuss about X# in COSMOS. What is X#? X sharp is a high-level assembly language that targets&#8230;<\/p>\n","protected":false},"author":1,"featured_media":6200,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"dsgo_overlay_header":false,"dsgo_overlay_header_text_color":"","dsgo_overlay_skip_top_bar":false,"_designsetgo_exclude_llms":false,"footnotes":""},"categories":[1429],"tags":[2179,2180,2181,2182,2183,1867,2184,2185],"class_list":["post-6199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft","tag-c-open-source-managed-operating-system","tag-cosmos","tag-high-level-assembly-language","tag-microsoft-net-design","tag-nasm-netwide-compiler","tag-top-net-mvc-development-companies-in-india","tag-x-sharp","tag-x-in-cosmos"],"_links":{"self":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/6199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/comments?post=6199"}],"version-history":[{"count":1,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/6199\/revisions"}],"predecessor-version":[{"id":6208,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/posts\/6199\/revisions\/6208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/media\/6200"}],"wp:attachment":[{"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/media?parent=6199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/categories?post=6199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.9series.com\/blog\/wp-json\/wp\/v2\/tags?post=6199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}