9series
Microsoft

X# IN COSMOS

April 19, 2018

X#-IN-COSMOS

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 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.

Where is X# Used?

X# is high-level assembly language and it is used by COSMOS to make operating system developed much easier.

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.

Basics of X# language:

Data-types:

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.

Literals:

A string literal is surrounded by single quote and backslash() is used as escape character. For example,

1

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,

2

Comments:

A comment must appear on its own line. You can’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 :

3

Namespaces:

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,

4

Constants:

Constants are declared outside the function and it requires ‘const’ keyword before constant’s name. For Example,

5

Labels:

Labels in X# are mostly equivalent to labels in other assembly languages. Keyword goto is used to jump between labels. For Example,

6

Functions:

Functions are defined by ‘function’ 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’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,

7

Conclusion

9series has experts with experience in Xsharp. It is a high-level assembly language developed By Microsoft. We are among the top .net mvc development companies in India.  Stay tuned for our next article!

Bibliography:

https://en.wikipedia.org/wiki/Cosmos_(operating_system)#X.23
https://www.xsharp.info/
https://www.x-sharp.net/

COSMOS


https://www.visualstudio.com
https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html

Read our Recent Articles

The EPA’s PFAS Reporting Window Is Open. What Chemical Manufacturers Need to Know Before October 13, 2026
AI Solutions / Chemical Manufacturers

The EPA’s PFAS Reporting Window Is Open. What Chemical Manufacturers Need to Know Before October 13, 2026

As of April 13, 2026, the EPA’s PFAS reporting window under TSCA Section 8(a)(7) is open. Every chemical...

12 min read • Apr 1, 2026 Read more
AI Powered Community Banking: Why Automation Is the New Relationship Moat in Modern Banking
AI Solutions

AI Powered Community Banking: Why Automation Is the New Relationship Moat in Modern Banking

What is AI Powered Community Banking?  AI powered community banking is the use of artificial intelligence, built on a...

10 min read • Mar 25, 2026 Read more
Deep Learning and Machine Learning: Understanding Their Synergistic Relationship in Modern AI
AI Solutions / Artificial Intelligence

Deep Learning and Machine Learning: Understanding Their Synergistic Relationship in Modern AI

Artificial Intelligence has evolved rapidly over the past decade, largely driven by breakthroughs in Machine Learning and Deep Learning. While...

3 min read • Apr 29, 2024 Read more

Let's Discuss Your Strategic Technology Initiatives

Partner with 9series to accelerate your digital transformation journey. Our enterprise architects are ready to design solutions tailored to your unique challenges.

Trusted by global partners

Nailbiter NUs Safaricom Intuify Solvit i-banq Fractal