Hi Hugh!
> I'm an infrequent user of A86. I only use it occasionally for short
> test programs. So I'm not well-acquainted with it. I ran across the
> following problem. At least I think it's a problem. Perhaps I'm just
> making a mistake:
>
> cseg segment
> assume cs:cseg
> begin:
> mov ax,dseg
> mov ds,ax
>
> mov dx,offset msg
> mov ah,9
> int 21h
>
> mov ax,4c00h
> int 21h
> cseg ends
>
> dseg segment
> msg db "Hello, hello, hello.$"
> dseg ends
>
> end begin
>
> This code aseembles correctly with TASM into an .EXE file, and runs as
> expected. A86 incorrectly assembles it into a .COM file which does not
> execute properly because the first two lines of code cause A86 to place
> 0 in DS.
I tried this program and got basically the same thing you got, and it
printed only garbage to the screen. So I disassembled it to see the first
two lines as this:
mov ax, 0000
mov ds, ax
I wasn't sure why it was doing that. So after playing around with it
for a bit, I found out what the problem was. Change the line of code
reading:
mov ax, dseg
to:
mov ax, seg dseg
When I compiled it, it printed "Hello, hello, hello." to the screen
correctly. I then disassembled it to see the first two lines of code
reading:
mov ax, cs
mov ds, ax
Hope that helps...
Nick Coons
nick.coons@juno.com
Dynamic Computer Systems
--- FMail/386 1.02
---------------
* Origin: Dynamic Computer Systems (1:114/404)
|