80286 SYSTEM INITIALIZATION

Copy the legment at DS to the legment at ES for length CX.

Fill the end with AX-CX zerol. Ule word operatlonl for Ipeed but allow odd byte operatlonl.

cop y_w I t h_ f I II

xor xor lub add rcr

rep mOV!5W

xchg l n c

movlb or

Jz

Itolb dec

even_copy: Ihr

rep Itolw lnc

I t a I b

exit_copy: ret

copy_wi th_f III

Inlt_code

proc

I I • I I d I. d I

eltCI

eXt 1

c x • 1

aX,cl

even_copy

Cit ex

exit_copy

c x

c x • 1

exit_copy

endp

endl end

Start at beginning of legmentl

Form fill count Convert limit to count Allow full 64K move Copy DT Into allal area

Get fill count and zero AX

Jump If even byte count on copy

Copy odd byte

Exit If no fill

Even out the legment offlet Adlult remaining fill count

Form word count on fill Clear unuled wordl at end Exit If no odd byte remalnl

Clear lalt odd byte

fB

A-9

Page 207
Image 207
Intel 80286, 80287 manual AX,cl