Hi,
Please help me to translate this to TASM code
and di, byte -0x20
thank u very much in advance.
os_ambition
Translate nasm code to Tasm
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Translate nasm code to Tasm
why in the world do you need to use TASM ??
I thought that assembler was obsolete for years ...
btw, if you *really* need it that hard, simply remove the "byte" information (TASM should be able to guess that you'll be happy with a one-byte constant automatically) ...
I thought that assembler was obsolete for years ...
btw, if you *really* need it that hard, simply remove the "byte" information (TASM should be able to guess that you'll be happy with a one-byte constant automatically) ...
Re:Translate nasm code to Tasm
what do you mean by -0x20, is this negative 20 hex? I need this value in tasm.
thank u again
thank u again
Re:Translate nasm code to Tasm
that should be the 2-s complement of 0x20, or (as a byte) 0xE0.os_ambition wrote: what do you mean by -0x20, is this negative 20 hex? I need this value in tasm.
thank u again
Re:Translate nasm code to Tasm
just try
if that doesn't work then try:
Code: Select all
and di, -20h
Code: Select all
mov ax, -20h
and di, ax
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Translate nasm code to Tasm
Hey, beware...Candy wrote: that should be the 2-s complement of 0x20, or (as a byte) 0xE0.
the byte thing means the argument should be encoded as a byte, but it will be expanded to a word ... now, iirc that expansion is signed.
In other word, we're using (cf p 3-31 of instruction set reference -- 24547107.pdf)
That means that the equivalent in TASM isopcode:"83 /4 ib" instruction:"AND r/m16, imm8" description:"r/m16 AND imm8 (sign-extended)"
Code: Select all
AND di, FFE0h
Code: Select all
AND di, E0h
Re:Translate nasm code to Tasm
thank u very very much Pype.clicker,
that's why I like TASM, it's simple and straight
that's why I like TASM, it's simple and straight