TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: DANNY PHILLIPS
from: JAN WAGEMAKERS
date: 1997-11-07 16:33:00
subject: Interupts

Hello Danny,
Danny Phillips wrote to All :
 DP> If I write a program:
 DP> mov ah,2 int 21
 DP> For DOS it does somthing spectacular ;-0 What about in Linux or
 DP> UNIX??  How would I make an interupt call in Linux or UNIX.  Does
 DP> Linux or UNIX make interupt calls even?  What do they use? Where are
 DP> the interupts stored??  Please, someone tell me...
A little extract of my HomePage :
/* An extract of (/home/jan/assembler/Mijn_HomePage/eng.html)
In this example call puts is used to print a text on the screen.
Puts comes from 'C', and is standard present in the libraries
that are loaded by Linux. But there is a second way to do certain things by
assembly, it is INTerrupts. But it is not recommended to use these
interrupts because it is possible that they change in a later version of the
Linux-Kernel.
2.1.2. And now, two examples for Gas :
From assembler.028, thanks to Pieter de Jong
for these nice examples.
Example 1. By making use of call puts.


.text
message:
 .ascii "Hello world!\0"
 .align 4
.globl main
main:
 pushl %ebp
 movl %esp,%ebp
 #call ___main
 pushl $message
 call puts
 addl $4,%esp
 xorl %eax,%eax
 movl %ebp,%esp
 popl %ebp
 ret
as hello.s -o hello.o
gcc hello.o -o hello


Example 2. By making use of INT 80h.


.text
message:
 .ascii "Hello, World!\12\0"
 .align 4
.globl _hw
_hw:
 movl $4, %eax
 movl $1, %ebx
 movl $message, %ecx
 movl $15, %edx
 int $0x80
 movl $1, %eax
 movl $0, %ebx
 int $0x80
as hello.s -o hello.o
ld hello.o -e _hw -o hello
        (_hw = entry-point)


*/
Have a nice day.                       - Jan Wagemakers - 
 
o_o Please forgive my flinstone-english ;-) 
--- Terminate 5.00/Pro /Linux.DosEmu.PTS-DOS
---------------
* Origin: Someone somewhere (2:292/854.19)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.