NOP slide Immunity-aware programming
with nop-fills, reliability of system in case of disturbed instruction pointer can improved in cases. entire program memory not used program code filled no-operation (nop) instructions. in machine code nop instruction represented 0x00 (for example, intel 8051, atmega16, etc.). system kept in defined state. @ end of physical program memory, instruction pointer error handling (ipeh ip-error-handler) has implemented. in cases can simple reset.
if instruction pointer error occurs during execution , program points memory segment filled nop instructions, inevitably error occurred , recognized.
three methods of implementing nop-fills applicable:
in first method, unused physical memory set 0x00 manually search , replace in (hex) program file. drawback of method has done after every compilation.
program memory filled code, nops, , error handler
the second method uses fill option of linker, fills unused memory regions predefined constant (in case 0x00).
the third way include corresponding number of nop assembler directives directly in program code.
when using codevisionavr c compiler, nop fills can implemented easily. chip programmer offers feature of editing program flash , eeprom fill specific value. using atmel atmega16, no jump reset address 0x00 needs implemented, overflow of instruction pointer automatically sets value 0x00. unfortunately, resets due overflow not equivalent intentional reset. during intended reset, necessary mc registers reset hardware, not done jump 0x00. method not applied in following tests.
memory before , after implementation of both function token , nop-fills
Comments
Post a Comment