Linux assembly list
 help / color / mirror / Atom feed
* 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

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