The program i'm coding can only use 286 instruction sets and the problem is that i can not use something like this to multiply a value by 10

ADD BX , BX

LEA BX ,

i am using TASM. can anybody help?

ADD BX , BX

LEA BX ,

i am using TASM. can anybody help?

How about this? 10x = 8x + 2x

So,

Viola! ax = ax * 10

Does that help?

So,

ax contains original value

mov bx,ax

shl ax,3 ;don't remember if 286 allows this, if not just use three shl ax,1

shl bx,1

add ax,bx

Viola! ax = ax * 10

Does that help?

ax contains original value

mov bx,ax

shl ax,3 ;don't remember if 286 allows this, if not just use three shl ax,1

shl bx,1

add ax,bx

you can do:

`mov cl, 3`

mov bx,ax

shl ax,cl

shl bx,1

add ax,bx

shifting by cl is allowed on 286 (iirc)

The 286 can indeed shift by CL. So can the 8086/8088 !

I have a very limited amount of registers to use right now. CX is already being used as a counter and i dont think pushing and poping is a good idea. but i guess i have to use a local variable for the counter at least so that the CX will be free again. thanks guys i appreciate your help

SAL is also an option.

Paul

Paul

SAL is also an option.

Paul

SAL and SHL are the same thing. The is a difference between SHR and SAR, only.

From Intel's manuals, Volume 1, chapter 7.3.6.1:

The SAL and SHL instructions perform the same operation(...)