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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

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

Post 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?
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
evoex
Member
Member
Posts: 103
Joined: Tue Dec 13, 2011 4:11 pm

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

Post 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
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

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

Post by Mikemk »

evoex wrote:http://wiki.osdev.org/Segmentation
Thanks, quite helpful
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

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

Post 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?
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

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

Post by Mikemk »

nm, I figured it out
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

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

Post 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
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Post Reply