Re: set_vector bug

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Eberlein writes:
> I'm running in a win95 dos window and when I print out the
> code_segment variable, it is _obviously_ a 32-bit value.

The only place in the *corrected* keyread.e where
code_segment is assigned a value is on the following line
(the original, incorrect code has been commented out):

-- code_segment = bytes_to_int(peek({segment,4}))
code_segment = peek(segment) + 256 * peek(segment+1)
                       -- Rob Craig Nov 1/97

Since peek() always returns a value from 0 to 255, there
is no way that you could get a code segment greater than
65535, *unless* you are somehow picking up the *old*
keyread.e. Please check carefully. Maybe the new one
is in your euphoria\include, but the old one is in your
current directory.

> I changed machine.e to:
>  type far_addr(sequence a)
>  -- protected mode far address {seg, offset}
>      return length(a) = 2 and machine_addr(a[1])
>                                       and machine_addr(a[2])
>  end type
> and now it works fine.

This will work in most cases because only the low-order 16 bits
of the segment are actually used by set_vector and they will be
correct. However, I think your program will still fail if the
highest-order (32nd) bit happens to be set, due to the way that set_vector
has been coded inside ex.exe.

Regards,
     Rob Craig
     Rapid Deployment Software

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu