Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can MOVSB work in 32bit mode?

Status
Not open for further replies.

straiph

Programmer
Mar 4, 2002
193
GB
How do you tell the processor to use 32bit when using the MOVSB opcode? It must be something really simple that i am overlooking, or MOVSB is only a 16bit opcode and the book of words is wrong.

The opcode for MOVSB is 0A4h.

I am tring to write from DS:ESI to ES:EDI but the previous opcode will only operate using DS:SI to ES:DI.

The book of words says i can do it but my assembler is only generating 0A4h

I have even tried inserting 'db 066h' before the MOVSB command to involk 32bit addressing with no affect.

I have also tried using the following directives
.386p
.model flat
code segment para 'CODE' use32

This works
mov ds,?
mov si,?
mov ax,0B000h
mov es,ax
mov di,08000h
movsb

This does not
xor ax,ax
mov es,ax
mov ds,ax
mov esi,?
mov edi,0B8000h
movsb
 
Ok, who ever posted this is a real muppet!

the opcode 066h tells the processor to use 16bit processing for the following opcode.

all my commands with 066h were losing the extra bits when i was programming in 32bit mode. I have removed them.

i have now successfully used MOVSB in 32bit mode.

jmp far ptr CrawlsBackIntoHole

t'tar

0000:0000:0000:0000h
The people who have nothing to say and say it too loud have little knowledge, It's the quiet ones you need to worry about!
 
OK, Im starting to get the hang off this now,

066h opcode is the bit size override for operands
067h opcode is the bit size override for addresses

ie if the default address size is 16bit the following command after the opcode will be 32bit and visa.

the default address size is set in the D/B bit22 in the segment descriptor in the GDT pointed to by the segment selector(cs,ds,es,etc)
0000:0000:0000:0000h
The people who have nothing to say and say it too loud have little knowledge, It's the quiet ones you need to worry about!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top