(nasm) New segment / 16 and 32 bits segment / end of segment

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
yee1
Member
Member
Posts: 42
Joined: Sun Feb 10, 2013 4:02 pm

(nasm) New segment / 16 and 32 bits segment / end of segment

Post by yee1 »

Hey,

1st question
I am using NASM and i want to make new segment (want to prepare gdt to activate protected mode).
I start my new segment like this

Code: Select all

myNewSegment segment use16
Below that line of code I have put some instances of structure for GDT. But how to end it like "myNewSegment ends" for FASM ?!

2nd question
I want to get size of above myNewSegment segment. I want to do somephing like that "sizeOfmyNewSegment = $ - beginOfmyNewSegment" (pseudocode). How to do this ?

3rd question
What is the difference between use16 and use32 when defining a segment ? I know it means 16 and 32 bits, but could you possible describe me what is it for ?


Thank you.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: (nasm) New segment / 16 and 32 bits segment / end of seg

Post by qw »

Sorry but this is basic knowledge that you can easily find in the manual.
Post Reply