Mail Archives: djgpp/1993/03/11/15:32:00
Hi:
I have built a cross-compiler system on HP9000/700. It can generate 386
machine code. While during building cross-linker, I find that the int86x.s is
incompatible with new linker in binutils-2.1. So I make some modifications.
Here is the new version :
.data
int86:
.byte 0xcd
int86_vec:
.byte 0x03
.byte 0xc3 <---- use RET rather than JMP
.text
.globl _int86x
_int86x:
.globl _int86
_int86:
pushl %ebp
movl %esp,%ebp
pushl %ebx
pushl %esi
pushl %edi
pushf
movl 8(%ebp),%eax
movb %al,int86_vec
movl 12(%ebp),%eax
movl 4(%eax),%ebx
movl 8(%eax),%ecx
movl 12(%eax),%edx
movl 16(%eax),%esi
movl 20(%eax),%edi
movl (%eax),%eax
push $int86_retjmp <--- push return address into stack
jmp int86
int86_retjmp:
pushf
pushl %eax
movl %esp,%ebp
addl $24,%ebp
movl 16(%ebp),%eax
popl (%eax)
movl %ebx,4(%eax)
movl %ecx,8(%eax)
movl %edx,12(%eax)
movl %esi,16(%eax)
movl %edi,20(%eax)
popl %ebx /* flags */
movl %ebx,28(%eax)
andl $1,%ebx
movl %ebx,24(%eax)
movl (%eax),%eax
popf
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
It works !
Arthur Ho
u7711501 AT bicmos DOT ee DOT nctu DOT edu DOT tw
- Raw text -