referring to segments other than DS - how?



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
.



Relevant Pages

  • RosAsm is 20x Faster than MASM, NOT!
    ... than MASM (you'd think by now he'd figure out that this is utter nonsense ... Now I'm not going to bother to convert RotAsm source code to MASM format, ... RosAsmites - the source code to HLA v2.0 is on-line, assemble it and try ...
    (alt.lang.asm)
  • Re: What is an assembler?
    ... "You state 'Assembles using TASM and MASM.' ... I have MASM 6.11, but have yet to figure out what is what. ... I wouldn't think so, but then again, I probably wouldn't just assemble ... Maybe you didn't read the text on the web site very thoroughly yet. ...
    (alt.lang.asm)
  • Re: What is an assembler?
    ... BUT it really isn't worth BUYING TASM ... just to assemble this ONE program is it. ... >> contains anything that MASM 2.0 can't handle. ... >"These structure declarations are compatible with either Borland's TASM, ...
    (alt.lang.asm)
  • Re: referring to segments other than DS - how?
    ... 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 in MASM. ... I tried @BSS, that didn't assemble. ... Which registers are legal to use? ... You can use an offset, plus an base register, plus an index register. ...
    (alt.lang.asm)
  • Re: Explanation of a swindling
    ... After downloading RosAsm and extracting it, ... but did not assemble with an argument of 5000. ... He had no real life Applications written with MASM ... and that all of the idiots ...
    (alt.lang.asm)