Usedavid wrote:Code:
The error line is "lgdt qword ptr cs:[bx]".
I tried ml 8.0, It also has the error.
how to solve it ?
Code: Select all
lgdt fword ptr cs:[bx]
Usedavid wrote:Code:
The error line is "lgdt qword ptr cs:[bx]".
I tried ml 8.0, It also has the error.
how to solve it ?
Code: Select all
lgdt fword ptr cs:[bx]
Microsoft Macro Assembler Reference
FWORD
Allocates and optionally initializes 6 bytes of storage for each initializer.
[[name]] FWORD initializer [[, initializer]]... Remarks
Also can be used as a type specifier anywhere a type is legal.
Microsoft Macro Assembler Reference
DF
Can be used to define data such as FWORD.
That's what poor ol' Troy Martin was trying to explain until he finally had to quit...tantrikwizard wrote:FYI, MASM cannot be used for OS development, its in the license agreement (or was last time I checked).
...tantrikwizard wrote:FYI, MASM cannot be used for OS development, its in the license agreement (or was last time I checked).
I have to agree. Most people think that the MS macro assembler is the same thing as masm32 - but they aren't. Masm32 is some additional code, libraries and whatnot bundled with the assembler. It's eared towards Win32 application programming. It's licence doesn't permit you to use it for OS development. However, my university participates in this MSDNAA program, so I got the whole VisualStudio 2003 (and later versions, 2005 and 2008) for free, and it actually comes with the MS assembler. And (as far as I can remember) there is nothing in the VS licence which forbids you to use the assembler for OS development.JAAman wrote:ummm...
there is nothing in the masm license which prevents its use for writing operating systems...
is that a little clearer for you??
but I don't have time to try it.Microsoft Macro Assembler Reference
MASM for x64 (ml64.exe)
ml64.exe is the assembler that accepts x64 assembly language. For information on ml64.exe compiler options, see ML and ML64 Command-Line Reference.
Inline ASM is not supported for x64. Use MASM or compiler intrinsics (x64 Intrinsics).
The two workarounds are separate assembly with MASM (which supports x64 fully) and compiler intrinsics. We’ve added a lot of intrinsics to allow customers to make use of special-function instructions (e.g. privileged, bit scan/test, interlocked, etc…) in as close to cross-platform a manner as possible.
32-Bit Address Mode (Address Size Override)
MASM will emit the 0x67 address size override if a memory operand includes 32-bit registers. For example, the following examples cause the address size override to be emitted:
mov rax, QWORD PTR [ecx]
mov eax, DWORD PTR [ecx*2+r10d]
mov eax, DWORD PTR [ecx*2+r10d+0100h]
prefetch [eax]
movnti rax, QWORD PTR [r8d]MASM assumes that if a 32-bit displacement appears alone as a memory operand, 64-bit addressing is intended. There is currently no support for 32-bit addressing with such operands.
Finally, mixing register sizes within a memory operand, as demonstrated in the following code, will generate an error.
mov eax, DWORD PTR [rcx*2+r10d]
mov eax, DWORD PTR [ecx*2+r10+0100h]
Dont forget that if there is nobody to enforce that, then everything is legal especially for hobby OSes and as temporary solution.Troy Martin wrote:/facepalmdavid wrote:and my own os doesn't need to support MASM. I use it in windows.
That's not the point, the point is it's illegal to write an OS or stuff for another OS with MASM. .
I don't know about the specific MASM(32) license, but from a legal point of view, that sounds wrong to me. Just because no-one chooses to enforce something now, doesn't mean they won't in the future. It sounds like saying "murder is legal if nobody catches me" - which I hope most people here would disagree withexkor wrote:if there is nobody to enforce that, then everything is legal especially for hobby OSes and as temporary solution.
your right, there is no clause saying that... but there is nothing saying you cant either... at all... for anyoneAlso, although I haven't read the MASM licence, I'm sure it won't have any clause saying "but it's alright for hobby OSes or temporary use..."
Contact them, you never know. I'm sure the masm team will be happy to help you. Don't be scared of a company by it's size, it's still split into small teams made up of programmers (and other professions) like you and me who are passionate about what they are doing.Shrek wrote:But I seriously doubt that Microsoft will be concerned with someone doing thier hobby os in masm32 or masm.