- TI83+ ASM Transfer Protocol
- 28 Nov 2010 09:28:52 pm
- Last edited by Anakclusmos on 01 Dec 2010 01:10:52 pm; edited 1 time in total
From what I'e heard, this is my best attempt at writing a routine to recieve a byte from the link port.Please tell me if there are any mistakes.I barely understand any of the ring pull stuff.This is my best try.
Code:
Code:
RecieveAByte:
ld b,8 ;we need to recieve 8 bits
ld c,0
rab_loop:
xor a
out (0),a ;set the lines low to init transfer
in a,(0)
bit 0,a ;check if we recieved a 0
jr nz,rab_not0 ;if not, check the second line
xor a
rra
rl c ;roll a 0 into C
djnz rab_loop
ld a,c
ret
rab_not0:
bit 1,a ;check if we recieved a 1
ret nz ;return if both lines are high
ld a,1
rra
rl c ;roll a 1 into C
djnz rab_loop
ld a,c
ret