referring to segments other than DS - how?
- From: Pop Tart <morespamsREMOVE@xxxxxxxxxxxxxxx>
- Date: Wed, 27 Feb 2008 11:05:10 -0600
Hi,
I'm back again with two 16-bit newb questions :)
1)
With int 21h function 3Fh, I'm trying to write then read an array of
bytes in the uninitialized data section.
When I call the int 21h / 3Fh to read from a file and store in an
uninitialized buffer - I assume the interrupt wants both BX and DX to be
offsets to DS, so how do I set DS to uninitialized section (BSS) in
MASM. I know how to set DS to "DATA" segment in MASM :
mov ax, @data
mov ds, ax
so for BSS, would it be:
mov ax, _BSS
I tried @BSS, that didn't assemble.
;-----------------------------------
2)
Secondly, if I set ES to the data segment, DS, for example
mov ax, @data
mov es, ax
How do I de-reference a byte that is offset in the ES section? Which
registers are legal to use?
ie, this isn't assembling for me:
mov ax, @data ; set es to data segmet
mov es, ax
mov dx, OFFSET InputBuffer
mov al, BYTE PTR es:[dx]
The MASM assembler complains about the last line, saying:
main.asm(134): error A2031: must be index or base register.
I change 'dx' to 'di' and it assembles ok. Which other registers are
legal?
--
Regards,
Pop Tart
.
- Follow-Ups:
- Re: referring to segments other than DS - how?
- From: Pop Tart
- Re: referring to segments other than DS - how?
- From: japheth
- Re: referring to segments other than DS - how?
- From: Frank Kotler
- Re: referring to segments other than DS - how?
- Prev by Date: Re: [OT] the lack of humility
- Next by Date: Re: referring to segments other than DS - how?
- Previous by thread: [OT] the lack of humility
- Next by thread: Re: referring to segments other than DS - how?
- Index(es):
Relevant Pages
|