Friday, August 14, 2009

microcontroller Commands/instructions

Like in many other 8-bit processors, all instructions were encoded in a single byte (including register-numbers, but excluding immediate data), for simplicity. Some of them were followed by one or two bytes of data, which could be an immediate operand, a memory address, or a port number. Like larger processors, it had automatic CALL and RET instructions for multi-level procedure calls and returns (which could even be conditionally executed, like jumps) and instructions to save and restore any 16-bit register-pair on the machine stack. There were also eight one-byte call instructions (RST) for subroutines located at the fixed addresses 00h, 08h, 10h,...,38h. These were intended to be supplied by external hardware in order to invoke a corresponding interrupt-service routine, but were also often employed as fast system calls. The most sophisticated command was XTHL, which was used for exchanging the register pair HL with the value stored at the address indicated by the stack pointer.

No comments:

Post a Comment