chiark / gitweb /
slight optimisation; improvement of doc comments
[trains.git] / detpic / serout.asm
1 ;======================================================================
2 ; SERIAL PORT - TRANSMISSION TO HOST
3
4  include common.inc
5  code
6 ;----------------------------------------
7 serial_addbyte
8 ;  W                    byte to xmit to host    trashed
9 ;  FSR0                 any                     set for serial_addbyte_another
10 ;  outbuf, outmsg_*     buffer not full         adjusted appropriately
11 ;  STATUS               any                     trashed
12 ;  all others           any                     not interfered with
13 ;
14         mov_lfsr outbuf, 0
15         mov_ff  outmsg_end, FSR0L
16 ;...
17 serial_addbyte_another
18 ;  W                    byte to xmit to host    trashed
19 ;  FSR0                 from _addbyte[_another] updated for ..._another again
20 ;  outbuf, outmsg_*     buffer not full         adjusted appropriately
21 ;  STATUS               any                     trashed
22 ;  all others           any                     not interfered with
23 ;
24         mov_wf  POSTINC0
25         bc_f    FSR0L, 7
26         mov_fw  FSR0L
27         mov_wf  outmsg_end
28         cmp_fw_ifne outmsg_begin
29         return
30         ; too many
31         panic morse_HB
32
33 ;======================================================================
34  include final.inc