PASM SubRoutines
bsilvereagle
Posts: 6
I am trying to create a PASM subroutine for the following block of code:
When the code is implemented like below, when using pPropllerSim the value of "data_byte" changes to 3 (0b0010):
However, when the below code is ran, "data_byte" does not change
Any help would be appreciated.
IF_NZ AND input, #10 IF_NZ SHR input, #1 IF_NZ ADD data_byte, input IF_NZ SHL data_byte, #1
When the code is implemented like below, when using pPropllerSim the value of "data_byte" changes to 3 (0b0010):
SPI_READ MOV input, #11 'MOV input, ina TEST input, #01, wz 'Sets wz to 1 if clock is 0 IF_NZ AND input, #10 IF_NZ SHR input, #1 IF_NZ ADD data_byte, input IF_NZ SHL data_byte, #1
However, when the below code is ran, "data_byte" does not change
SPI_READ MOV input, #11 'MOV input, ina TEST input, #01, wz 'Sets wz to 1 if clock is 0 IF_NZ call #READ_MOSI jmp #FINISH READ_MOSI AND input, #10 SHR input, #1 ADD data_byte, input SHL data_byte, #1 READ_MOSI_ret ret FINISH jmp #FINISH input long 0 data_byte long 0
Any help would be appreciated.
Comments
I suppose I should test on real hardware :P
Thanks kuroneko & Mike.