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

On (10 Feb 97), Hugh Noland wrote to Kevin Barrow...
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.
 HN>      I know what "org" does.  I queried it here because this,
 HN>      contrary to what you claim, is not a COM file since it has
 HN>      a data segment separate from the code segment.
Perhaps I am using "bad form" But I assembled this program as a com
program with the Arrowsoft Assembler, I have no Idea how To "Create"
an EXE program =)
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
 HN>     I don't know what "compiler" you are using.  As modified, it
 HN>     assenbles correctly with TASM 1.01, into an .EXE file,
 HN>     and functions as expected.
Wrong Word, i am learning C as well, I get confused, I am using
the Arrowsoft Assembler, as Stated above, If you know anything
about MASM 3.0 perhaps you can help me Modify this to Run as an
EXE program on my system..
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
 HN>     Are you sure about this?  I was under the impression that "int
 HN> 20h"     didn't return an errorlevel.  *And* I don't see how you can
 HN> get
 HN>     any sort of exit-to-Dos from an .EXE program with "ret" (except
 HN>     by accident).
No, I am not, In fact I know Not =) I believe it would be 4C00:AX
that would return an Errorlevel of zero =) I don't much care to
look it up right now.. And from an EXE I would have no idea how
that would work, as I have said many times I assembled this as a
.COM program with the Arrowsoft Assembler(MASM 3.0)
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..
 HN>     I have already commented on this.  In a COM program, code, data,
 HN>     stack must all reside in the same segment.  Here you have defined
 HN>     a separate segment for data.  Your assembler didn't
 HN>     generate an error when you tried to assemble this into a COM
 HN>     program?
It did not, I do not know why but it assembled just fine as a COM
program other than the fact that I had to "Address" MSG manualy.
other than that it worked great =)
Kevin R. Barrow
--- PPoint 1.96
---------------
* Origin: Another Message Point (1:1063/31)

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™.