I noticed right now that such basic function as
Rotate left|right
appears to be missing in mikroPascal PRO for PIC?
Do I really have to code that by hands? I cannot believe that this is really the case, I possibly only searched for th wrong name.
This is one of the instructions literally every microcontroller can do, and mikroPascal doesnÄt have it implemented?
Please, can you tell me the name of this command?
If it is really necessary to manually implement that, I would like to do this by a few assembly lines. But I never ever used assembly language within Mikropascal, so I need help her.
If I want to bitwise rotate a byte-var, how is the assembly code for that?
Code: Select all
var
bytevar ; byte;
function RolL( b: byte): byte;
begin
// Use some assembly on "b" to rotate it 1 bit to the left
// Highest bit becomes lowest bit hereby, all other bits shift left
asm
??? // No ideas what to do
end;
RESULT:=b; // Return the result
end;
How do I access the variable "b" from assembly at all?
What is the command for rotating the bits?
Thanks.