Ejemplo n.º 1
0
"""
This module provides the B-format B.MI instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if proc.N:
        proc.reg["PC"].set(proc.labels[BR_address])


B_MI = B(97, operation)
Ejemplo n.º 2
0
"""
This module provides the B-format B.LT instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.N == proc.V:
        proc.reg["PC"].set(proc.labels[BR_address])


B_LT = B(97, operation)
Ejemplo n.º 3
0
"""
This module provides the B-format B.LS instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not (proc.C and (not proc.Z)):
        proc.reg["PC"].set(proc.labels[BR_address])


B_LS = B(97, operation)
Ejemplo n.º 4
0
"""
This module provides the B-format B.GT instruction
"""
from armv8_isa import B

#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if (not proc.Z) and (proc.N==proc.V):
        proc.reg["PC"].set(proc.labels[BR_address])

B_GT = B(97, operation)
Ejemplo n.º 5
0
"""
This module provides the B-format B.VS instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if proc.V:
        proc.reg["PC"].set(proc.labels[BR_address])


B_VS = B(97, operation)
Ejemplo n.º 6
0
"""
This module provides the B-format B.NV instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if (proc.Z) or (proc.C) or (proc.V) or (proc.N):
        proc.reg["PC"].set(proc.labels[BR_address])


B_NV = B(97, operation)
Ejemplo n.º 7
0
"""
This module provides the B-format B.EQ instruction
"""
from armv8_isa import B

#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if proc.Z:
        proc.reg["PC"].set(proc.labels[BR_address])

B_EQ = B(98, operation)
Ejemplo n.º 8
0
"""
This module provides the B-format B.HS instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if proc.C:
        proc.reg["PC"].set(proc.labels[BR_address])


B_HS = B(96, operation)
Ejemplo n.º 9
0
"""
This module provides the B-format B.HI instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if (not proc.Z) and (proc.C):
        proc.reg["PC"].set(proc.labels[BR_address])


B_HI = B(97, operation)
Ejemplo n.º 10
0
"""
This module provides the B-format B.PL instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.N:
        proc.reg["PC"].set(proc.labels[BR_address])


B_PL = B(97, operation)
Ejemplo n.º 11
0
"""
This module provides the B-format B.GE instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.N == proc.V:
        proc.reg["PC"].set(proc.labels[BR_address])


B_GE = B(97, operation)
Ejemplo n.º 12
0
"""
This module provides the B-format B.LO instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.C:
        proc.reg["PC"].set(proc.labels[BR_address])


B_LO = B(95, operation)
Ejemplo n.º 13
0
"""
This module provides the B-format B.AL instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if (proc.Z) or (proc.C) or (proc.V) or (proc.N):
        proc.reg["PC"].set(proc.labels[BR_address])


B_AL = B(97, operation)
Ejemplo n.º 14
0
"""
This module provides the B-format B.LE instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not ((not proc.Z) and (proc.N == proc.V)):
        proc.reg["PC"].set(proc.labels[BR_address])


B_LE = B(97, operation)
Ejemplo n.º 15
0
"""
This module provides the B-format B.NE instruction
"""
from armv8_isa import B

#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.Z:
        proc.reg["PC"].set(proc.labels[BR_address])

B_NE = B(97, operation)
Ejemplo n.º 16
0
"""
This module provides the B-format B.VC instruction
"""
from armv8_isa import B


#consumes a core, a branch condition (ie. EQ or NEQ), and an address
def operation(proc, BR_address):
    # the logic of branch eq is to only branch if the the proc.flag_zero == 1
    # if true we will increment the PC to label + 4
    if not proc.V:
        proc.reg["PC"].set(proc.labels[BR_address])


B_VC = B(97, operation)