TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: KEVIN BARROW
from: HUGH NOLAND
date: 1997-02-10 08:42:00
subject: Data in code segment

KB> KB>  org      100h                   ; Were to start
KB>  HN>      ^^^^^^^^^^^^^  I'm not sure what the point of this is.
KB>  It tells the assembler were the Code is starting. That way
KB>  it can allign the Code corectly for jumps and everything.
 
     I know what "org" does.  I queried it here because this,
     contrary to what you claim, is not a COM file since it has
     a data segment separate from the code segment.
 
KB>         mov      dx,0110h               ; This is MSG I am not sure how 
o
KB> HN>   You can simply write: mov dx,offset MSG
KB> I tried both of these methods, In my compiler it would start 16k
                                                                   ^??
KB> ahead of the offset sence msg was 16bytes after the 100h origin
 
    I don't know what "compiler" you are using.  As modified, it
    assenbles correctly with TASM 1.01, into an .EXE file,
    and functions as expected.
 
KB>         ret
KB> This is a com program(at least that is how I ran it.  I know about
KB> the exit codes, The one above is exit to dos with errorlevel=0
 
    Are you sure about this?  I was under the impression that "int 20h"
    didn't return an errorlevel.  *And* I don't see how you can get
    any sort of exit-to-Dos from an .EXE program with "ret" (except
    by accident).
 
KB> I know why this works in com programs. And that is why I used it
KB> this is a com program And I  did compile it, ran great for a simple
KB> prog..
 
    I have already commented on this.  In a COM program, code, data,
    stack must all reside in the same segment.  Here you have defined
    a separate segment for data.  Your assembler didn't
    generate an error when you tried to assemble this into a COM
    program?
 
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 916-893-8079 * (1:119/88)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.