摘要 |
PROBLEM TO BE SOLVED: To prevent a microcomputer from performing abnormal operations by detecting the generation of stack overflow due to collision between the stack area and a data area of a RAM built in the microcomputer. SOLUTION: In continuously securing a control variable for controlling equipment in the direction from the lowermost address to the upper address of the RAM built in the microcomputer 5 for controlling the equipment, a known value is written immediately after the uppermost address of the data area of the control variable. Alternatively, the uppermost address of the data area of the control variable stored in the RAM is retrieved from a mapping file and the known value is written immediately after the retrieved uppermost address. When a stack area continuously secured in the direction from the uppermost address of the RAM to the lower address grows in accordance with the execution of software and collides with the data area, the known value monitored in a prescribed period changes so that stack overflow can be detected. Alternatively, software for executing the retrieval of the uppermost address of the data area, the writing of the known value in the retrieved address and the detection of a change in the known value is previously prepared in compiling the execution software. |