This forum is the property of Proton software developers
Started by jmarkwolf, Nov 29, 2022, 12:25 AM
Quote from: jmarkwolf on Nov 29, 2022, 12:25 AMAny input gratefully received.
Dim wPin As WordInput PORTAOutput PORTBOutput PORTDMain: wPin = 1 << PORTA PORTB = wPin.Byte0 PORTD = wPin.Byte1
Dim wPin As WordInput PORTAOutput PORTBOutput PORTDMain: wPin = 1 << PORTA PORTD = 0 PORTB = wPin.Byte0 PORTD = wPin.Byte1
Quote from: jmarkwolf on Nov 29, 2022, 12:25 AMShould I implement a simple lookup table, or an On Goto construct, or....? Any input gratefully received.
QuoteTemp = PORTx & $F0 PORTx = Temp | variable or constant The above works as follows: - First we need to & (And), the higher nibble by masking the PORT with $F0 and place the value to a variable, i.e. as above, Temp. In this way we saved the state of the higher nibble. Then we | (Or), the Temp variable with another variable or a constant number. Note: - As we masked the higher nibble, the variable must not exceed the number 15, or binary %00001111. Then the resulting value with the masked PORT Or variable will be loaded to PORTx.