Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.development    |    Operating system development chatter    |    4,255 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,829 of 4,255    |
|    mutazilah@gmail.com to All    |
|    visual studio 1.52 huge memory model    |
|    06 Jun 23 02:47:33    |
   
   From: muta...@gmail.com   
      
   Hi.   
      
   We have previously discussed laying out the PM16   
   selectors. And I remember we agreed that the code   
   selectors and data selectors needed to be   
   intermingled to provide a somewhat flat (ie not   
   really flat, more consecutive) address space.   
      
   Anyway, I recently purchased Visual Studio 1.52   
   from ebay and it runs under Windows and produces   
   real memory code, and the huge memory model is   
   pretty good, and in fact, I think Microsoft C 5.1   
   generated the same/similar code.   
      
   However, I'm not sure whether this is sufficient to   
   do PM16 the way I want.   
      
   Apparently it IS sufficient to do PM16. There is a   
   AHSHIFT and an AHINCR (not generated in this   
   case). But just because it works for PM16 the way   
   Windows does it, doesn't mean it will work for the   
   way I want to do PDOS/286.   
      
   Note that Watcom is completely flexible - it calls an   
   external function to manipulate huge pointers.   
      
   So my question is - is the Visual Studio-generated code   
   sufficient for a somewhat-flat address space that we   
   previously discussed? It's flat from the perspective of   
   the C programmer, who has access to 16 MiB on an   
   80286 and access to (what did we say? 256 MiB I   
   think - on PM16 on an 80386 - and 512 MiB on PM32   
   with D-bits set to 16-bit, maybe?).   
      
   Thanks. Paul.   
      
      
      
   D:\scratch\xxx>type foo.c   
   char *foo(char *in, long x)   
   {   
   return (in + x);   
   }   
      
   D:\scratch\xxx>cl /AH /Fa /c foo.c   
   Microsoft (R) C/C++ Optimizing Compiler Version 8.00c   
   Copyright (c) Microsoft Corp 1984-1993. All rights reserved.   
      
   foo.c   
      
   D:\scratch\xxx>type foo.asm   
   File foo.c   
   Line 2   
   in = 0006   
   x = 000a   
   _foo:   
    push bp   
    mov bp,sp   
    mov ax,OFFSET L00106   
    call FAR PTR __aFchkstk   
    push si   
    push di   
   Line 3   
    mov ax,WORD PTR 10[bp]   
    mov dx,WORD PTR 12[bp]   
    mov cx,WORD PTR 6[bp]   
    mov bx,WORD PTR 8[bp]   
    add ax,cx   
    adc dx,OFFSET 0   
    mov cx,OFFSET __AHSHIFT   
    shl dx,cx   
    add dx,bx   
    jmp L00105   
   Line 4   
   Line 4   
   L00105:   
    pop di   
    pop si   
    mov sp,bp   
    pop bp   
    ret OFFSET 0   
      
   D:\scratch\xxx>   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca