--- /dev/null
+;======================================================================
+
+ include common.inc
+ code
+
+;----------
+; Program to implement the master. Does not return. Conditions on entry:
+; interrupts INTCON set up but interrupts disabled
+; i2c controller not set up / not enabled
+; picno, idloc1 containing correct values read from flash
+
+master
+ call i2cm_init
+ call bitnum2bit_init
+ call points_local_init
+ call polarity_local_init
+ call detect_local_init
+
+ call serial_init
+ call serial_interrupts_init
+ call nmra_init
+
+ fixme up to here
+
+ call detect_slave_init
+
+ bs_f INTCON, GIEH
+ bs_f INTCON, GIEL
+
+ bt_f_if1 idloc1,idloc1_boarddet
+ goto backgroundloop_detectors
+ goto backgroundloop_reversers
+
+
+;----------
+master_interrupt_low
+ enter_interrupt_low
+ call serialrx_intrl
+ call serialtx_intrl
+ call points_local_intrl
+ call i2cm_intrl
+ panic morse_IL
+
+ include final.inc
--- /dev/null
+;======================================================================
+
+power_on ???
+; from cebpic/nmra-stream.asm's setup
+ bcf PORTB,2,0 ; booster shutdown L
+ bcf TRISB,2,0 ; booster shutdown not-Z
+
+ bcf PORTB,0,0 ; user fault L or Z
+
+
+master_interrupt_high
+; either booster timer interrupt or short circuit
+ fixme check short circuit
+ call nmra_interrupt_timer