mirror of https://github.com/FDOS/kernel.git
kernel.asm optimizations from Arkady
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@896 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
ea23d33c2c
commit
2fcbfdb271
|
@ -123,7 +123,7 @@ kernel_start:
|
||||||
mov sp,init_tos
|
mov sp,init_tos
|
||||||
int 12h ; move init text+data to higher memory
|
int 12h ; move init text+data to higher memory
|
||||||
mov cl,6
|
mov cl,6
|
||||||
shl ax,cl
|
shl ax,cl ; convert kb to para
|
||||||
mov dx,15 + init_end wrt INIT_TEXT
|
mov dx,15 + init_end wrt INIT_TEXT
|
||||||
mov cl,4
|
mov cl,4
|
||||||
shr dx,cl
|
shr dx,cl
|
||||||
|
@ -136,35 +136,27 @@ kernel_start:
|
||||||
sti ; now enable them
|
sti ; now enable them
|
||||||
mov ax,cs
|
mov ax,cs
|
||||||
mov dx,__InitTextStart wrt HMA_TEXT ; para aligned
|
mov dx,__InitTextStart wrt HMA_TEXT ; para aligned
|
||||||
|
shr dx,cl
|
||||||
%ifdef WATCOM
|
%ifdef WATCOM
|
||||||
mov si,dx
|
add ax,dx
|
||||||
mov cl,4
|
|
||||||
shr si,cl
|
|
||||||
add ax,si
|
|
||||||
%endif
|
%endif
|
||||||
mov ds,ax
|
mov ds,ax
|
||||||
mov cx,-2 + init_end wrt INIT_TEXT ; word aligned
|
mov si,-2 + init_end wrt INIT_TEXT ; word aligned
|
||||||
mov si,cx
|
lea cx,[si+2]
|
||||||
mov di,cx
|
mov di,si
|
||||||
shr cx,1
|
shr cx,1
|
||||||
inc cx
|
|
||||||
std ; if there's overlap only std is safe
|
std ; if there's overlap only std is safe
|
||||||
rep movsw
|
rep movsw
|
||||||
|
|
||||||
; move HMA_TEXT to higher memory
|
; move HMA_TEXT to higher memory
|
||||||
mov si,dx ; si = __InitTextStart wrt HMA_TEXT
|
|
||||||
mov cl,4
|
|
||||||
shr dx,cl
|
|
||||||
|
|
||||||
sub ax,dx
|
sub ax,dx
|
||||||
mov ds,ax ; ds = HMA_TEXT
|
mov ds,ax ; ds = HMA_TEXT
|
||||||
mov ax,es
|
mov ax,es
|
||||||
sub ax,dx
|
sub ax,dx
|
||||||
mov es,ax ; es = new HMA_TEXT
|
mov es,ax ; es = new HMA_TEXT
|
||||||
|
|
||||||
mov cx,si ; cx = __InitTextStart wrt HMA_TEXT
|
mov si,-2 + __InitTextStart wrt HMA_TEXT
|
||||||
dec si
|
lea cx,[si+2]
|
||||||
dec si
|
|
||||||
mov di,si
|
mov di,si
|
||||||
shr cx,1
|
shr cx,1
|
||||||
rep movsw
|
rep movsw
|
||||||
|
|
Loading…
Reference in New Issue