[ASM] a problem with shl and nasm
Posted: Sat Apr 23, 2011 11:22 am
I am trying to shift a number in AX by a value stored at [ds:218h], but I keep getting an "invalid combination of opcode and operands" error. For the life of me, I can't figure out what the type of the second parameter should be. It works with constant values, so this works:
shl ax,4
but with registers, and memory locations it doesn't. Both of these cause the above error:
shl ax,bl
shl ax,byte[ds:218h]
Also, in an attempt to figure out the type that this should be, I tried the following:
shl ax,byte[4]
shl ax,word[4]
shl ax,dword[4]
All of them had the same effect as using a register, which doesn't make any sense. Those are the only three types it can be, unless i'm misusing the byte[],word[],dword[] operators. Which is very possible. I am just dabbling with boot loaders and such, and don't have tons of experience in assembly.
I would assume the value should be 8bit since ax is 16bit, which means there are only 16 needed values for the second parameter.
if someone could shoot me a link to the shl command specs, or lemme know what i'm doing wrong (probably multiple things ) that would be great, thanks.
shl ax,4
but with registers, and memory locations it doesn't. Both of these cause the above error:
shl ax,bl
shl ax,byte[ds:218h]
Also, in an attempt to figure out the type that this should be, I tried the following:
shl ax,byte[4]
shl ax,word[4]
shl ax,dword[4]
All of them had the same effect as using a register, which doesn't make any sense. Those are the only three types it can be, unless i'm misusing the byte[],word[],dword[] operators. Which is very possible. I am just dabbling with boot loaders and such, and don't have tons of experience in assembly.
I would assume the value should be 8bit since ax is 16bit, which means there are only 16 needed values for the second parameter.
if someone could shoot me a link to the shl command specs, or lemme know what i'm doing wrong (probably multiple things ) that would be great, thanks.