Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

A easy question

bogdanul2003bogdanul2003 Member Posts: 153
I have a program witch gets loaded at address 0000:0800.
Do I have to use ORG 0800H when I write a .com file that will get loaded at that address ? I use MASM assembler.

10x

Comments

  • jeffleydajeffleyda Member Posts: 390
    hmmm. maybe not so easy of a question.

    all the org statement does is pad out the beginning of the file with 0's.
    the tool that converts the .exe to a .com file will likely complain that the starting address is not 100h, so you will probably not end up with a .com at the end of the build. You could always stick to the org 100 statement, then build an 800h byte buffer at the top of your program, and perhaps do a small loader at the beginning of your code to jump to cs:800

    -jeff!
  • myrounmyroun Member Posts: 4
    : I have a program witch gets loaded at address 0000:0800.
    : Do I have to use ORG 0800H when I write a .com file that will get
    : loaded at that address ? I use MASM assembler.
    :
    : 10x

    Yes, use org 0800h. This tells the assembler which adress is the program to be loaded. Assembler uses this value for calculating memory adresses.

    Padding with zeros will not occur with .com file (I think that not even with .exe, but I'm not sure)
Sign In or Register to comment.