avra: rename AGAIN, to AGAIN?,

AGAIN, becomes a shortcut for "' RJMP AGAIN?,"
This commit is contained in:
Virgil Dupras 2020-05-19 10:36:07 -04:00
parent 7a41c5c6f9
commit ac309bbd9e
2 changed files with 13 additions and 13 deletions

View File

@ -10,6 +10,6 @@
( L1 FLBL, .. L1 ' RJMP FLBL! ) ( L1 FLBL, .. L1 ' RJMP FLBL! )
: FLBL, ( l -- ) LBL! 0 A,, ; : FLBL, ( l -- ) LBL! 0 A,, ;
: FLBL! ( l opw -- ) SWAP @ TO, ; : FLBL! ( l opw -- ) SWAP @ TO, ;
: BEGIN, PC ; : BEGIN, PC ; : AGAIN?, ( op ) SWAP 1- SWAP EXECUTE A,, ;
: AGAIN, ( op ) SWAP 1- SWAP EXECUTE A,, ; : AGAIN, ['] RJMP AGAIN?, ;
: IF, ['] BREQ SKIP, ; : THEN, TO, ; : IF, ['] BREQ SKIP, ; : THEN, TO, ;

View File

@ -210,7 +210,7 @@ BEGIN,
20 LSL, 20 LSL,
PORTB CP SBI, PORTB CP SBI,
16 DEC, 16 DEC,
' BRNE AGAIN, ( not zero yet? loop ) ' BRNE AGAIN?, ( not zero yet? loop )
( release PS/2 ) ( release PS/2 )
DDRB DATA CBI, DDRB DATA CBI,
SEI, SEI,
@ -239,7 +239,7 @@ L2 ' RCALL LBL, ( resetTimer )
BEGIN, BEGIN,
16 TIFR IN, 16 TIFR IN,
16 1 ( TOV0 ) SBRS, 16 1 ( TOV0 ) SBRS,
' RJMP AGAIN, AGAIN,
( Good, 100us passed. ) ( Good, 100us passed. )
( Pull Data low, that's our start bit. ) ( Pull Data low, that's our start bit. )
PORTB DATA CBI, PORTB DATA CBI,
@ -257,36 +257,36 @@ DDRB CLK CBI, ( Should be starting high now. )
BEGIN, BEGIN,
( Wait for CLK to go low ) ( Wait for CLK to go low )
BEGIN, PINB CLK SBIC, ' RJMP AGAIN, BEGIN, PINB CLK SBIC, AGAIN,
( set up DATA ) ( set up DATA )
PORTB DATA CBI, PORTB DATA CBI,
19 0 SBRC, ( skip if LSB is clear ) 19 0 SBRC, ( skip if LSB is clear )
PORTB DATA SBI, PORTB DATA SBI,
19 LSR, 19 LSR,
( Wait for CLK to go high ) ( Wait for CLK to go high )
BEGIN, PINB CLK SBIS, ' RJMP AGAIN, BEGIN, PINB CLK SBIS, AGAIN,
16 DEC, 16 DEC,
' BRNE AGAIN, ( not zero? loop ) ' BRNE AGAIN?, ( not zero? loop )
( Data was sent, CLK is high. Let's send parity ) ( Data was sent, CLK is high. Let's send parity )
19 1 MOV, ( recall saved value ) 19 1 MOV, ( recall saved value )
L6 FLBL, ( RCALL checkParity ) L6 FLBL, ( RCALL checkParity )
( Wait for CLK to go low ) ( Wait for CLK to go low )
BEGIN, PINB CLK SBIC, ' RJMP AGAIN, BEGIN, PINB CLK SBIC, AGAIN,
( set parity bit ) ( set parity bit )
PORTB DATA CBI, PORTB DATA CBI,
16 0 SBRC, ( parity bit in r16 ) 16 0 SBRC, ( parity bit in r16 )
PORTB DATA SBI, PORTB DATA SBI,
( Wait for CLK to go high ) ( Wait for CLK to go high )
BEGIN, PINB CLK SBIS, ' RJMP AGAIN, BEGIN, PINB CLK SBIS, AGAIN,
( Wait for CLK to go low ) ( Wait for CLK to go low )
BEGIN, PINB CLK SBIC, ' RJMP AGAIN, BEGIN, PINB CLK SBIC, AGAIN,
( We can now release the DATA line ) ( We can now release the DATA line )
DDRB DATA CBI, DDRB DATA CBI,
( Wait for DATA to go low, that's our ACK ) ( Wait for DATA to go low, that's our ACK )
BEGIN, PINB DATA SBIC, ' RJMP AGAIN, BEGIN, PINB DATA SBIC, AGAIN,
( Wait for CLK to go low ) ( Wait for CLK to go low )
BEGIN, PINB CLK SBIC, ' RJMP AGAIN, BEGIN, PINB CLK SBIC, AGAIN,
( We're finished! Enable INT0, reset timer, everything back to ( We're finished! Enable INT0, reset timer, everything back to
normal! ) normal! )
L2 ' RCALL LBL, ( resetTimer ) L2 ' RCALL LBL, ( resetTimer )
@ -320,6 +320,6 @@ BEGIN,
19 LSR, 19 LSR,
' BRCC SKIP, 16 INC, ( carry set? we had a 1 ) TO, ' BRCC SKIP, 16 INC, ( carry set? we had a 1 ) TO,
19 TST, ( is r19 zero yet? ) 19 TST, ( is r19 zero yet? )
' BRNE AGAIN, ( no? loop ) ' BRNE AGAIN?, ( no? loop )
16 0x1 ANDI, 16 0x1 ANDI,
RET, RET,