473,748 Members | 10,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bug/problem with lcc-win

Hi

I am using lcc-win on Windows 98. I'm writing a simple c console app, and
I need to set the background color to blue. Here's the code I've got at
the moment:

_asm ( "movb $2, %ah\n"
"movb $7, %dl\n"
"int $0x21\n"
);

But this doesn't work.

Does anyone have any suggestions?

Thanks.

Jun 27 '08 #1
91 3422
In comp.lang.c, Eddie wrote:
Hi

I am using lcc-win on Windows 98. I'm writing a simple c console app, and
I need to set the background color to blue. Here's the code I've got at
the moment:

_asm
[snip]
But this doesn't work.

Does anyone have any suggestions?
How about emailing your question directly to the authors of lcc-win? Since
your question doesn't relate to the features found in the C language, but
instead is about an lcc-win specific extension to the language, your best
bet is to take your question to the author.

--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
Jun 27 '08 #2
Eddie wrote:
Hi

I am using lcc-win on Windows 98. I'm writing a simple c console app, and
I need to set the background color to blue. Here's the code I've got at
the moment:

_asm ( "movb $2, %ah\n"
"movb $7, %dl\n"
"int $0x21\n"
);

But this doesn't work.

Does anyone have any suggestions?

Thanks.
This will not work under windows 98. You need to use the textbackground
library provided by lcc-win.

You will find the documentation for this function in the IDE (wedit) with:
Menu->Help->Standard Library->textbackground .

You should add the tcconio.lib library to the link step.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jun 27 '08 #3
OK thanks.

But shouldn't it work as it is? I think on Microsoft it will work.

Could you provide some sample code of changing the color to blue with
textbackground?

Thanks.
On Tue, 03 Jun 2008 20:38:37 +0200, jacob navia wrote:
Eddie wrote:
>Hi

I am using lcc-win on Windows 98. I'm writing a simple c console app, and
I need to set the background color to blue. Here's the code I've got at
the moment:

_asm ( "movb $2, %ah\n"
"movb $7, %dl\n"
"int $0x21\n"
);

But this doesn't work.

Does anyone have any suggestions?

Thanks.

This will not work under windows 98. You need to use the textbackground
library provided by lcc-win.

You will find the documentation for this function in the IDE (wedit) with:
Menu->Help->Standard Library->textbackground .

You should add the tcconio.lib library to the link step.
Jun 27 '08 #4
Eddie wrote:
OK thanks.

But shouldn't it work as it is? I think on Microsoft it will work.
No it will NOT work under Microsoft. Under Win32 you can't access video
memory like that.
>
Could you provide some sample code of changing the color to blue with
textbackground?
#include <tconio.h>
......

textbackground( BLUE);

Please just read the doc for that function, available in the help
tab of the menu
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jun 27 '08 #5
jacob navia wrote, On 03/06/08 19:38:
Eddie wrote:
>Hi

I am using lcc-win on Windows 98. I'm writing a simple c console app, and
<snip completely unportable code and solution>
You should add the tcconio.lib library to the link step.
You should also take any further discussion to comp.compilers. lcc as it
is completely implementation specific.
--
Flash Gordon
Jun 27 '08 #6
Lew Pitcher wrote:
Eddie wrote:
>I am using lcc-win on Windows 98. I'm writing a simple c console
app, and I need to set the background color to blue. Here's the
code I've got at the moment:

_asm
[snip]
>But this doesn't work.

Does anyone have any suggestions?

How about emailing your question directly to the authors of
lcc-win? Since your question doesn't relate to the features found
in the C language, but instead is about an lcc-win specific
extension to the language, your best bet is to take your question
to the author.
He can also use comp.compilers. lcc. The point is that none of
those 'words' are defined in the C standard, and are thus off-topic
in c.l.c

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home .att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #7
Thanks for the information, that seems quite simple. Is BLUE an integer
constant? Maybe I can save some space on my source files by just using the
integer value.

I think it would still be better if lcc-win supported writing directly to
video memory as well as using #tconio, this would make it much easier
when porting applications.
On Tue, 03 Jun 2008 22:39:37 +0200, jacob navia wrote:
Eddie wrote:
>OK thanks.

But shouldn't it work as it is? I think on Microsoft it will work.

No it will NOT work under Microsoft. Under Win32 you can't access video
memory like that.
>>
Could you provide some sample code of changing the color to blue with
textbackground ?

#include <tconio.h>
.....

textbackground( BLUE);

Please just read the doc for that function, available in the help
tab of the menu
Jun 27 '08 #8
In article <pa************ *************** *@nospam.com>,
Eddie <no****@nospam. comwrote:
>I think it would still be better if lcc-win supported writing directly to
video memory as well as using #tconio, this would make it much easier
when porting applications.
You are expecting that lcc-win, a *compiler*, would somehow detect
and intercept your assembler 'int' (interrupt) instruction, figure
out from historical patterns what the interrupt used to do, and
then rewrite the code to make the calls that the new operating
system requires instead ?? But then since you are down in the
assembler level, it would have to change the assembler code
generated to insert the new necessary calls, and that could mess
up any branch or load-relative offsets you had hand-coded.

