Download Manual - Phaedsys

Transcript
In the example above, a 16-bit (two -byte) memory at address 100h is verified to equal 0x55aa. By
using a mask of FFFFh, the entire word is verified.
verify_mem_u32(CPU32_SUPV_DATA_SPACE, 0x200, 1<<27, 1<<27);
In the example above, bit 27 of a 32-bit (four-byte) memory location at address 200h is verified to
be set. All other bits except bit 27 are ignored.
Write Register Script Commands
Write register script commands provide the mechanism for changing the values of the target
registers. The first argument is a register-enumerated type with a definition that depends on the
specific target and register width on which the script command is acting. The second argument is
the value to which the register will be set.
write_reg4(U4, enum REGISTERS_U4);
write_reg8(U8, enum REGISTERS_U8);
write_reg16(U16, enum REGISTERS_U16);
write_reg32(U32, enum REGISTERS_U32);
write_reg64(U64, enum REGISTERS_U64);
The following example modifies register values of a CPU16 target.
write_reg4(0x12, REG_ZK);
write_reg16(0x5557, REG_PC);
In the example above, a script file, which is acting on a CPU16 target, writes 12 hexadecimal to the
index register Z's address extension register and writes 5557 hexadecimal to the program counter.
Verify Register Script Commands
Verify register script commands provide the mechanism for verifying the values of the target
registers. The first argument is a register-enumerated type with a definition that depends on the
specific target and register width on which the script command is acting. The second argument is
the value against which the register will be verified.
verify_reg1(enum REGISTERS_U1, U1);
verify_reg4(enum REGISTERS_U4, U4);
verify_reg5(enum REGISTERS_U5, U5);
verify_reg8(enum REGISTERS_U8, U8);
verify_reg16(enum REGISTERS_U16, U16);
verify_reg24(enum REGISTERS_U24, U24);
verify_reg32(enum REGISTERS_U32, U32);
verify_reg64(enum REGISTERS_U64, U64);
The following example verifies register values of a CPU16 target.
verify_reg4(REG_ZK, 0x12);
verify_reg16(REG_PC, 0x5557);
In the example above, a script file, which is acting on a CPU16 target, verifies that the index register
Z's address extension register is equal to 12 hexadecimal and verifies that the program counter is
equal to 5557 hexadecimal. If either of these conditions fails to verify, a script failure message is
generated and the target's script failure count is incremented.
Write Symbol Value Script Command
Write symbol value script commands provide the mechanism for writing the values of symbolic data
for both variables as well as strings. Symbols are variables and strings defined within the user's
34