'--------------------------------------------------------------------------------------------------------- 'INDR LMM. indr_lmm rdword hl_temp, h_reg rdword bc_temp, b_reg wrbyte bc_temp, io_port 'Set io_port from C shr bc_temp, #8 'bc_temp contains B alone :loop mov data_8, #io_cmd_in 'Set I/O command to IN... #ifdef TriBladeProp mov dira, ram_dir_input 'RR20090321 (pass I/O to another cog) #endif wrbyte data_8, io_command :wait rdbyte data_8, io_command wz '...and wait for it to be completed. if_nz sub lmm_pc, #(2*4) 'jmp #:wait 'in LMM #ifdef TriBladeProp mov dira, ram_dir_read 'Take I/O from another cog #endif rdbyte data_8, io_data mov address, hl_temp 'Write port data to memory at HL call #write_memory_byte sub hl_temp, #1 'Update HL reg sub bc_temp, #1 wz #ifdef TriBladeProp if_nz sub lmm_pc, #(12*4) #else if_nz sub lmm_pc, #(10*4) #endif wrword hl_temp, h_reg 'Update the registers wrbyte bc_temp, b_reg jmp #fetch '---------------------------------------------------------------------------------------------------------