Page 1 of 1

ds:si packet address int 13h ah=42h

Posted: Sun May 13, 2012 4:04 pm
by Mikemk
Sorry if the answer is obvious, but how would one put the address of the ds:si packet in ds:si using nasm?

Re: ds:si packet address int 13h ah=42h

Posted: Sun May 13, 2012 6:09 pm
by evoex
Read up on segmentation and real-mode on the wiki:
http://wiki.osdev.org/Segmentation
http://wiki.osdev.org/Real_Mode

Hope that helps

Re: ds:si packet address int 13h ah=42h

Posted: Sun May 13, 2012 8:09 pm
by Mikemk
evoex wrote:http://wiki.osdev.org/Segmentation
Thanks, quite helpful

Re: ds:si packet address int 13h ah=42h

Posted: Sun May 13, 2012 8:25 pm
by Mikemk

Code: Select all

1  mov [si], DWORD [packet]
2  mov es:[bx], 0x500
line 1 produces "error: operation size not specified"
line 2 produces "error: invalid combination of opcode and operands"

What am I doing wrong?

Re: ds:si packet address int 13h ah=42h

Posted: Sun May 13, 2012 8:45 pm
by Mikemk
nm, I figured it out

Re: ds:si packet address int 13h ah=42h

Posted: Mon May 14, 2012 1:29 pm
by neon
nm, I figured it out
Im not convinced you have.... mov [es:bx], ax stores ax into the location at es:bx; it does not set es nor bx. If you want to set ds and si to contain the address of the packet, you need to know real mode addressing:

Code: Select all

mov ax, 0x7c0 ; ds:si -> 0x7c0:packet
mov ds, ax
mov si, packet