Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change
QuoteAgain: was that an actual hardware fault caused by a CPU instruction, or something somehow generated by the Win32 function? (Or a hardware fault that was caught by C++ code?)
if((ULONG_PTR)buffer) & 3)
{
ExRaiseDataytpeMisalignmentException();
}
That's what happens in the kernel for pretty much every native function that takes a struct parameter.QuoteTo detect misaligned memory accesses, perhaps? Those cause performance penaltiesNT has been ported to loads of different architectures, it doesn't just run on PCs. Some of those don't do misaligned memory reads (Itanium for one) . Every platform does aligned reads, so you write one check to make sure the buffer is aligned and then you don't have to care about what the platform does if it isn't.
Quote from: _japheth on March 31, 2025, 01:26:01 PMBut but but ... now we're back to square one:Quote from: NoCforMe on March 31, 2025, 09:55:30 AMSeems to me (unless I'm quite wrong here) that Micro$oft is being a bit anal by penalizing the caller for having a misaligned buffer.For Windows Apps alignment check is off in MS Windows - I guess, too many apps would crash if it's on.
Quote from: six_L on March 31, 2025, 02:22:38 PMHi,zedd151I did not (obviously) know that. Thank you six_L.QuoteThis is the 21st century. DOS is still stuck in 1980ish, imo. I just don't get it... at all.Nowadays, most industrial automation control systems still use 16bit CPU.
QuoteThis is the 21st century. DOS is still stuck in 1980ish, imo. I just don't get it... at all.Nowadays, most industrial automation control systems still use 16bit CPU.
Quote from: _japheth on March 31, 2025, 01:31:48 PMNo, those makefiles all run fine in DOS, but need the HX DOS extender ( and the extender's HXLDR32 TSR loaded ). Additionally, I guess the DOSLFN TSR must be loaded to activate LFN support.Couldn't you adapt the Makefile so that it can also be compiled on an 8086 or 286 on a FAT16 file system without LFN support? LFN support is also only available starting with MS-DOS 7.0, which is included with Windows 95b.
Quote from: bugthis on March 31, 2025, 12:14:24 PMTo fix some of the above errors in the OWDOS16.mak and possibly also OWDOS32.mak Makefile, the following corrections must be made:
Quote from: NoCforMe on March 31, 2025, 09:55:30 AMSo, are you saying that this exception must be enabled by setting those bits? otherwise it won't occur?Yes.
QuoteWhy would anyone do such a thing?
QuoteSeems to me (unless I'm quite wrong here) that Micro$oft is being a bit anal by penalizing the caller for having a misaligned buffer.For Windows Apps alignment check is off in MS Windows - I guess, too many apps would crash if it's on.
QuoteAnd I forget just which rings things execute in: does the kernel run in ring 3?No, your app runs in ring 3, the kernel in ring 0.
!ifndef WATCOM
!ifndef %WATCOM
Otherwise, the Makefile cannot access the DOS environment variable WATCOM. It's important that there is no % sign at the end of the entry; this would be different in a normal DOS batch file.!ifndef DEBUG
entry directly below, replacing it with !ifndef %DEBUG
if you want to reference a DOS environment variable named DEBUG here.Error(E14): Cannot execute (\binw\wcc): Argument list too big
Unfortunately, the argument list is still too long. I don't know how to fix this error. I'm not familiar enough with Watcom Makefiles and it could also be related to DOS and its maximum line length.