Mail Archives: djgpp/1999/06/28/11:00:47
DaXy_II wrote:
> > int main() {
> > cout << "Hello World." << endl;
> > return 0;
> This will be a huge exe! Try this
>
> int cur;
>
> void putc(char* vid, char ch) {
> vid[cur++] =
>
> int main() {
> char* video;
> cur = 0 // You could get the cursor pos ...
>
> video = (char*)0xB8000; // 0xB0000 for monocrome monitors.
> while (*message++) {
> putc(video,*message);
> }
> }
>
> And link without the stdlib, almost as small as an asm
Well, assuming you had typed the function correctly ( with "ch;}" at
the end). You would get a segment violation and you would skip the first
character of your message. And on top of all of that, you forgot about the
character attribute byte in text memory. So you would miss every 2nd
character, and they would appear in strange colors.
--
-Rolf Campbell (39)3-6318
- Raw text -