[A83] Re: Rotate 16 bits?


[Prev][Next][Index][Thread]

[A83] Re: Rotate 16 bits?



>Is there an instruction to rotate a sixteen-bit register, or do I have to 
>do something like rotate the low byte and high byte seperately, and then 
>increment the high byte if the low byte produced a carry? (rotating left)

You are correct sir (your second guess, that is).  Here's the best I can do 
off the top of my head.

     ;rotate HL 1 bit to the left
     SLA H
     RL  L
     JP  C, .skip
     L
.skip

>Along the same lines, is the ADC instruction the same as the x86, where you 
>add if carry, or is it different?

ADC will add the operand and the carry bit to the accumulator.

Stupid like a fox!
Look ma, I'm an artist: http://aaronstj.deviantart.com



_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail




Follow-Ups: