I have code like this:...
mov bx, offset handler0...
mov es:[0h], bx
mov bx, seg handler0
mov es:[02h], bx
as86 uses 16-bit a.out format, and I'm not sure it can
handle a reference to just "seg". ie half of an address
being fixed up (I think that's what it does).
Is there a better way of writing this code, more in line
with the simple a.out format?
Is it:
addr0 dd handler0
And then do an les of that?
Is it:
addr0 dd handler0
And then do an les of that?
I don't recall the a.out format supporting segmentation.
I found my way around the similar problem with the ELF
format by simply using 32-bit physical addresses,
which are then decomposed into 16-bit segment and
16-bit offset pairs whenever necessary.
On Sunday, November 20, 2022 at 6:08:16 AM UTC+8, Alexei A. Frounze wrote:
Is it:
addr0 dd handler0
And then do an les of that?
I don't recall the a.out format supporting segmentation.
I found my way around the similar problem with the ELFHow do I use a 32-bit physical address?
format by simply using 32-bit physical addresses,
which are then decomposed into 16-bit segment and
16-bit offset pairs whenever necessary.
Is it like above?
How do I use a 32-bit physical address?
Is it like above?
Yes.
And here is the new code, which is now preventing PDOS/86
from booting:
.data
addr0 dd handler0
addr1 dd handler1
addr3 dd handler3
addr20 dd handler20
addr21 dd handler21
addr25 dd handler25
addr26 dd handler26
.code
instint proc uses bx es ds
mov bx, 0
push bx
pop es
cli
lds bx, addr0
mov es:[0h], bx
mov es:[02h], ds
lds bx, addr1
On Sunday, November 20, 2022 at 8:35:48 PM UTC+8, Paul Edwards wrote:^w overwritten
And here is the new code, which is now preventing PDOS/86
from booting:
I decided to have another crack at this, to see if the
recent changes to pdos/86 to build it using the huge
memory model instead of the large memory model,
with a 32-bit size_t, but still pure 8086 code, had made
this problem go away. But the problem was still there.
.data
addr0 dd handler0
addr1 dd handler1
addr3 dd handler3
addr20 dd handler20
addr21 dd handler21
addr25 dd handler25
addr26 dd handler26
.code
instint proc uses bx es ds
mov bx, 0
push bx
pop es
cli
lds bx, addr0
This causes ds to be destroyed.
mov es:[0h], bx
mov es:[02h], ds
lds bx, addr1
This uses the destroyed ds to attempt to access addr1 :-)
I solved the problem by doing this:
push ds
lds bx, addr1
mov es:[04h], bx
mov es:[06h], ds
pop ds
And now all of wasm, masm and as86 assemble the code,
but I can only test that wasm and masm actually work.
BFN. Paul.
push ds
lds bx, addr1
mov es:[04h], bx
mov es:[06h], ds
pop ds
You've changed the target address?!
If all your doing is moving some dwords, 'movsd' might be what you need.
If all your doing is moving some dwords, 'movsd' might be what you need.
On Wednesday, November 23, 2022 at 8:58:32 PM UTC+8, Kerr-Mudd, John wrote:
If all your doing is moving some dwords, 'movsd' might be what you need.
I think that is an 80386 instruction based on the error
I got from Watcom. I am after 8086.
movsw is available, but it didn't seem to buy anything
more than I already had.
movsw is available, but it didn't seem to buy anything
more than I already had.
Fine. but it would avoid loading seg registers unneccessarrilly (delete duplicate letters to suit).
On Friday, November 25, 2022 at 1:06:23 AM UTC+8, Kerr-Mudd, John wrote:
movsw is available, but it didn't seem to buy anything
more than I already had.
Fine. but it would avoid loading seg registers unneccessarrilly (delete duplicate letters to suit).
Is that for performance reasons?
Thanks. Paul.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 407 |
Nodes: | 16 (2 / 14) |
Uptime: | 11:51:00 |
Calls: | 8,554 |
Calls today: | 6 |
Files: | 13,219 |
Messages: | 5,925,363 |