* Re: How interrupts work
@ 2002-08-23 11:30 RCS
2002-08-23 16:36 ` Stephan Walter
0 siblings, 1 reply; 5+ messages in thread
From: RCS @ 2002-08-23 11:30 UTC (permalink / raw)
To: linux-assembly
Thanks, but which assembler must I use for this code? GNU as?
I'm asking that because I am only familiar with nasm.
Thanks Again,
RCS
Em Aug 2002, Dmitry Trunikov escreveu:
>RCS wrote:
>
>> I need some help to understand how interrupts work on Intel.
>> For example, how do I print a character in the screen?
>>Wich register must contain the character for that? Is "int 10h" the
correct
>>interrupt for that?
>>
>>
>It depends on which pc or OS you use. "int 10h" is a BIOS (base input
>output system) interrupt i.e. it can be used AFAIK only in real CPU
>mode. Usually for character output is used OS API. In MSDOS you can uset
>"int 10h" or "int 21h" for input/output. Under linux you can use system
>call "int 80h".
>This is an example for output string under linux:
>
>// ssize_t write(int fd, const void *buf, size_t count);
>// write(fileno(stdout), "hello", 6);
>
>.data
>hello:
> .string "hello world\n"
>.text
>.globl _start
>_start:
> movl 4,%eax // 4 - sys function 'write'
> movl 1,%ebx // fd = fileno(stdio)
> movl $hello,%ecx // buf = str
> movl $12,%edx // count
> int $0x80
>
> movl 1,%eax // sys function 'exit'
> xorl %ebx,%ebx
> int $0x80
>
>----------
_________________________________________________________
Oi! Você quer um iG-mail gratuito?
Então clique aqui: http://registro.ig.com.br/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How interrupts work
2002-08-23 11:30 How interrupts work RCS
@ 2002-08-23 16:36 ` Stephan Walter
2002-08-24 0:46 ` Intel2GAS (was How interrupts work) Jim Watters
0 siblings, 1 reply; 5+ messages in thread
From: Stephan Walter @ 2002-08-23 16:36 UTC (permalink / raw)
To: linux-assembly
On Fri, 23 Aug 2002 08:30:51 -0300, RCS <cryptik@ig.com.br> wrote:
> Thanks, but which assembler must I use for this code? GNU as?
> I'm asking that because I am only familiar with nasm.
> >.data
> >hello:
> > .string "hello world\n"
> >.text
> >.globl _start
> >_start:
> > movl 4,%eax // 4 - sys function 'write'
> > movl 1,%ebx // fd = fileno(stdio)
> > movl $hello,%ecx // buf = str
> > movl $12,%edx // count
> > int $0x80
> >
> > movl 1,%eax // sys function 'exit'
> > xorl %ebx,%ebx
> > int $0x80
This is GNU as syntax. You can use 'intel2gas' to convert from gas to
nasm and vice versa. (see
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas )
Regards,
Stephan
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Intel2GAS (was How interrupts work)
2002-08-23 16:36 ` Stephan Walter
@ 2002-08-24 0:46 ` Jim Watters
2002-08-24 16:26 ` Stephan Walter
0 siblings, 1 reply; 5+ messages in thread
From: Jim Watters @ 2002-08-24 0:46 UTC (permalink / raw)
To: linux-assembly
As I discovered two weeks ago, Intel2Gas is no longer available. I found
an older version of it's source code using a Internet cache service. But
if anyone can provide the most recent binary, I'd appreciate it.
Jim Watters
-----Original Message-----
From: Stephan Walter
This is GNU as syntax. You can use 'intel2gas' to convert from gas to
nasm and vice versa. (see
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas )
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Intel2GAS (was How interrupts work)
2002-08-24 0:46 ` Intel2GAS (was How interrupts work) Jim Watters
@ 2002-08-24 16:26 ` Stephan Walter
2002-08-25 0:50 ` Jim Watters
0 siblings, 1 reply; 5+ messages in thread
From: Stephan Walter @ 2002-08-24 16:26 UTC (permalink / raw)
To: linux-assembly
[-- Attachment #1: Type: text/plain, Size: 542 bytes --]
On Fri, 23 Aug 2002 20:46:06 -0400, "Jim Watters" <macemu@emuunlim.com>
wrote:
>
> As I discovered two weeks ago, Intel2Gas is no longer available. I
> found an older version of it's source code using a Internet cache
> service. But if anyone can provide the most recent binary, I'd
> appreciate it.
>
I had no problems downloading the source it from:
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/
and there's even an Debian package...
You can try the attached binary... might work if you've got the right
libs :-)
Regards,
Stephan
[-- Attachment #2: intel2gas.bz2 --]
[-- Type: application/octet-stream, Size: 9871 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Intel2GAS (was How interrupts work)
2002-08-24 16:26 ` Stephan Walter
@ 2002-08-25 0:50 ` Jim Watters
0 siblings, 0 replies; 5+ messages in thread
From: Jim Watters @ 2002-08-25 0:50 UTC (permalink / raw)
To: linux-assembly
Great! Thanks Stephan. I had spent many hours looking for this.
Jim Watters
-----Original Message-----
From: Stephan Walter
I had no problems downloading the source it from:
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/
and there's even an Debian package...
You can try the attached binary... might work if you've got the right
libs :-)
Regards,
Stephan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-08-25 0:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-23 11:30 How interrupts work RCS
2002-08-23 16:36 ` Stephan Walter
2002-08-24 0:46 ` Intel2GAS (was How interrupts work) Jim Watters
2002-08-24 16:26 ` Stephan Walter
2002-08-25 0:50 ` Jim Watters
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).