# HG changeset patch # User Pascal Bellard # Date 1383915149 0 # Node ID d9dd83ccc85f054c1dbd426d11d2e116a69e894f # Parent 8ac80fe62efbe828e6fc4e3b15f304d53c19fcdd memtest/bootloader.S: fix dos exit diff -r 8ac80fe62efb -r d9dd83ccc85f memtest/stuff/bootloader.S --- a/memtest/stuff/bootloader.S Fri Nov 08 11:17:44 2013 +0000 +++ b/memtest/stuff/bootloader.S Fri Nov 08 12:52:29 2013 +0000 @@ -45,12 +45,13 @@ end_header: comstart: #ifdef CMDLINE - .word 0xA33A // CMP AH,[BP+DI+stacktop] + cld # assume nothing + .byte 0xA3 // mov %ax,[stacktop] .word stacktop #else + cld # assume nothing #undef HELP #endif - cld # assume nothing pushw $INITSEG popw %es #ifdef CMDLINE @@ -68,11 +69,15 @@ decw %si rep movsb +# if defined(HELP) || defined(CHECK_REALMODE) + pushw %cx // dos exit (int $0x20) +# endif # ifdef HELP # define PUTS movw $EXEADRS(helpmsg), %si cmpb $'/', %al je puts + movb setup_sects-helpmsg(%si), %ch # endif nocmdline: #endif @@ -86,10 +91,10 @@ pushw %ax popfw // < 286 : flags[12..15] are forced 1 pushfw // = 286 : flags[12..15] are forced 0 - popw %cx // > 286 : only flags[15] is forced 0 + popw %dx // > 286 : only flags[15] is forced 0 popfw // restore flags - addb %ah, %ch // test F0 and 00 cases - cmpb %ah, %ch + addb %ah, %dh // test F0 and 00 cases + cmpb %ah, %dh jbe puts // C=8086/80186, Z=80286 smsww %ax andb $1, %al @@ -97,7 +102,9 @@ #endif movw $0x100, %si movw $end_header, %di +#ifndef HELP movb EXEADRS(setup_sects), %ch +#endif movb $(512-(end_header-_start))/2, %cl rep movsw