Re: referring to segments other than DS - how?



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

in 16bit, if you're using the .model directive (ie .model small),
@data will be the "group" of the data segment. Then both logical
segments _DATA and _BSS are contained in the same physical segment
(which is called DGROUP) and the "offset" operator will refer to the
physical segment then (at least with MASM v6+).

.



Relevant Pages

  • Re: quick ASM program
    ... mov ax, 13h ... int 10h ... To do it in Windows (what you've got there is *not* a Windows program - ... Dos loads it to offset 100h in a segment of its choosing. ...
    (alt.lang.asm)
  • Re: concatain and change bytes
    ... access use the data segment that specify the destination seg.adress. ... mov ah, ... thus be called at any time, even during another INT 21h call ... mov ah, 48h; ALLOCATE MEMORY ...
    (alt.lang.asm)
  • Re: C and ELF segment
    ... it mentions that BSS segment only stores the ... language does not actually specify things like segments, a BSS ... int main{ ...
    (comp.lang.c)
  • Re: newbie questions
    ... MOV AH,4EH; ... instruction operands must be the same size" this error is in line " INT 21H", because it points everything whats after mov dx, offset mask. ... X86 addresses *always* involve a segment register, ... The examples in your book will need some alteration to work with Nasm. ...
    (alt.lang.asm)
  • Re: Why is my nasm program killing itself?
    ... Mmmkaaay, I reverted back to .bss, and put it on the top of the file, ... mov esi,10; if I remove any of these 3 commented lines the ... _bla: mov eax, 0x04 ... int 80H ...
    (alt.lang.asm)