JMPRET/PUSHZC/POPZC instruction notes. The JMPRET instruction in Prop2 has some slight differences to Prop1. This instruction now supports the WZ and WC effects. When a JMPRET (CALL) is assembled with WZ/WC the destination "RET" address which normally has a JMP PC+1 instruction also has the current Z and C states stored in the d-field. Instruction encodedd as: 000111_0001_1111_000000ZC_sssssssss 'ret ''sssssssss = pc+1 000111_1101_1111_000000ZC_sssssssss 'ret wz,wc To restore the flag states use WZ/WC in the "RET" instruction. Code example: call #app wz,wc 'z and c saved in app_ret d-field app 'do something here . . app_ret ret wz,wc 'z and c restored An alternative method of saving flags would be to use the PUSHZC/POPZC instructions. The PUSHZC/POPZC instructions rotate ZC states thru the source address as follows. PUSHZC rotates left x 2 thru source address. Z/C flags are only updated if WZ/WC effects are nominated. +-----------> Z flag ----+ | | | +-------> C flag ------+ | | | | WZ WC | | | | ^ ^ | | | | V V 31 30.................... 1 0 <----------------------- rotated left x2 POPZC rotates right x 2 thru source address Z/C flags are only updated if WZ/WC effects are nominated. +------------ Z flag <---+ | | | +-------- C flag <-----+ | | | | | | WZ WC | | ^ ^ | | | | V V | | 31 30.................... 1 0 -----------------------> rotated right x2 This would allow a 16 level flag stack to be implemented.