wok-current diff linld/stuff/src/MEMTOP.ASM @ rev 20147
linld: tiny shrink (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Nov 16 11:15:59 2017 +0100 (2017-11-16) |
parents | 69faca221dde |
children | bcdfc23ee041 |
line diff
1.1 --- a/linld/stuff/src/MEMTOP.ASM Mon Apr 03 17:30:48 2017 +0200 1.2 +++ b/linld/stuff/src/MEMTOP.ASM Thu Nov 16 11:15:59 2017 +0100 1.3 @@ -77,12 +77,10 @@ 1.4 1.5 mov ah,88h 1.6 int 15h ;ax=kbs above 1m 1.7 - jnc @@ok ; error: cf=1 or ax=0 1.8 - xor ax,ax ; 1.9 -@@ok: 1.10 -; xor dx,dx 1.11 - test ax,ax ;happens on big mem systems 1.12 - jnz tokb 1.13 + cmc ; error: cf=1 or ax=0 1.14 + sbb dx,dx 1.15 + and ax,dx ; 1.16 + jnz tokb ;happens on big mem systems 1.17 1.18 ;*************************************************************** 1.19 ;u32 memtop_cmos() 1.20 @@ -90,7 +88,6 @@ 1.21 1.22 ;memtop_cmos: 1.23 pushf 1.24 - cli 1.25 call rdcmos17 1.26 popf 1.27 tokb: 1.28 @@ -98,12 +95,12 @@ 1.29 add ah,4h ;account for 1024 low kb 1.30 adc dx,dx ; (optimized to death) 1.31 mov cl,10 ;multiply by 1024 1.32 - global N_LXLSH@:near 1.33 -N_LXLSH@: 1.34 ifndef NO386 1.35 shld dx,ax,cl 1.36 shl ax,cl ; (kbytes -> bytes) 1.37 else 1.38 + global N_LXLSH@:near 1.39 +N_LXLSH@: 1.40 mov ch,0 1.41 @@lp: 1.42 shl ax,1 1.43 @@ -141,7 +138,8 @@ 1.44 ; jnz @@ok 1.45 ; jmp memtop_cmos 1.46 1.47 -rdcmos17: mov al,18h ; read bytes 17-18 from CMOS 1.48 +rdcmos17: cli 1.49 + mov al,18h ; read bytes 17-18 from CMOS 1.50 call @@rdcmos 1.51 mov ah,al 1.52 mov al,17h