wok rev 15469
memtest/bootloader.S: fix dos exit
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Nov 08 12:52:29 2013 +0000 (2013-11-08) |
parents | 8ac80fe62efb |
children | 3c0fd9f4d4a8 |
files | memtest/stuff/bootloader.S |
line diff
1.1 --- a/memtest/stuff/bootloader.S Fri Nov 08 11:17:44 2013 +0000 1.2 +++ b/memtest/stuff/bootloader.S Fri Nov 08 12:52:29 2013 +0000 1.3 @@ -45,12 +45,13 @@ 1.4 end_header: 1.5 comstart: 1.6 #ifdef CMDLINE 1.7 - .word 0xA33A // CMP AH,[BP+DI+stacktop] 1.8 + cld # assume nothing 1.9 + .byte 0xA3 // mov %ax,[stacktop] 1.10 .word stacktop 1.11 #else 1.12 + cld # assume nothing 1.13 #undef HELP 1.14 #endif 1.15 - cld # assume nothing 1.16 pushw $INITSEG 1.17 popw %es 1.18 #ifdef CMDLINE 1.19 @@ -68,11 +69,15 @@ 1.20 decw %si 1.21 rep 1.22 movsb 1.23 +# if defined(HELP) || defined(CHECK_REALMODE) 1.24 + pushw %cx // dos exit (int $0x20) 1.25 +# endif 1.26 # ifdef HELP 1.27 # define PUTS 1.28 movw $EXEADRS(helpmsg), %si 1.29 cmpb $'/', %al 1.30 je puts 1.31 + movb setup_sects-helpmsg(%si), %ch 1.32 # endif 1.33 nocmdline: 1.34 #endif 1.35 @@ -86,10 +91,10 @@ 1.36 pushw %ax 1.37 popfw // < 286 : flags[12..15] are forced 1 1.38 pushfw // = 286 : flags[12..15] are forced 0 1.39 - popw %cx // > 286 : only flags[15] is forced 0 1.40 + popw %dx // > 286 : only flags[15] is forced 0 1.41 popfw // restore flags 1.42 - addb %ah, %ch // test F0 and 00 cases 1.43 - cmpb %ah, %ch 1.44 + addb %ah, %dh // test F0 and 00 cases 1.45 + cmpb %ah, %dh 1.46 jbe puts // C=8086/80186, Z=80286 1.47 smsww %ax 1.48 andb $1, %al 1.49 @@ -97,7 +102,9 @@ 1.50 #endif 1.51 movw $0x100, %si 1.52 movw $end_header, %di 1.53 +#ifndef HELP 1.54 movb EXEADRS(setup_sects), %ch 1.55 +#endif 1.56 movb $(512-(end_header-_start))/2, %cl 1.57 rep 1.58 movsw