A D | 22 Nov 2006 19:54
Picon
Favicon

GAS colorr pixel problem

Hello there! I'm new to x86 gnu assembly language and
trying to learn it. I've a question: is it possible to draw
a filled rectangle on monitor using gas? How do i
color individual pixel on my monitor? If anyone can
just give me the theory behind it or be kind enough to
write the source code I would appreciate it. Thanks.

--STeve

_________________________________________________________________
Experience Live Search from your PC or mobile device today. 
http://www.live.com/?mkt=en-ca

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Robert Plantz | 22 Nov 2006 20:33

Re: GAS colorr pixel problem

Given that everything ultimately resolves to assembly
language (try the -S gcc option when compiling), yes,
you can do graphics on the monitor.

On the other hand, I've been an assembly language programmer
for 30 years, and I would not even consider doing this
in assembly language. In my view, the main reason for
learning assembly language these days is to gain an
understanding of how computers actually work.

Bob

On Wed, 2006-11-22 at 13:54 -0500, A D wrote:
> Hello there! I'm new to x86 gnu assembly language and
> trying to learn it. I've a question: is it possible to draw
> a filled rectangle on monitor using gas? How do i
> color individual pixel on my monitor? If anyone can
> just give me the theory behind it or be kind enough to
> write the source code I would appreciate it. Thanks.
> 
> --STeve

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jean-Yves Lamoureux | 22 Nov 2006 20:42

Re: GAS colorr pixel problem

A D wrote:
> Hello there! I'm new to x86 gnu assembly language and
> trying to learn it. I've a question: is it possible to draw
> a filled rectangle on monitor using gas? How do i
> color individual pixel on my monitor? If anyone can
> just give me the theory behind it or be kind enough to
> write the source code I would appreciate it. Thanks.
gas is just an assembler. You can do whatever you want with an 
assembler, as every single executed bit on your processor is the output 
of an assembler (ok purists, I just simplified).
"Filling a rectangle" means nothing. You have to draw something that 
will be interpreted as a bunch of pixels having the sahpe of a 
rectangle. You can do that in ascii (libcaca for example, 
http://libcaca.zoy.org ), or in graphic mode (SVGAlib, old as hell but 
works on most PC cards, without X), X11 (which itself has dozen of low 
(xlib) and high (sdl, ptc, gtk, qt, whatever) level libraries to do that).

I suggest you to learn how to call C-like functions (pushing arguments, 
calling function), how to work with memory (lea, syscalls, brk, etc), 
then to use something like SDL for example, which does most of the work 
for you.

Good luck.

--

-- 
Jean-Yves Lamoureux
Software Developper

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
(Continue reading)

Markus Rechberger | 22 Nov 2006 20:44
Picon

Re: GAS colorr pixel problem

On 11/22/06, Robert Plantz <plantz <at> sonoma.edu> wrote:
> Given that everything ultimately resolves to assembly
> language (try the -S gcc option when compiling), yes,
> you can do graphics on the monitor.
>
> On the other hand, I've been an assembly language programmer
> for 30 years, and I would not even consider doing this
> in assembly language. In my view, the main reason for
> learning assembly language these days is to gain an
> understanding of how computers actually work.
>

depends, if you apply at Intel or AMD you might need it.. AMD is
looking for people at the moment who have indepth knowledge about
kernel development and who also know about ASM...

jobs are just more rare in that area but they exist.

cheers,
Markus
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jean-Yves Lamoureux | 22 Nov 2006 20:49

Re: GAS colorr pixel problem

Markus Rechberger wrote:
> jobs are just more rare in that area but they exist. 

Real-time stuff, kernel development, heavy graphical proggies, and 
everything that can be a bit system-related, security (anti-copy 
protections, exploits, etc), reverse engeenering, etc etc. There is a 
load of these, that's just hidden into the flood of java and .NET job 
offers. That's quite cool, asm-aware people can get (well) paid for 
doing (sometimes) interresting work ;)

--

-- 
Jean-Yves Lamoureux
Software Developper

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A D | 22 Nov 2006 21:35
Picon
Favicon

Re: GAS colorr pixel problem

