Solved

Heading Details

Posted on 2004-03-26
7
228 Views
Last Modified: 2012-03-15
Hello, thanks for reading my question.

I was wondering if someone could explain what "heading details" were, and why they are required by some assemblers and not others.

I seem to remember trying to write a simple program, but it wouldnt assemble because it was requiring all this additional code (that didn't seem to make much sense to me).  Is this the same thing?

I hope my question makes sense.  I'm kinda new to assembly and have a lot of questions...

Thanks in advance.

Michael
0
Comment
Question by:michaelman
7 Comments
 
LVL 12

Accepted Solution

by:
stefan73 earned 25 total points
Comment Utility
Hi michaelman,
You mean all the lines about code model and such?

They're required for the assembler in order to create a binary - this information is used to create the appropriate sections, relocation entries, etc.

Cheers,

Stefan
0
 
LVL 12

Expert Comment

by:stefan73
Comment Utility
michaelman,
Provide an example, and I'll see.
0
 

Author Comment

by:michaelman
Comment Utility
The following code was included in MASM.  The file is called "minimum.asm", which leads me to believe its the smallest code that can be assebled (?).

At any rate, none of the tutorials I have read provide much information about the first few lines:

                 ideal
                 p286n
                 model tiny

                codeseg
                   org 100h
                   jmp start
             
               start:
                  mov ax, 4c00h
                  int 21h
               end
0
 
LVL 8

Assisted Solution

by:manish_regmi
manish_regmi earned 25 total points
Comment Utility
hi,
 those "heading details" are required by the assembler the output you want.
eg,
.model tiny is a model directive. it will tell the assembler to use tiny memory model.
The executable code contains segments code, data and stack.
so you need to tell the assembler to put which code in which segment.

hi, if you are newbie, the book below will be a good start
http://cs.smith.edu/~thiebaut/ArtOfAssembly/artofasm.html

regards manish
0
 
LVL 5

Expert Comment

by:twobitadder
Comment Utility
codeseg
        org 100h

this tells the assembler that the code segment (area of memory that will hold the instructions as opposed to data) begins at address 100 hex.
org 100h simply means origin 100h.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now