⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.mil

📁 Firmware that controls a sliding door via a GSM modem (Open and Close the door)
💻 MIL
📖 第 1 页 / 共 3 页
字号:
_clear_message_buffers:
  begin
//main.c,42 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,43 :: 		while (byte_count1 < 77)
L_clear_message_buffers_0:
	if ( _byte_count1 >= 77) then goto L_clear_message_buffers_1
//main.c,45 :: 		message_buffer[byte_count1] = 0;
	STACK_0 <-  0 + _byte_count1
	*STACK_0 <- 0
//main.c,46 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,47 :: 		}
	goto	L_clear_message_buffers_0
L_clear_message_buffers_1:
  end

_clear_code_locations:
  begin
//main.c,51 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,52 :: 		while (byte_count1 < 6)
L_clear_code_locations_2:
	if ( _byte_count1 >= 6) then goto L_clear_code_locations_3
//main.c,54 :: 		password[byte_count1] = 0;
	STACK_0 <-  0 + _byte_count1
	*STACK_0 <- 0
//main.c,55 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,56 :: 		}
	goto	L_clear_code_locations_2
L_clear_code_locations_3:
//main.c,57 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,58 :: 		while (byte_count1 < 6)
L_clear_code_locations_4:
	if ( _byte_count1 >= 6) then goto L_clear_code_locations_5
//main.c,60 :: 		temp_password[byte_count1] = 0xff;
	STACK_0 <-  0 + _byte_count1
	*STACK_0 <- 255
//main.c,61 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,62 :: 		}
	goto	L_clear_code_locations_4
L_clear_code_locations_5:
  end

_Delay1s:
  begin
//main.c,67 :: 		Delay_ms(250);
	asm: MOVLW	2
	asm: MOVWF	STACK_12
	asm: MOVLW	255
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_12,F
	asm: GOTO	$+2
	asm: GOTO	$+8
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: GOTO	$-9
	asm: MOVLW	70
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: MOVLW	207
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: nop
//main.c,68 :: 		Delay_ms(250);
	asm: MOVLW	2
	asm: MOVWF	STACK_12
	asm: MOVLW	255
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_12,F
	asm: GOTO	$+2
	asm: GOTO	$+8
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: GOTO	$-9
	asm: MOVLW	70
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: MOVLW	207
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: nop
//main.c,69 :: 		Delay_ms(250);
	asm: MOVLW	2
	asm: MOVWF	STACK_12
	asm: MOVLW	255
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_12,F
	asm: GOTO	$+2
	asm: GOTO	$+8
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: GOTO	$-9
	asm: MOVLW	70
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: MOVLW	207
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: nop
//main.c,70 :: 		Delay_ms(250);
	asm: MOVLW	2
	asm: MOVWF	STACK_12
	asm: MOVLW	255
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_12,F
	asm: GOTO	$+2
	asm: GOTO	$+8
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: GOTO	$-9
	asm: MOVLW	70
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: MOVLW	207
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: nop
  end

_Delay250ms:
  begin
//main.c,75 :: 		Delay_ms(250);
	asm: MOVLW	2
	asm: MOVWF	STACK_12
	asm: MOVLW	255
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_12,F
	asm: GOTO	$+2
	asm: GOTO	$+8
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: GOTO	$-9
	asm: MOVLW	70
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: MOVLW	207
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: nop
  end

_recieve_message:
  begin
//main.c,80 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,81 :: 		time_count = 0;
	_time_count <- 0
//main.c,82 :: 		while (byte_count1 < message_length && time_count < 1250)
L_recieve_message_6:
	if ( _byte_count1 >= FARG_recieve_message+0) then goto L_recieve_message_7
	if ( _time_count >= 1250) then goto L_recieve_message_7
L203_ex_L_recieve_message_7:
//main.c,84 :: 		if (PIR1.RCIF)
	if (!PIR1) then goto L_recieve_message_10
