> On 2/17/2001 10:17 PM Luigi Rizzo ri...@ac... wrote:
> >While i have your attention -- how much work do you think it is
> >necessary to remove the dependency on nasm and let the code compile
> >just using the standard assembler (as i believe ?) which comes with
> >FreeBSD/Linux/cygnus tools for windows ?
> >Is it just a matter of replacing the .S files with equivalent ones
> >in gcc syntax in case hey are not yet ?
>
> It's funny you should mention that. Someone recently contributed
> translations that do this. I think we would certainly like to get rid of
> the remaining dependencies on NASM/AS86, and I imagine the translation
> will be aided by having an example. So my guess is that we're close to
> this goal.
ok so here is my contribution for comload.s ...
cheers
luigi
# as comload.s -o comload.o
# ld -Ttext 0 -o comload.out comload.o
# objcopy -S -O binary comload.out comload
.text
.globl _start
.code16
# Cheat a little with the relocations: .COM files are loaded at 0x100
_start:
pushw %cs # generate return address
movw $retaddr + 0x100, %ax
pushw %ax
# Intel didn''t specify an indirect far call that loads the address from
# a near operand - it seems like nobody does computed far calls. So do it
# the ugly way - dump it on the stack and "return" to the destination.
movw %cs, %ax # calculate start address of loader
movw $_body + 0x100, %bx
movb $4, %cl
shrw %cl, %bx
addw %bx, %ax
pushw %ax # new code segment
movw $6, %ax
pushw %ax # new offset
lret
retaddr:
int $0x19 # should never reach this
.align 16, 0
_body:
|