When I compile a file from this site written in assembly (using NASM), it gives this error: Unrecognised directive "[ORG]" this is for the line "[ORG 0x7c00]"
I have used the most recent version of NASM and also a version that the wiki says.
[ORG] gives error
Re: [ORG] gives error
Hi,
An ORG directive will fail in NASM if you are trying to assemble something other than a flat binary. Try adding -f bin to your assembly command line. For some (all?) file formats, the ORG directive will also fail if you include two in the same assembly file.
Cheers,
Adam
An ORG directive will fail in NASM if you are trying to assemble something other than a flat binary. Try adding -f bin to your assembly command line. For some (all?) file formats, the ORG directive will also fail if you include two in the same assembly file.
Cheers,
Adam
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: [ORG] gives error
All formats. From the NASM docsAJ wrote: For some (all?) file formats, the ORG directive will also fail if you include two in the same assembly file.
NASM 6.1.1 wrote:Unlike the ORG directive provided by MASM-compatible assemblers, which allows you to jump around in the object file and overwrite code you have already generated, NASM's ORG does exactly what the directive says: origin. Its sole function is to specify one offset which is added to all internal address references within the section; it does not permit any of the trickery that MASM's version does. See section 10.1.3 for further comments.
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: [ORG] gives error
Duuuude, old manual, you should download/read the new one: http://www.nasm.us/doc
Re: [ORG] gives error
Are you sure you did not type 0 instead of O, it as been known.
And have your tryed
org 7C00h
And have your tryed
org 7C00h
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: [ORG] gives error
Its copied verbaitim to section 7.1.1 in the new manual...Troy Martin wrote:Duuuude, old manual, you should download/read the new one: http://www.nasm.us/doc
Re: [ORG] gives error
Perhaps they have not updated their manual. The newer NASM assemblers do not seem to support it for any format but flat binaries.JohnnyTheDon wrote:Its copied verbaitim to section 7.1.1 in the new manual...Troy Martin wrote:Duuuude, old manual, you should download/read the new one: http://www.nasm.us/doc
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: [ORG] gives error
i faced that before when using bos boot sector and loader and i use windows ,i found the proplem may be about windows newlines try to unident [org]