Chapter 12 List of Machine Language Instructions

12.3.5 Branching Instructions

CALL Subroutine

Mnemonic

Description of operation

 

 

 

label is either (d16,PC) or (d32,PC). Push the program counter containing the address

 

of the next instruction and necessary registers onto the stack, secure the necessary

CALL label

stack area, and branch to the specified address.

This instruction is used paired with either a RET or RETF instruction. This pair

 

 

provides high-speed saving and restoring of registers to and from the stack and the

 

securing and release of the stack area.

 

 

 

Push the program counter containing the address of the next instruction onto the stack

CALLS (An)

and branch to the specified address. This instruction is used paired with a RETS

instruction for table jumps and other situations where the registers to be saved and the

 

size of the stack area are not known and for situations requiring backward

 

compatibility with JSR.

 

 

 

label is either (d16,PC) or (d32,PC). Push the program counter onto the stack and

CALLS label

branch to the specified address. This instruction is used paired with a RETS

instruction for table jumps and other situations where the registers to be saved and the

 

size of the stack area are not known and for situations requiring backward

 

compatibility with JSR.

 

 

RET

Restore saved registers from the stack, free the stack area, and branch to the return

address saved on the stack. RET is used paired with CALL and the funcinfo directive.

 

 

 

RETF

Restore saved registers from the stack, free the stack area, and branch to the return

address stored in MDR. RETF is used paired with CALL and the funcinfo directive.

 

 

 

RETS

Branch to the return address saved on the stack. RETS is used paired with CALLS. It

is also used to maintain backward compatibility with RTS.

 

 

 

JSR (An)

Push the program counter containing the address of the next instruction onto the stack

and branch to the specified address.

 

 

 

JSR label

label is either (d16,PC) or (d32,PC). Push the program counter containing the address

of the next instruction onto the stack and branch to the specified address.

 

 

 

RTS

Branch to the return address saved on the stack.

RTS is used paired with JSR to maintain backward compatibility.

 

 

 

RTI

Return from an interrupt service routine.

Restore the PSW stored on the stack and branch to the return address saved on the

 

stack.

 

 

TRAP

Push the program counter containing the address of the next instruction onto the stack

and branch to the predefined address (0x40000010).

 

This instruction is used for system calls to the operating system and libraries.

 

 

List of Machine Language Instructions 243

Page 255
Image 255
Panasonic MN1030 user manual Branching Instructions, Call Subroutine