Selector base and stuff
Posted: Tue Jul 01, 2008 1:05 pm
Hi,
I have loaded a 512 byte buffer for the floppy disk operations with data, but when I want to transfer them to another buffer using MOVSB and MOV ESI/MOV EDI, I must before the process, set DS and ES to linear base (selector 8 ), do the transfer and then set them to nonlinear base (selector 0x18, sys data). That same applies if I want to LODSB something from that buffer - or else it wouldn't fill up anything except zeros - a MOVSB operation without all that will leave EDI zero'ed and LODSB will leave AL=0. (But the location, without the selector setting, seems to be filled properly when I have it disassembled using Bochs). But when I want to print a string, I do normally mov esi,string call WriteS etc, and I don't have to switch the selectors.
If I would leave DS and ES in linear base, everything works very bad, for example the screen printing routine doesn't work etc.
Is this behavior normal?
//EDIT: Well, in the text i/o functions there IS a setting ES to 8, so I think it's normal..
Thanks in advance.
Regards
inflater
I have loaded a 512 byte buffer for the floppy disk operations with data, but when I want to transfer them to another buffer using MOVSB and MOV ESI/MOV EDI, I must before the process, set DS and ES to linear base (selector 8 ), do the transfer and then set them to nonlinear base (selector 0x18, sys data). That same applies if I want to LODSB something from that buffer - or else it wouldn't fill up anything except zeros - a MOVSB operation without all that will leave EDI zero'ed and LODSB will leave AL=0. (But the location, without the selector setting, seems to be filled properly when I have it disassembled using Bochs). But when I want to print a string, I do normally mov esi,string call WriteS etc, and I don't have to switch the selectors.
If I would leave DS and ES in linear base, everything works very bad, for example the screen printing routine doesn't work etc.
Is this behavior normal?
//EDIT: Well, in the text i/o functions there IS a setting ES to 8, so I think it's normal..
Thanks in advance.
Regards
inflater