DLL function entry in assembly
samir.ribic_at_alemsistem.com.ba
Date: 10/20/05
- Next message: cheian07_at_yahoo.com: "icewm bacground can't set"
- Previous message: bernatik_at_kn.vutbr.cz: "Re: serial port behavior"
- Next in thread: Basile Starynkevitch [news]: "Re: DLL function entry in assembly"
- Reply: Basile Starynkevitch [news]: "Re: DLL function entry in assembly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 20 Oct 2005 01:46:00 -0700
I have made one small programming language (C like), called FILDZAN-32,
that work under Windows, and I teach on the University of Sarajevo, the
compiler construction course.
Many people found that the compiler can be useful also outside
academia, because the generated executable code can be quite small.
(Hello world on Windows is about 2 kilobytes executable).
The generated output is actually i486 assembly source, without
overload that crt0 gives to even smallest C program.
Some students will take the task porting the compiler to Linux. I have
looked at http://docs.cs.up.ac.za/programming/asm/derick_tut/
Because my compiler generates assembly source, with NASM this will be
quite easy job. It will be necessary to replace just several commands -
for example
PUSH 0
Call ExitProcess@4
need to be changed to
mov eax,1 ; The system call for exit (sys_exit)
mov ebx,0 ; Exit with return code of 0 (no error)
int 80h
The only problem is how to call routines that are not in kernel, but in
.so libraries. There is system function 86 called by int 80h with a
name "sys_uselib". It loads external library, but I do not know how to
get an entry point of some specific function.
For example, if I loaded libX11.so using sys_uselib, how to then find
the address of XPutPixel and call it?
- Next message: cheian07_at_yahoo.com: "icewm bacground can't set"
- Previous message: bernatik_at_kn.vutbr.cz: "Re: serial port behavior"
- Next in thread: Basile Starynkevitch [news]: "Re: DLL function entry in assembly"
- Reply: Basile Starynkevitch [news]: "Re: DLL function entry in assembly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|