comparison level1/modules/dwread.asm @ 2773:ce3dba57003b lwtools-port

boot_dw now uses dwinit.asm. dwinit.asm updated for Arduino
author Boisy Pitre <boisy.pitre@nuance.com>
date Wed, 23 Jan 2013 14:54:29 -0600
parents bfe3de781ddf
children 28ed72477814
comparison
equal deleted inserted replaced
2770:bfe3de781ddf 2773:ce3dba57003b
18 * 18 *
19 19
20 IFNE ARDUINO 20 IFNE ARDUINO
21 * Note: this is an optimistic routine. It presumes that the server will always be there, and 21 * Note: this is an optimistic routine. It presumes that the server will always be there, and
22 * has NO timeout fallback. It is also very short and quick. 22 * has NO timeout fallback. It is also very short and quick.
23 DWRead clra ; clear Carry (no framing error) 23 DWRead clra ; clear Carry (no framing error)
24 pshs u,x,cc ; preserve registers 24 pshs u,x,cc ; preserve registers
25 leau ,x 25 leau ,x
26 ldx #$0000 26 ldx #$0000
27 loop@ tst $FF51 ; check for CA1 bit (1=Arduino has byte ready) 27 loop@ tst $FF51 ; check for CA1 bit (1=Arduino has byte ready)
28 bpl loop@ ; loop if not set 28 bpl loop@ ; loop if not set
29 ldb $FF50 ; clear CA1 bit in status register 29 ldb $FF50 ; clear CA1 bit in status register
30 stb ,u+ ; save off acquired byte 30 stb ,u+ ; save off acquired byte
31 abx ; update checksum 31 abx ; update checksum
32 leay ,-y 32 leay ,-y
33 bne loop@ 33 bne loop@
34 34 leay ,x ; return checksum in Y
35 leay ,x ; return checksum in Y 35 puls cc,x,u,pc ; restore registers and return
36 puls cc,x,u,pc ; restore registers and return
37 36
38 ELSE 37 ELSE
39 38
40 IFNE JMCPBCK 39 IFNE JMCPBCK
41 * NOTE: There is no timeout currently on here... 40 * NOTE: There is no timeout currently on here...