C--: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Cic (talk | contribs)
m C MinusMinus moved to C--
Cic (talk | contribs)
Fixed the headers
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 Shinx Full C-- compiler allows to produce (and mix) 16 bit and 32 bit code for real and protected modes.
 
===Pros===
* good for writing real mode x86 operating systems;
* good for writing TSR programs for DOS
Line 14 ⟶ 13:
* relatively easy to port from and to C-with-assembly.
 
===Cons===
* 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 more may have more bugs;
Line 28 ⟶ 27:
Early versions of [[User:Adek336|panaLiX]] used Sphinx Full C--.
 
===Examples===
byte x = 0b01001;
word y;
Line 34 ⟶ 33:
#define THIS_A_DEFINITION 123
 
====Take over interrupt====
dword old0x21 = {};
interrupt int0x21()
Line 79 ⟶ 78:
ESBYTE[0x1b8005]= 127;
 
====read, write====
void PRINTF()
{
Line 135 ⟶ 134:
}
 
====Disk IO====
byte readDisk(byte drive, head, sector, track, howmany; word segm, offs)
int err;
Line 242 ⟶ 241:
}
 
====Enable Protected Mode====
...
?code32 false
Line 283 ⟶ 282:
@setup_pic(0x20, 0x28);
...
 
 
 
 
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]