@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 @Alfred whats not to love about an 8bit processor that did 16bit operations and auto indexed. So underrated in its time.
Me. It was missing a lot that made writing assembly painful. The 6809 and even the 8080 were VAST improvements over the 6502 and the 6800. They just cost more.
The 8 bit stack made stack crashes inevitable as it walked over the data in the first page. Since there was no B register, 16 bit operations had to use the zero page or an index register — which was slower than a register op.
You had to CONSTANTLY juggle registers/zero page and their contents. This slowed code dev.
I’m not sure what you mean under appreciated at the time: I made a living writing code for it: from an interface to measure osteoporosis to adding one of the first hard drives to the Apple II. It was far more underpowered (in terms of registers) than the 6800 or the 8080. The main advantage at the time was cost. It was a cheaper processor.
In software at the time, register operations were cheap and fast. Memory operations were expensive and slow. 🤷🏻♀️
@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! 😄