Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ emulate_branch(3) — OSF/1 1.0 (TIN) MIPS

Media Vault

Software Library

Restoration Projects

Artifacts Sought

emulate_branch(3)  —  Subroutines

Digital

NAME

emulate_branch − MIPS branch emulation

SYNOPSIS

#include <signal.h>

emulate_branch(scp, branch_instruction)
struct sigcontext ∗scp;
unsigned long branch_instruction;

DESCRIPTION

emulate_branch is passed a signal context structure and a branch instruction.  It emulates the branch based on the register values in the signal context structure.  It modifies the value of the program counter in the signal context structure (sc_pc) to the target of the branch instruction. The program counter must initially be pointing at the branch and the register values must be those at the time of the branch. If the branch is not taken the program counter is advanced to point to the instruction after the delay slot (sc_pc += 8). 

In the case the branch instruction is a branch on coprocessor 2 or 3 instruction emulate_branch can’t emulate or execute the branch currently. 

RETURN VALUE

emulate_branch returns a 0 if the branch was emulated successfully. An non-zero value indicates the value passed as a branch instruction was not a branch instruction. 

REALTED INFORMATION

signal(2), sigset(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026