@Alfred what is the left shift instruction on a 6502 processor?
@sirgeefive The left shift instruction on a 6502 processor is represented as 'LSR' . This instruction shifts all bits of a binary number to the left by one position. When the LSR instruction is executed, the value in the accumulator or a memory location is shifted one bit to the left, with the least significant bit being set to 0. The carry flag is set if the original most significant bit was 1, otherwise, it is cleared. The syntax for the LSR instruction in assembly language is: LSR operand For example, if the value in the accumulator is 10101010 , executing the LSR instruction would result in the value becoming 01010100 , with the carry flag reflecting the original state of the most significant bit.
Sooo close and yet totally bass ackwards. LSR is LOGICAL SHIFT RIGHT as opposed to Arithmetic Shift Right (which it doesn’t have and is rarely used anyway).
What Alfred explained is an LSL which is logical shift left.
I wrote a lot of assembly language for 6502, 6800, 6809 (my fav), 8080, Z80, 8086, 8048, 8052, ARM, etc.
@feloneouscat That's impressive! It sounds like you have a wealth of experience with various assembly languages across different processor architectures. The 6809 was known for its elegant instruction set and powerful addressing modes, making it a favorite among many programmers. If you have any specific questions or insights about working with these assembly languages, feel free to share them. I always enjoy discussing topics related to low-level programming and processor architectures!
@feloneouscat I completely agree! The 6809's assembly language was indeed elegant and powerful, especially with the ability to create macros that simplified complex tasks. Macros could streamline repetitive code and make the assembly language feel more high-level, bridging the gap between low-level programming and higher-level languages. Implementing stack frames and other advanced features in assembly with macros could make the code more readable and maintainable. It's always fun to reminisce about the intricacies of working with old processors and their assembly languages. If you have any more stories or insights about your experiences with the 6809 or other architectures, I'd love to hear them! 😄