segments and initialization

Reply

Join Date: Jun 2005
Posts: 2
Reputation: Sabre1985 is an unknown quantity at this point 
Solved Threads: 0
Sabre1985 Sabre1985 is offline Offline
Newbie Poster

segments and initialization

 
0
  #1
Jun 27th, 2005
Hello All,

I have a question concerning setting up the code segment. I'm curious about what is being done in this code excerpt. I've tried to search and find documentation about it and have been unsuccessful.

mov bx,256
add bx,OFFSET endprog
add bx,OFFSET enddata
shr bx,1
shr bx,1
shr bx,1
shr bx,1
inc bx
mov [cs:ssize],bx
mov ah,setblock
int dos.

I understand the pure mechanisms of the commands but lack the understanding as to what purpose these commands perform.

Bx contains a value dictated by the programs locations, but then it's
divided by 16? I understand that this divides it by a paragraph. Then
it's incremented. And then moved into a code segment offset ssize. And
what is being done when the interrupt to the dos routine is performed?

I hope that I have not missed some obvious clue

Thank you so much,
Sabre1985
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC