Anonymous user
C--: Difference between revisions
no edit summary
[unchecked revision] | [unchecked revision] |
(→Cons) |
No edit summary |
||
(10 intermediate revisions by 4 users not shown) | |||
Line 1:
==C--==▼
▲(This page is about Sphinx Full C--, not about [http://www.cminusminus.org/index.html C--, the portable assembly language]
Sphinx Full C-- language is in between the [[C|C language]] and x86-assembly. It is a very neat computer language and the
It was originally developed by Peter Cellik in Canada and then has been extended for several years by Michael Sheker in Russia.
* compiles very small executables;
* good for writing real mode x86 operating systems;
* good for writing TSR programs for DOS;
* supports many executable formats: COM, EXE, SYS (DOS drivers), ROM-BIOS, Windows PE-Coff, Windows DLL, 32bit DOS flat or DPMI, MenuetOS;
* good for writing x86-related parts of an operating system in a structured and easily readable and easier debuggable way related to structured languages like C and Pascal;
* very good (because of the structured form) for writing small toy programs which are close to the hardware;
Line 14 ⟶ 17:
* relatively easy to port from and to C-with-assembly.
* not portable; it is very closely tied to the x86 assembly;
* is developed by few developers, the community is small; has less users than gcc so
* in order to be low-level, many limitations are in place: for example, array subscripts (like in x= myArr['''subscript''']) are limited to simple expressions (like myArr[10], myArr[ESI]; but myArr[myArr[1]] is not allowed);
Early versions of [[User:Adek336|panaLiX]] used Sphinx Full C--. The Panalix website is [http://panalix.sourceforge.net/ here] but there is no Sphinx C-- code currently available.
▲I don't know if it can output 64bit code.
==Examples==
byte x = 0b01001;▼
word y;▼
dword z;▼
#define THIS_A_DEFINITION 123▼
===
dword old0x21 = {};
interrupt int0x21()
Line 74 ⟶ 76:
ESBYTE[0x1b8005]= 127;
▲ byte x;
▲ word y;
▲ dword z;
▲ #define THIS_A_DEFINITION 123
▲====read, write====
void PRINTF()
{
Line 135 ⟶ 132:
}
byte readDisk(byte drive, head, sector, track, howmany; word segm, offs)
int err;
Line 242 ⟶ 239:
}
...
?code32 false
Line 284 ⟶ 281:
...
These snippets may seem a bit spaghetti code, but not because of some language defficiency but because I didn't look very far for them snippets.▼
* [http://www.dev0.de/cmm/indexe.htm Mirror of the compilers website]
* [https://github.com/jossk/c--sphinx Github site with all the files plus source for Sphinx C--]
[[Category:Languages]]
▲These snippets may seem a bit spaghetti code, but not because of some language defficiency but because I didn't look very far for them snippets.
▲===References===
▲* [http://c--sphinx.narod.ru/indexe.htm the compilers website]
|