Or are you expecting that lcc-win, a *compiler*, would hook itself
in to the interrupt vectors, figure out what the received interrupt
used to do, and make the new system calls instead? But then since
you are down in the assembler level, you might have specified your
own interrupt vector and your interrupt code might get bolluxed if
lcc-win front-ended your interrupt code.

In my opinion, what you are asking for is unreasonable to expect a
C compiler to do on a different operating system than the one
that the embedded assembler source was coded for.
--
"To all, to each! a fair good-night,
And pleasing dreams, and slumbers light" -- Sir Walter Scott
Jun 27 '08 #9
Walter Roberson wrote:
In article <pa************ *************** *@nospam.com>,
Eddie <no****@nospam. comwrote:
>I think it would still be better if lcc-win supported writing directly to
video memory as well as using #tconio, this would make it much easier
when porting applications.

You are expecting that lcc-win, a *compiler*, would somehow detect
and intercept your assembler 'int' (interrupt) instruction, figure
out from historical patterns what the interrupt used to do, and
then rewrite the code to make the calls that the new operating
system requires instead ?? But then since you are down in the
assembler level, it would have to change the assembler code
generated to insert the new necessary calls, and that could mess
up any branch or load-relative offsets you had hand-coded.

Or are you expecting that lcc-win, a *compiler*, would hook itself
in to the interrupt vectors, figure out what the received interrupt
used to do, and make the new system calls instead? But then since
you are down in the assembler level, you might have specified your
own interrupt vector and your interrupt code might get bolluxed if
lcc-win front-ended your interrupt code.

In my opinion, what you are asking for is unreasonable to expect a
C compiler to do on a different operating system than the one
that the embedded assembler source was coded for.
That is the main point. That assembler code worked on DOS. Now,
since DOS is gone, it doesn't work anymore and you just use C
instead of assembly. Somehow I find

textbackground( BLUE);

much clearer than the assembler instructions isn't it?

If you have further questions please go to the group
comp.compilers. lcc

This discussion is ot very topical here.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1903
by: Zeng Dinghao | last post by:
could anybody explain the term "in memory compilation" to me ? thanks
98
3929
by: jacob navia | last post by:
<< QUOTE It is NOT a C compiler, because it doesn't conform to any commonly accepted C specification (K&R, C89, C99). You have no right to call it a C compiler until you get it to conform quote >> lcc-win32 provokes unexpected passions in some people using this newsgroup. It is a H compiler then (H for heretical, non-orthodox) << QUOTE
14
3806
by: vittorio | last post by:
While I can compile the program below under freebsd via a simple: gcc prog1.c -o prog1 and it runs smoothly, I'm experiencing annoying problems with lcc-win32 under windows xp pro. In fact, under wedit, I can smoothly compile the program but when I try to execute it it ends with an "abnormal termination" and a popup complains that: lcc runtime Exception 0xc0000005 segment violation
2
2217
by: comp.lang | last post by:
Hello, I am a newbie, trying to compile LCC on windows xp with VS.Net when I give this command nmake -f makefile.nt HOSTFILE=etc/win32.c lcc I get NMake Error cannot find stdio.h
35
1920
by: strictly_mk | last post by:
Hi all, forgive me if there is a simple solution for this. I am going through the following piece of code which simply calculates factorials out of a book, but when i run it I get the answer 0 for whatever number I input. Can anyone help? Thanks in advance strictly_mk #include "stdio.h"
73
3833
by: Markus | last post by:
Hi, I can't understand why this code causes a "memory read exception" at int x=**a; void pass(int** a) { int x=**a; } void main()
20
1528
by: Army1987 | last post by:
Under Linux (gcc) this works OK, but under Windows (lcc-win32) p.Blue always is zero. Within the function itself, result.Blue is correct (either 0, 255, or the floor of the expression assigned to it modulo 256, according to the sign of n). But when returned to main(), it magically turns to zero. (The code below is entirely copied and pasted.) What the deuce is happening? Any ideas? sizeof(struct Pixel) is 3, if that can matter to anything...
67
733
by: Nimmi Srivastav | last post by:
Apologies if my cross posting has offended anyone.... For a pure hobbyist C/C++ programmer, who wants to develop applications to run on Windows, what would be a better choice to install: Visual C++ Express 2005 Edition or lcc-win32? Does anyone have any opinion to share? Also, is there a C++ compiler akin to lcc-win32? Thanks,
13
3811
by: Albert | last post by:
Hi I'm using the lcc compiler for win32. I tried compiling a program but there's an error stating: "cpp: Can't open input file clrscr()" I don't get it - I've included <tcconio.h>. (strange why they couldn't have just left it as <conio.h>?): #include <tcconio.h> // code
0
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.