I'm reading DOS Internals chapter 6, resident programming in C. The
author uses a block swapping algorithm to exchange non resident code
with resident data. His explanation didn't make sense until I found
the same algorithm on the web.
http://kevingong.com/Math/BlockSwapping.html
(algorithm 3) The pictures helped me see what the code is all about.
So I started coding some output to see what's going on. After much trial
and error, I finally got it. Here's the code:
So I started coding some output to see what's going on.
Here's the code
Here's the code
With comments clarified and code optimized. It's not hard when you have working code to look at. I wonder who discovered the algorithm.
With the flowchart, I see what Chappell's code is doing.
https://www.dropbox.com/sh/552uvzndigyv1ym/AADoUObtPej33fZk1SN3lNhKa?dl=0
Public folder, does not require registration.
With the flowchart, I see what Chappell's code is doing.
https://www.dropbox.com/sh/552uvzndigyv1ym/AADoUObtPej33fZk1SN3lNhKa?dl=0
Public folder, does not require registration.
it's OK for pure DOS. my block-move/-swap/-merge routines are much
simpler because I use BIG-REALmode and can work on linear addresses with
only little overhead to calculate seg:offs-->LINADR and swap Dest/Src if necessary or automatic change direction to DOWN in case of overlapping.
On Mon, 10 Aug 2020 08:15:47 +0200, wolfgang kern wrote:
With the flowchart, I see what Chappell's code is doing.
https://www.dropbox.com/sh/552uvzndigyv1ym/AADoUObtPej33fZk1SN3lNhKa?dl=0
Public folder, does not require registration.
it's OK for pure DOS. my block-move/-swap/-merge routines are much
simpler because I use BIG-REALmode and can work on linear addresses with
only little overhead to calculate seg:offs-->LINADR and swap Dest/Src if
necessary or automatic change direction to DOWN in case of overlapping.
No link?
Chappell's code swaps blocks using minimal extra space (16 bytes). Can
you beat that?
it's OK for pure DOS. my block-move/-swap/-merge routines are much
simpler because I use BIG-REALmode and can work on linear addresses with >>> only little overhead to calculate seg:offs-->LINADR and swap Dest/Src if >>> necessary or automatic change direction to DOWN in case of overlapping.
No link?
where to ?
Chappell's code swaps blocks using minimal extra space (16 bytes). Can
you beat that?
I'd like to see this 16 bytes in hex before any attempt to shrink it.
On Tue, 11 Aug 2020 08:59:31 +0200, wolfgang kern wrote:
it's OK for pure DOS. my block-move/-swap/-merge routines are much
simpler because I use BIG-REALmode and can work on linear addresses with >>>> only little overhead to calculate seg:offs-->LINADR and swap Dest/Src if >>>> necessary or automatic change direction to DOWN in case of overlapping.
No link?
where to ?
Your purported magnificent code.
Chappell's code swaps blocks using minimal extra space (16 bytes). Can
you beat that?
I'd like to see this 16 bytes in hex before any attempt to shrink it.
You have the wrong idea. Chappell's book explains if you care to know.
You have the wrong idea. Chappell's book explains if you care to know.
I haven't seen any hex-dump nor an assembly for it
IDK what you're talking about, but it's not what I'm talking about.
You mentioned "16 bytes"...
On Wed, 12 Aug 2020 07:07:56 +0200, wolfgang kern wrote:
You have the wrong idea. Chappell's book explains if you care to know.
I haven't seen any hex-dump nor an assembly for it
IDK what you're talking about, but it's not what I'm talking about.
On Thu, 13 Aug 2020 04:16:21 +0200, wolfgang kern wrote:
IDK what you're talking about, but it's not what I'm talking about.
You mentioned "16 bytes"...
Chappell's unit size is 16 bytes. But the algorithm works with any unit
size.
http://kevingong.com/Math/BlockSwapping.html
Algorithm 3
If you jumped into the middle of this thread and thought it was about something else, or want to talk about something else, you can stop now.
http://kevingong.com/Math/BlockSwapping.html
Algorithm 3
I looked at it
swap: :assume cx holds size
mov AL,[S_1]
xchg AL,[S_2]
mov [S_1],AL
inc S_1
inc S_2
loop swap
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 415 |
Nodes: | 16 (2 / 14) |
Uptime: | 53:47:35 |
Calls: | 8,728 |
Calls today: | 1 |
Files: | 13,276 |
Messages: | 5,958,426 |