Mail Archives: djgpp/1997/09/24/03:31:24
> This message concerns a quest that some may find challenging, some
> humorous, and some rather dubious: the road to a standalone hello.s
gcc -c hello.s
ld -s hello.o -o hello
stubify hello
On the file below (hello.s) will produce a 2560 byte executable, the
smallest valid DJGPP image. Pretty silly exercise, but good for testing
DPMI provider hacking, stub hacking, etc ... (Warning, tested only on V2.00).
Look at crt0.s for the interface definition.
/* Clip hello.s below */
.text
.globl start
start:
movl $L1, %ebx
1:
movb $2, %ah
movb (%ebx), %dl
cmpb $0,%dl
je 2f
int $0x21
incl %ebx
jmp 1b
2:
movb $0x4c,%ah
int $0x21
L1: .ascii "Hello, World!\15\12\0"
and maybe you just need to insure
the string gets terminated. Then again, I've been incorrect before. Br5an
>strncpy(Personal_info.name,buff,20); //copy 20 chars
Personal_info.name[20] = '\0'; //since 0 thru 20 == 21
- Raw text -