This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

as 2.13.90.0.18 question/problem


Please forgive my mailing here for this, as I could find nowhere else
posted on the gnu page for support.  I hope this is not appropriate to
this forum.

I am trying what I believe to be a fairly simple task.  I would like to
make an indirect (or even direct) lcall.

Here is some sample code:

    pushl   %ebp
    movl    %esp, %ebp
    pushw   %es
    pushw   12(%esp)        #get the segment where the pointer resides
    popw    %es
    pushw   10(%esp)        # and the offset to the pointer
    popw    %di

# es:di now contains 0x9dc3:0x0.  This is an internal structure that
# at offset 0x10 contains the entry point of a service routine.  call
# that service routine

    pushw   %ds              # set up arguments to the service routine
    pushw   20(%esp)
    pushw   18(%esp)
#   lcall   *%es:16(%di)     # indirect lcall to the routine
    lcall   $0x9dbc,$0x106   # call it with immediate values
    addl    $6,%esp
    popw    %es
    movl    %ebp, %esp
    popl    %ebp
    ret

at the time I do the lcall I am certain that %es:16(%di) refers to a
segment:offset value of 0x9dbc0106.  When I try to make the lcall my
program fails, whereas if I call that address with the immediate
operands, the call works just fine.  What could I be doing wrong with
this?  It seems straightforward enough.  I have also considered moving
the the segment:offset value directly to es:di, but understand that I
can't make a direct lcall.  I can't find enough documentation to fix
this and was hoping I might be able to get a little help.

Thanks again in advance, and I hope the posting is not inappropriate.

Tom Green


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]