lee@chsun1.uchicago.edu (dwight lee) (07/20/90)
I am using Turbo Assembler 1.0 (came with Turbo C 2.0 Professional) and I am starting to learn 8086 Assembly. To start out, I would just like to get the commonly-used instructions to work (ADD, MUL, etc). To this end I am only writing programs whose code and data are all in the same segment so that I don't have to worry about segmented addressing (for now). I also want to learn how to use DEBUG (from MS-DOS 3.30) to analyze the execution of COM files. Therefore, I want to use Turbo Assembler (and Linker) to generate COM files which I can then DEBUG. However, I can't seem to get the Turbo Linker to generate a COM file. I specify the /t flag when linking and generally get an error like: Unable to generate .COM file - data below CS:IP Or something like that. Without the /t, TLINK generates an EXE which can be converted to COM via EXE2BIN. Fine, but I'd rather do it directly through Turbo Linker. I have read the Turbo Assembler User's Guide and Reference Manual and have had no success puzzling this through. Evidently I need to find a way to get the code to start at an offset of 0100h, but I don't know how to do this. I only know about the simplified segment directives so far. My test program is: DOSSEG .CODE ProgramStart: mov ah,0 int 21h END ProgramStart Help! Also, if I want to put some data at a specific offset, how can I do this? I want to put, say, a list of ten numbers at 0300h (if the COM program starts at 0100) and address them in my program directly, instead of having the Linker take care of it for me. (I know it sounds silly to do this, but I want to do it anyway. Surely there is a way!) Thanks for your generous assistance. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dwight A Lee / lee@chsun1.uchicago.edu / Am I the only net.user in DeKalb? 416 Annie Glidden Rd #B6 / "I am not the only dust my mother raised" - TMBG DeKalb IL 60115 / 815-758-1389 / I speak only for myself. / tCS/BB / Font
lee@chsun1.uchicago.edu (dwight lee) (07/20/90)
In article <lee.648414673@chsun1> I asked about making COM files with Turbo
Assembler and Linker. I am a novice to 8086.
Both Matthew Lee (leemc@csri.toronto.edu) and David Lu <lulu@ucrmath.ucr.edu>
wrote to tell me about the ORG/origin assembler directive and how it could
be used to indicate specific offsets in data and code segments. I took
their advice and put an
ORG 0100
before my code, and it worked like a charm. Thanks David and Matthew!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dwight A Lee / lee@chsun1.uchicago.edu / Am I the only net.user in DeKalb?
416 Annie Glidden Rd #B6 / "I am not the only dust my mother raised" - TMBG
DeKalb IL 60115 / 815-758-1389 / I speak only for myself. / tCS/BB / Font