//main.c,86 :: 		message_buffer[byte_count1] = Usart_Read();
	FLOC_recieve_message+0 <-  0 + _byte_count1
	CALL _Usart_Read
	*FLOC_recieve_message+0 <- STACK_0
//main.c,87 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,88 :: 		time_count = 0;
	_time_count <- 0
//main.c,89 :: 		}
L_recieve_message_10:
//main.c,90 :: 		time_count++;
	_time_count <-  _time_count + 1
	_time_count <- _time_count
//main.c,91 :: 		}
	goto	L_recieve_message_6
L_recieve_message_7:
  end

_transfer_senders_number:
  begin
//main.c,97 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,98 :: 		byte_count2 = 9;
	_byte_count2 <- 9
//main.c,99 :: 		while (byte_count1 < 13)
L_transfer_senders_number_11:
	if ( _byte_count1 >= 13) then goto L_transfer_senders_number_12
//main.c,101 :: 		senders_number[byte_count1] = message_buffer[byte_count2];
	STACK_1 <-  0 + _byte_count1
	FSR <-  0 + _byte_count2
	STACK_0 <- *FSR
	*STACK_1 <- STACK_0
//main.c,103 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,104 :: 		byte_count2++;
	_byte_count2 <-  _byte_count2 + 1
	_byte_count2 <- _byte_count2
//main.c,105 :: 		}
	goto	L_transfer_senders_number_11
L_transfer_senders_number_12:
  end

_transfer_sent_password:
  begin
//main.c,111 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,112 :: 		byte_count2 = 49;
	_byte_count2 <- 49
//main.c,113 :: 		while (byte_count1 < 6)
L_transfer_sent_password_13:
	if ( _byte_count1 >= 6) then goto L_transfer_sent_password_14
//main.c,115 :: 		temp_password[byte_count1] = message_buffer[byte_count2];
	STACK_1 <-  0 + _byte_count1
	FSR <-  0 + _byte_count2
	STACK_0 <- *FSR
	*STACK_1 <- STACK_0
//main.c,117 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,118 :: 		byte_count2++;
	_byte_count2 <-  _byte_count2 + 1
	_byte_count2 <- _byte_count2
//main.c,119 :: 		}
	goto	L_transfer_sent_password_13
L_transfer_sent_password_14:
  end

_setup_reply_message:
  begin
//main.c,124 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,125 :: 		while (byte_count1 < 8)
L_setup_reply_message_15:
	if ( _byte_count1 >= 8) then goto L_setup_reply_message_16
//main.c,127 :: 		Usart_Write(send_message_header[byte_count1]);
	STACK_0 <-  0 + _byte_count1
	FARG_Usart_Write+0 <- *STACK_0
	FARG_Usart_Write+0 <- FARG_Usart_Write+0
	CALL _Usart_Write
//main.c,128 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,129 :: 		}
	goto	L_setup_reply_message_15
L_setup_reply_message_16:
//main.c,130 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,131 :: 		while (byte_count1 < 13)
L_setup_reply_message_17:
	if ( _byte_count1 >= 13) then goto L_setup_reply_message_18
//main.c,133 :: 		Usart_Write(senders_number[byte_count1]);
	FSR <-  0 + _byte_count1
	FARG_Usart_Write+0 <- *FSR
	FARG_Usart_Write+0 <- FARG_Usart_Write+0
	CALL _Usart_Write
//main.c,134 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,135 :: 		}
	goto	L_setup_reply_message_17
L_setup_reply_message_18:
//main.c,136 :: 		Usart_Write (carriage_return);
	FARG_Usart_Write+0 <- 13
	CALL _Usart_Write
//main.c,137 :: 		while (buffer != '>') buffer = Usart_Read();
L_setup_reply_message_19:
	if ( _buffer = 62) then goto L_setup_reply_message_20
	CALL _Usart_Read
	_buffer <- STACK_0
	goto	L_setup_reply_message_19
L_setup_reply_message_20:
//main.c,138 :: 		while (buffer != ' ') buffer = Usart_Read();
L_setup_reply_message_21:
	if ( _buffer = 32) then goto L_setup_reply_message_22
	CALL _Usart_Read
	_buffer <- STACK_0
	goto	L_setup_reply_message_21
L_setup_reply_message_22:
  end

_send_open_message:
  begin
//main.c,143 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,144 :: 		while (byte_count1 < 10)
L_send_open_message_23:
	if ( _byte_count1 >= 10) then goto L_send_open_message_24
//main.c,146 :: 		Usart_Write(open_door_text[byte_count1]);
	STACK_0 <-  0 + _byte_count1
	FARG_Usart_Write+0 <- *STACK_0
	FARG_Usart_Write+0 <- FARG_Usart_Write+0
	CALL _Usart_Write
//main.c,147 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,148 :: 		}
	goto	L_send_open_message_23
L_send_open_message_24:
//main.c,149 :: 		Usart_Write (carriage_return);
	FARG_Usart_Write+0 <- 13
	CALL _Usart_Write
  end

_send_close_message:
  begin
//main.c,154 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,155 :: 		while (byte_count1 < 12)
L_send_close_message_25:
	if ( _byte_count1 >= 12) then goto L_send_close_message_26
//main.c,157 :: 		Usart_Write(close_door_text[byte_count1]);
	STACK_0 <-  0 + _byte_count1
	FARG_Usart_Write+0 <- *STACK_0
	FARG_Usart_Write+0 <- FARG_Usart_Write+0
	CALL _Usart_Write
//main.c,158 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,159 :: 		}
	goto	L_send_close_message_25
L_send_close_message_26:
//main.c,160 :: 		Usart_Write (carriage_return);
	FARG_Usart_Write+0 <- 13
	CALL _Usart_Write
  end

_send_already_open_message:
  begin
//main.c,165 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,166 :: 		while (byte_count1 < 20)
L_send_already_open_message_27:
	if ( _byte_count1 >= 20) then goto L_send_already_open_message_28
//main.c,168 :: 		Usart_Write(already_opened_text[byte_count1]);
	STACK_0 <-  0 + _byte_count1
	FARG_Usart_Write+0 <- *STACK_0
	FARG_Usart_Write+0 <- FARG_Usart_Write+0
	CALL _Usart_Write
//main.c,169 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,170 :: 		}
	goto	L_send_already_open_message_27
L_send_already_open_message_28:
//main.c,171 :: 		Usart_Write (carriage_return);
	FARG_Usart_Write+0 <- 13
	CALL _Usart_Write
  end

_send_already_closed_message:
  begin
//main.c,176 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,177 :: 		while (byte_count1 < 20)
L_send_already_closed_message_29:
	if ( _byte_count1 >= 20) then goto L_send_already_closed_message_30
//main.c,179 :: 		Usart_Write(already_closed_text[byte_count1]);
	STACK_0 <-  0 + _byte_count1
	FARG_Usart_Write+0 <- *STACK_0
	FARG_Usart_Write+0 <- FARG_Usart_Write+0
	CALL _Usart_Write
//main.c,180 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,181 :: 		}
	goto	L_send_already_closed_message_29
L_send_already_closed_message_30:
//main.c,182 :: 		Usart_Write (carriage_return);
	FARG_Usart_Write+0 <- 13
	CALL _Usart_Write
  end

_wait_acknowledgement:
  begin
//main.c,187 :: 		while (buffer != line_feed)
L_wait_acknowledgement_31:
	if ( _buffer = 10) then goto L_wait_acknowledgement_32
//main.c,189 :: 		if (PIR1.RCIF) buffer = Usart_Read();
	if (!PIR1) then goto L_wait_acknowledgement_33
	CALL _Usart_Read
	_buffer <- STACK_0
L_wait_acknowledgement_33:
//main.c,190 :: 		}
	goto	L_wait_acknowledgement_31
L_wait_acknowledgement_32:
//main.c,191 :: 		while (buffer != carriage_return)
L_wait_acknowledgement_34:
	if ( _buffer = 13) then goto L_wait_acknowledgement_35
//main.c,193 :: 		if (PIR1.RCIF) buffer = Usart_Read();
	if (!PIR1) then goto L_wait_acknowledgement_36
	CALL _Usart_Read
	_buffer <- STACK_0
L_wait_acknowledgement_36:
//main.c,194 :: 		}
	goto	L_wait_acknowledgement_34
L_wait_acknowledgement_35:
//main.c,195 :: 		Delay250ms();//
	CALL _Delay250ms
  end

_gsm_modem_init:
  begin
//main.c,200 :: 		do {
L_gsm_modem_init_37:
//main.c,201 :: 		byte_count1 = 0;
	_byte_count1 <- 0
//main.c,202 :: 		TXREG = settings[0];
	TXREG <- 65
//main.c,203 :: 		while (byte_count1 < 18)
L_gsm_modem_init_39:
	if ( _byte_count1 >= 18) then goto L_gsm_modem_init_40
//main.c,205 :: 		if (PIR1.TXIF)
	if (!PIR1) then goto L_gsm_modem_init_41
//main.c,207 :: 		byte_count1++;
	_byte_count1 <-  _byte_count1 + 1
	_byte_count1 <- _byte_count1
//main.c,208 :: 		TXREG = settings[byte_count1];
	STACK_0 <-  0 + _byte_count1
	TXREG <- *STACK_0
	TXREG <- TXREG
//main.c,209 :: 		}
L_gsm_modem_init_41:
//main.c,210 :: 		}
	goto	L_gsm_modem_init_39
L_gsm_modem_init_40:
//main.c,211 :: 		time_count = 0;
	_time_count <- 0
//main.c,212 :: 		while (buffer != 'O' && time_count < 6250)
L_gsm_modem_init_42:
	if ( _buffer = 79) then goto L_gsm_modem_init_43
	if ( _time_count >= 6250) then goto L_gsm_modem_init_43
L387_ex_L_gsm_modem_init_43:
//main.c,214 :: 		if (PIR1.RCIF)
	if (!PIR1) then goto L_gsm_modem_init_46
//main.c,216 :: 		buffer = RCREG;
	_buffer <- RCREG
//main.c,217 :: 		time_count = 0;
	_time_count <- 0
//main.c,218 :: 		}
L_gsm_modem_init_46:
//main.c,219 :: 		time_count++;
	_time_count <-  _time_count + 1
	_time_count <- _time_count
//main.c,220 :: 		}
	goto	L_gsm_modem_init_42
L_gsm_modem_init_43:
//main.c,221 :: 		}while (buffer != 'O');
	if ( _buffer != 79) then goto L_gsm_modem_init_37
L_gsm_modem_init_38:
//main.c,222 :: 		while(buffer != line_feed) buffer = RCREG;
L_gsm_modem_init_47:
	if ( _buffer = 10) then goto L_gsm_modem_init_48
	_buffer <- RCREG
	goto	L_gsm_modem_init_47
L_gsm_modem_init_48:
  end

_read_keypad:
  begin
//main.c,229 :: 		data = 0;
	read_keypad_data_L0 <- 0
//main.c,230 :: 		column1 = 1;
	PORTC <-  PORTC | 16
//main.c,231 :: 		if (row1)
	if (!PORTD) then goto L_read_keypad_49
//main.c,233 :: 		Delay250ms();
	CALL _Delay250ms
//main.c,234 :: 		data = '1';
	read_keypad_data_L0 <- 49
//main.c,235 :: 		}
L_read_keypad_49:
//main.c,236 :: 		if (row2)
	if (!PORTD) then goto L_read_keypad_50
//main.c,238 :: 		Delay250ms();
	CALL _Delay250ms
//main.c,239 :: 		data = '4';
	read_keypad_data_L0 <- 52
//main.c,240 :: 		}
L_read_keypad_50:
//main.c,241 :: 		if (row3)
	if (!PORTD) then goto L_read_keypad_51
//main.c,243 :: 		Delay250ms();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -