Initialize Scheme_Stack_Segment_Selector only if it has not been
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Fri, 18 Sep 1992 05:52:35 +0000 (05:52 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Fri, 18 Sep 1992 05:52:35 +0000 (05:52 +0000)
initialized.

v7/src/microcode/cmpauxmd/i386.m4

index 0cb2df920744e5f21f3d71e43acfcb40568d2419..fa3970009fc66e2db81acdc5ca3c55ffa0a528aa 100644 (file)
@@ -1,6 +1,6 @@
 ### -*-Midas-*-
 ###
-###    $Id: i386.m4,v 1.27 1992/09/18 02:05:26 jinx Exp $
+###    $Id: i386.m4,v 1.28 1992/09/18 05:52:35 jinx Exp $
 ###
 ###    Copyright (c) 1992 Massachusetts Institute of Technology
 ###
@@ -174,6 +174,10 @@ ifdef(`DOS',
       `define(declare_alignment,`')',
       `define(declare_alignment,`      .align $1')')
 
+ifdef(`DOS',
+      `define(allocate_word,`_$1 dw 0')',
+      `define(allocate_word,`  .comm _$1,2')')
+
 ifdef(`DOS',
       `define(allocate_longword,`_$1 dd 0')',
       `define(allocate_longword,`      .comm _$1,4')')
@@ -293,9 +297,9 @@ use_external_data(Ext_Stack_Pointer)
 use_external_data(utility_table)
 
 IFDOS(`define_data(C_Stack_Segment_Selector)
-allocate_longword(C_Stack_Segment_Selector)
+allocate_word(C_Stack_Segment_Selector)
 define_data(Scheme_Stack_Segment_Selector)
-allocate_longword(Scheme_Stack_Segment_Selector)')
+allocate_word(Scheme_Stack_Segment_Selector)')
 
 define_data(C_Stack_Pointer)
 allocate_longword(C_Stack_Pointer)
@@ -322,11 +326,12 @@ define_c_label(i386_interface_initialize)
 
                                                        # Initialize stack
                                                        # selectors
-IFDOS(`        OP(xor,l)       TW(REG(eax),REG(eax))
-       OP(mov,w)       TW(REG(ss),REG(ax))
-       OP(mov,l)       TW(REG(eax),EDR(C_Stack_Segment_Selector))
-       OP(mov,w)       TW(REG(ds),REG(ax))
-       OP(mov,l)       TW(REG(eax),EDR(Scheme_Stack_Segment_Selector))')
+IFDOS(`        OP(mov,w)       TW(REG(ss),EDR(C_Stack_Segment_Selector))
+       OP(mov,w)       TW(EDR(Scheme_Stack_Segment_Selector),REG(ax))
+       OP(cmp,w)       TW(IMM(0),REG(ax))
+       jne             skip_assignment
+       OP(mov,w)       TW(REG(ds),EDR(Scheme_Stack_Segment_Selector))
+skip_assignment:')
 
        OP(xor,l)       TW(REG(eax),REG(eax))           # No 387 available