>Jean-Yves Lamoureux wrote:
>gas is just an assembler. You can do whatever you want with an assembler, 
>as every >single executed bit on your processor is the output of an 
>assembler (ok purists, I just  > simplified).
>"Filling a rectangle" means nothing. You have to draw something that will 
>be >interpreted as a bunch of pixels having the sahpe of a rectangle. You 
>can do that in >ascii (libcaca for example, http://libcaca.zoy.org ), or in 
>graphic mode (SVGAlib, old as >hell but works on most PC cards, without X), 
>X11 (which itself has dozen of low (xlib) >and high (sdl, ptc, gtk, qt, 
>whatever) level libraries to do that).

>I suggest you to learn how to call C-like functions (pushing arguments, 
>calling function), >how to work with memory (lea, syscalls, brk, etc), then 
>to use something like SDL for >example, which does most of the work for 
>you.

Thanks to all for your input. I guess it would be really difficult to color 
pixels in assembly language. Can anyone tell me what steps are involved in 
that(color pixels in assembly)? Just for my knowledge. Thanks.

--STeve

_________________________________________________________________
Buy, Load, Play. The new Sympatico / MSN Music Store works seamlessly with 
Windows Media Player. Just Click PLAY. 
http://musicstore.sympatico.msn.ca/content/viewer.aspx?cid=SMS_Sept192006

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo <at> vger.kernel.org
(Continue reading)

Jean-Yves Lamoureux | 22 Nov 2006 21:38

Re: GAS colorr pixel problem

A D wrote:
>> Jean-Yves Lamoureux wrote:
>> gas is just an assembler. You can do whatever you want with an 
>> assembler, as every single executed bit on your processor is the 
>> output of an assembler (ok purists, I just simplified).
>> "Filling a rectangle" means nothing. You have to draw something that 
>> will be interpreted as a bunch of pixels having the sahpe of a 
>> rectangle. You can do that in ascii (libcaca for example, 
>> http://libcaca.zoy.org ), or in graphic mode (SVGAlib, old as hell 
>> but works on most PC cards, without X), X11 (which itself has dozen 
>> of low (xlib) and high (sdl, ptc, gtk, qt, whatever) level libraries 
>> to do that).
>>
>> I suggest you to learn how to call C-like functions (pushing 
>> arguments, calling function), how to work with memory (lea, syscalls, 
>> brk, etc), then to use something like SDL for example, which does 
>> most of the work for you.
>
> Thanks to all for your input. I guess it would be really difficult to 
> color pixels in assembly language. Can anyone tell me what steps are 
> involved in that(color pixels in assembly)? Just for my knowledge. 
> Thanks.
>

http://www.google.com/codesearch?q=show:GtRjeWKEOlc:2P9VXd642nk:3e2ZV6Tu0vo&sa=N&ct=rd&cs_p=http://allergy.alrj.org/Code/xtest.tgz&cs_f=xtest/PTC4k.asm

May seem hard to understand, it is a "complete" graphical library in 
asm, using xlib. That's not the easiest way, but hey, you wanna learn !

(Wrote by me yeaaaars ago, when I was a young padawan, rewritten from 
(Continue reading)

Claudio Fontana | 22 Nov 2006 21:59
Picon
Favicon

Re: GAS colorr pixel problem


--- A D <a_d_249 <at> hotmail.com> wrote:

> >Jean-Yves Lamoureux wrote:
> Thanks to all for your input. I guess it would be
> really difficult to color 
> pixels in assembly language. Can anyone tell me what
> steps are involved in 
> that(color pixels in assembly)? Just for my
> knowledge. Thanks.
> 
> --STeve

You could use/read the source code of the libraries
you have been presented with. Probably you will find
the source code of svgalib satisfying enough.
Just do it in assembly instead of C.

Claudio

__________________________________________________
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i
messaggi 
http://mail.yahoo.it 
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

A D | 22 Nov 2006 22:08
Picon
Favicon

Re: GAS colorr pixel problem

Again my thanks goes to Jean-Yves Lamoureux and all the forum members. That 
is all i wanted to know.

--STeve

_________________________________________________________________
Off to school, going on a trip, or moving? Windows Live (MSN) Messenger lets 
you stay in touch with friends and family wherever you go. Click here to 
find out how to sign up!  http://www.telusmobility.com/msnxbox/

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Robert Plantz | 22 Nov 2006 23:45

Re: GAS colorr pixel problem

On Wed, 2006-11-22 at 16:08 -0500, A D wrote:
> Again my thanks goes to Jean-Yves Lamoureux and all the forum members. That 
> is all i wanted to know.
> 
> --STeve

Also, if you use C libraries for your I/O, you can assemble your
assembly language source files with
   as --gstabs -o foo.o foo.s
where --gstabs gives you debugging symbols. Then use gcc to
link your object file(s), even if you have only one file:
   gcc -o myProg foo.o

gcc recognizes that the input file is already an object file,
so it goes directly to the linking phase. The advantage of
doing it this way instead of using ld is that gcc will
automatically find the C libraries for you. If you use
ld, you need to explicitly list the C libraries.

-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane