News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

nasm/ Entry 386 question

Started by lly99, April 05, 2008, 06:22:55 AM

Previous topic - Next topic

lly99

 :dazzled:

Entry 386:

Hello       EveryBody

xor   eax, eax
   mov   ax, cs
   shl   eax, 4
   add   eax, LABEL_SEG_CODE32
   mov   word [LABEL_DESC_CODE32 + 2], ax
   shr   eax, 16
   mov   byte [LABEL_DESC_CODE32 + 4], al
   mov   byte [LABEL_DESC_CODE32 + 7], ah


shl   eax, 4 ;(???????????  why?)
thanks

jj2007

xor   eax, eax       ; eax=0
mov   ax, cs         ; eax=cs
shl   eax, 4          ; eax=cs*16

lly99

Thank you very much!!!!  :bg

:U

Ian_B

Quote from: lly99 on April 05, 2008, 06:22:55 AM
xor   eax, eax
mov   ax, cs

If you are using this code yourself, this might be a simpler replacement:

movzx eax, cs


Regards.

lly99

Quote from: Ian_B on April 05, 2008, 11:22:39 AM
Quote from: lly99 on April 05, 2008, 06:22:55 AM
xor   eax, eax
mov   ax, cs

If you are using this code yourself, this might be a simpler replacement:

movzx eax, cs


Regards.

Yes        movzx eax, cs   ; zero fill :clap: