mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Def PHA, PLA, PHP, PLP
This commit is contained in:
parent
5445972c1b
commit
d372790f92
@ -11,11 +11,19 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 6502 Return Value Calling Convention
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def CC_Mos6502 : CallingConv<[
|
||||
CCIfType<[i8], CCAssignToReg<[A, X, Y]>>,
|
||||
CCAssignToStack<0, 0>
|
||||
CCAssignToStack<1, 1>
|
||||
]>;
|
||||
|
||||
def RetCC_Mos650232 : CallingConv<[
|
||||
CCIfType<[i8], CCAssignToReg<[A, X, Y]>>
|
||||
]>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 6502 Argument Calling Conventions
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -38,6 +38,7 @@ Defs = [A, SREG] in
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Increment and Decrement
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let Defs = [X, SREG] in
|
||||
{
|
||||
def INX : InstM6502<(outs XR:$dst),
|
||||
@ -64,6 +65,39 @@ let Defs = [Y, SREG] in
|
||||
[(set YR:$dst, (sub YR:$src, 1)), (implicit SREG)]>;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Stack operations
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
let Defs = [SP],
|
||||
Uses = [SP] in
|
||||
{
|
||||
// Push accumulator on stack
|
||||
let mayStore = 1 in {
|
||||
def PHA : InstM6502<(outs), (ins AR:$a), "pha", []>;
|
||||
}
|
||||
|
||||
// Pop from stack into accumulator
|
||||
let mayLoad = 1 in {
|
||||
def PLA : InstM6502<(outs AR:$a), (ins), "pla", []>;
|
||||
}
|
||||
}
|
||||
|
||||
let Defs = [SP],
|
||||
Uses = [SP, SREG],
|
||||
mayStore = 1 in
|
||||
{
|
||||
def PHP : InstM6502<(outs), (ins CCR:$c), "php", []>;
|
||||
}
|
||||
|
||||
let Defs = [SP, SREG],
|
||||
Uses = [SP],
|
||||
mayLoad = 1 in
|
||||
{
|
||||
def PLP : InstM6502<(outs CCR:$c), (ins), "plp", []>;
|
||||
}
|
||||
|
||||
|
||||
def NOP : InstM6502<(outs), (ins), "nop", []>;
|
||||
|
||||
def ADJCALLSTACKDOWN : Pseudo<(outs), (ins), "#ADJCALLSTACKDOWN", []>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user