phar lap (Developers)
> Microsoft C++ 5.1 which I also recently received on floppy
> disks has huge pointer support, but not huge memory model.
>
> ie I have to use the "huge" keyword everywhere.
I don't remember what compiler options I was using
when doing that previous test - or maybe I was
drunk as a skunk - but I repeated the test as part
of my vlog on pdos.org (I bought a Book 8088 with
an NEC V20 (so I can do 8080 (8-bit) with some effort)
running msdos 6.22) and was shocked to see an
unexpected result - huge memory model works!!!
I have repeated the test under Win95, but I was not
able to redirect the stderr, so can't capture the
version number (5.1) and Bochs wouldn't do a
character screenshot either, so you'll have to trust
me that I didn't manage to stuff up the number 5.1.
Anyway - it works!
Here's the rest of what I ran:
D:\scratch\xxx>type doit.bat
del foo.asm >>output.txt
type foo.c >>output.txt
type foo.asm >>output.txt
cl /c /AH /Fa /Gs foo.c >>output.txt
type foo.asm >>output.txt
char *foo(char *a)
{
return (a + 5);
}
foo.c
; Static Name Aliases
;
TITLE foo.c
NAME foo
.8087
FOO_TEXT SEGMENT WORD PUBLIC 'CODE'
FOO_TEXT ENDS
_DATA SEGMENT WORD PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT WORD PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT WORD PUBLIC 'BSS'
_BSS ENDS
DGROUP GROUP CONST, _BSS, _DATA
ASSUME CS: FOO_TEXT, DS: DGROUP, SS: DGROUP
EXTRN __acrtused:ABS
EXTRN __AHSHIFT:FAR
FOO_TEXT SEGMENT
ASSUME CS: FOO_TEXT
; Line 2
PUBLIC _foo
_foo PROC FAR
push bp
mov bp,sp
; a = 6
; Line 3
mov ax,5
cwd
add ax,WORD PTR [bp+6] ;a
adc dx,0
mov cx,OFFSET __AHSHIFT
shl dx,cl
add dx,WORD PTR [bp+8]
pop bp
ret
nop
_foo ENDP
FOO_TEXT ENDS
END
Doing cl /help shows:
C COMPILER OPTIONS
-MEMORY MODEL-
/AS small model (default) /AC compact model
/AM medium model /AL large model
/AH huge model
-OPTIMIZATION-
/O enable optimization (same as /Ot) /Oa ignore aliasing
/Od disable optimizations /Oi enable intrinsic functions
/Ol enable loop optimizations /On disable "unsafe" optimizations
/Op enable precision optimizations /Or disable in_line return
/Os optimize for space /Ot optimize for speed (default)
/Ox max. optimization (/Oailt /Gs)
-CODE GENERATION-
/G0 8086 instructions (default) /G1 186 instructions
/G2 286 instructions /Gm put strings in constant segment
/Gc Pascal style function calls /Gs no stack checking
/Gt[number] data size threshold
-OUTPUT FILES-
/Fa[assembly listing file] /Fb[bound executable file]
/Fc[mixed source/object listing file] /Fe<executable file>
/Fl[object listing file] /Fm[map file]
/Fo<object file> /Fs[source listing file]
(press <return> to continue)
-PREPROCESSOR-
/C don't strip comments /D<name>[=text] define macro
/E preprocess to stdout /EP same as /E but no #line
/I<name> add #include path /P preprocess to file
/U<name> remove predefined macro /u remove all predefined macros
/X ignore "standard places"
-LANGUAGE-
/Za disable extensions /Zd line number information
/Ze enable extensions (default) /Zg generate declarations
/Zi symbolic debugging information /Zl remove default library info
/Zp[n] pack structs on n-byte boundary /Zs syntax check only
-FLOATING POINT-
/FPa calls with altmath /FPc calls with emulator
/FPc87 calls with 8087 library /FPi inline with emulator (default)
/FPi87 inline with 8087
-SOURCE LISTING-
/Sl<columns> set line width /Sp<lines> set page length
/St<string> set title string /Ss<string> set subtitle string
-MISCELLANEOUS-
/c compile only, no link /H<number> external name length
/J default char type is unsigned /Tc<file> compile file without .c
/V<string> set version string /W<number> warning level
(press <return> to continue)
-LINKING-
/F<hex_number> stack size (hex. bytes) /Lc link compatibility mode executable
/Lr link compatibility mode executable /Lp link protect mode executable
/link [linker_options_and_libraries]
but the version number must have gone to stderr
there too.
BFN. Paul.
Complete thread:
- phar lap - kerravon, 31.05.2023, 17:57 (Developers)