From: Krogg
Subject: Re: pb3.5:asm shl di,6 why dont it werk?
Tech@SoftByteLabs.com wrote:
>
> On 1 Apr 1998 05:13:25 GMT, cornel@40th.com (Cornel Huth) wrote:
>
> >
> >Tech@SoftByteLabs.com? (Tech@SoftByteLabs.com?) wrote (Tue, 31 Mar 1998
17:54:21 GMT):
> >>SHL can only use 1 or CL
> >
> >Maybe in the compiler, but since 1984 and the '286 PC shl x,imm imm=1 to
1
> >has been allowed. 1984 -- only about 14 years ago.
>
> Yes, you're right, I should of been more specific. the compiler seems
> to ignore it so I suggested a quick fix.
I didnt see the post from Cornel but,Powerbasic only allows 8086 specfic
instructions(for inline asm) so it gives an error for shl ax,6 or what ever.
Ya got to use shl ax,cl for the instruction.Its not too comprimising.
I not an asm programmer by far but including inline asm into basic
can be a powerfull tool when speed is key or when there is a hole that only
asm can fill.
Here is a trick i just learned to overcome some of the limitations
of powerbasic's inline asm bieng only for 8086's.
Power basic likes you to preserve a some of the registers and
it can be troubling to figure out wich ones need to be saved
and push and pop them for a beginer like me.I found that 286's have
a pusha and popa instruction that pushes all the general registers
and pops them as well.Too bad powerbasic only uses 8086 instructions?
Nope,just use these equates,
%pusha =&h60
%popa =&h61
then use them like so,
asm dw %pusha
asm ;screw with the registers all ya want
asm dw %popa
I dont know all the values for the equates to make many other instructions,
but im sure they can be found some where.
Im sure all you more experienced assembly gurus allready know all kinds
of neat tricks like this but for me its still a sweet treat.
Anyhow,
--
THE
/\ \\ // /\
/ \ \\ // / \
/ /\/ /""""""\ \/\ \
/ / SEE HIS ( / \ \ SEE HIS \ \
\ \ FACE \/ \/ SMILE / /
\ \ / W \ / /
\ \ /\_|||||_/\ / /
/ \ // ||| \\ / \
/ /\ \ // ' \\ / /\ \
/ / / / \ \ \ \
\ \/ \_______________________/ \/ /
\_________________________________/
krogg.no.to.spam@inspace.net
Remove no.to.spam to reply
http://www.inspace.net/~carcher/krogg/aani.htm
Gory javascript animations for your enjoyment
*** QwkNews (tm) v2.1
* [TN71] Toast House Import
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|