Current location - Trademark Inquiry Complete Network - Tian Tian Fund - WXJNB fund
WXJNB fund
The landlord is not clear about the concepts of two instructions: subroutine call instruction LCALL and jump instruction LJMP, JNB, etc. ;

1, LJMP, JNB and CJNE are all jump statements. After the jump, the program pointer PC points to the jump position, but it does not affect the value of SP stack.

2.LCALL, ACALL, etc Are subroutine call instructions. Before execution, the address (PC pointer) of the next instruction needs to be pushed onto the stack (2 bytes), so SP+2, and then the PC pointer moves to the position where the subroutine starts to execute; After the subroutine is executed, the PC pointer is restored to the next instruction of the CALL statement before the RET instruction is called, and SP-2 is also restored.

Because LCALL is used in many places in the program, but there is no RET return instruction in the corresponding subroutine body, SP is incremental, for example:

. . . . . . . . .

Tissue 30H

WXL:jnbp 2.5 SCL

LJMPWXL

SCL:lcally 1

JNBP2.5,WXL 100

There is something wrong with LCALLWXL. After the execution, SP+2, and then back to WXL above, and then back to this, SP will be +2 again, and it will never end.

. . . . . . . . . .

Because there are too many such mistakes, and I don't understand the software functions, I won't list them one by one. I suggest that the landlord tidy up his mind again.