Browse Source

+ initialize the segment of __stktop, __stkbottom, __nearheap_start and
__nearheap_end in i8086 far data memory models.
+ 'Hello world!' now works in the i8086 compact and large memory models!

git-svn-id: trunk@27377 -

nickysn 11 years ago
parent
commit
e4437bcd51
1 changed files with 9 additions and 0 deletions
  1. 9 0
      rtl/msdos/prt0comn.asm

+ 9 - 0
rtl/msdos/prt0comn.asm

@@ -183,6 +183,15 @@ skip_mem_realloc:
         dec bx
         mov word [__nearheap_end], bx
 
+%ifdef __FAR_DATA__
+        mov ax, ss
+        mov word [__stkbottom + 2], ax
+        mov word [__stktop    + 2], ax
+        mov ax, ds
+        mov word [__nearheap_start + 2], ax
+        mov word [__nearheap_end   + 2], ax
+%endif
+
 %ifdef __FAR_CODE__
         jmp far PASCALMAIN
 %else