Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Error in XMS specification? - movp (Developers)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 09.01.2026, 22:07

Here's another piece of code explaining the overlap check for moving "down" (DF=1). If S < D and S + L > D then we are overlapping in the way requiring a backwards move.


        cmp ax, dx              ; source above destination ?
        ja .up                  ; yes, move up (forwards) -->
        je .return              ; same, no need to move -->
        push ax
        add ax, cx              ; (expected not to carry)
        cmp ax, dx              ; end of source is above destination ?
        pop ax
        ja .down                ; yes, move from top down -->
        ; Here, the end of source is below-or-equal the destination,
        ;  so they do not overlap. In this case we prefer moving up.

---
l

 

Complete thread:

Back to the forum
Board view  Mix view
23493 Postings in 2218 Threads, 408 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum