0 Members and 2 Guests are viewing this topic.
;=======================;SendByte;Sends the contents of c;to anothe calculator;destroys; a; b; c;=======================SendByte: ld a,0 out (0),a ld b,%10101010 sla b ;8 rla ;4 sla c ;8 rla ;4 out (0),a ;11 ;xor a ;4 incase it turns out that bits 2-7 need to be 0 ;39 sla b rla sla c rla out (0),a ;xor a sla b rla sla c rla out (0),a ;xor a sla b rla sla c rla out (0),a ;xor a sla b rla sla c rla out (0),a ;xor a sla b rla sla c rla out (0),a ;xor a sla b rla sla c rla out (0),a ;xor a sla b rla sla c rla out (0),a ;xor a ;out (c),0;both lines high ret GetByte: ld c,2m1: in a,(0) ;11 cp c ;4 jr nc,m1 ;7/12 rra ;4 rr b ;8 ;34/39 m2: in a,(0) cp c jr c,m2 rra rr b m3: in a,(0) cp c jr nc,m3 rra rr b m4: in a,(0) cp c jr c,m4 rra rr b m5: in a,(0) cp c jr nc,m5 rra rr b m6: in a,(0) cp c jr c,m6 rra rr b m7: in a,(0) cp c jr nc,m7 rra rr b m8: in a,(0) cp c jr c,m8 rra rr b ret