fromserial res 1 ; from-serial buffer location (in buffer bank)
totrack equ FSR2L ; to-track buffer location (in buffer bank)
totrackbit res 1 ; bit location of pointer within byte
+lasttelldone res 1 ; last nmra msg we've told host we've finished
;
; buffers are each 16 bytes (this is hardwired)
; and there are four of them starting at 0x500, 0x510, 0x520, 0x530.
; being transmitted; if nothing is currently being transmitted
; because there is no nmra data at all then totrack points to the
; start of the same buffer as fromserial
+ ;
+ ; lasttelldone points to the last buffer whose complete transmission
+ ; we've reported to the host.
+ ;
+ ; We maintain the following properties, notionally:
+ ;
+ ; lasttelldone <= totrack <= fromserial < lasttelldone
+ ;
+ ; / \
+ ; ' `- equal if we have nothing but
+ ; equal if we have idle to trasmit
+ ; told the host about our
+ ; current buffer state
+ ;
bufferpage equ 5