Simplified file structure
This commit is contained in:
README.mdgo.modgo.sum
src
arch
arm64
riscv
x64
Add.goAdd_test.goAnd.goCall.goCompare.goCompare_test.goDiv.goDiv_test.goExtendRAXToRDX.goJump.goJump_test.goLoad.goLoad_test.goModRM.goModRM_test.goMove.goMove_test.goMul.goMul_test.goNegate.goNegate_test.goOr.goPop.goPop_test.goPush.goPush_test.goREX.goREX_test.goRegisters.goReturn.goSIB.goSIB_test.goShift.goStore.goStore_test.goSub.goSub_test.goSyscall.goXor.goencode.goencodeNum.gomemoryAccess.gox64_test.go
asm
Assembler.goFinalize.goInstruction.goInstructions.goLabel.goMemory.goMemoryNumber.goMemoryRegister.goMnemonic.goOptimizer.goPointer.goRegister.goRegisterLabel.goRegisterNumber.goRegisterRegister.go
ast
AST.goAssert.goAssign.goCall.goCount.goDefine.goEachInstruction.goIf.goLoop.goParse.goReturn.goSwitch.goparseKeyword.goparseNode.goparseSwitch.go
build
cli
compiler
config
core
AddBytes.goCompare.goCompile.goCompileAST.goCompileASTNode.goCompileAssert.goCompileAssign.goCompileAssignArray.goCompileAssignDivision.goCompileCall.goCompileCondition.goCompileDefinition.goCompileIf.goCompileLoop.goCompileReturn.goCompileSwitch.goCompileSyscall.goCompileTokens.goDefer.goDefine.goEvaluate.goExecute.goExecuteLeaf.goExecuteRegister.goExecuteRegisterNumber.goExecuteRegisterRegister.goExpressionToMemory.goExpressionToRegister.goExpressionsToRegisters.goFold.goFunction.goIdentifierExists.goJumpIfFalse.goJumpIfTrue.goNewFunction.goNumber.goPrintInstructions.goString.goTokenToRegister.goUsesRegister.go
cpu
data
elf
errors
Base.goError.goInvalidCharacter.goInvalidInstruction.goInvalidOperator.goKeywordNotImplemented.goNumberExceedsBounds.goStack.goTypeMismatch.goUnknownCLIParameter.goUnknownFunction.goUnknownIdentifier.goUnknownPackage.goUnusedImport.goUnusedVariable.goVariableAlreadyExists.go
expression
fs
os/linux
register
AddLabel.goCall.goComment.goFreeRegister.goJump.goMachine.goMemoryNumber.goMemoryRegister.goNewRegister.goRegister.goRegisterIsUsed.goRegisterLabel.goRegisterNumber.goRegisterRegister.goReturn.goSaveRegister.goSyscall.goUseRegister.gopostInstruction.go
scanner
scope
sizeof
token
Count.goCount_test.goKind.goLength.goList.goList_test.goPosition.goToken.goToken_test.goTokenize.goTokenize_test.gobench_test.go
types
tests
16
src/arch/x64/Push.go
Normal file
16
src/arch/x64/Push.go
Normal file
@ -0,0 +1,16 @@
|
||||
package x64
|
||||
|
||||
import "git.akyoto.dev/cli/q/src/cpu"
|
||||
|
||||
// PushRegister pushes the value inside the register onto the stack.
|
||||
func PushRegister(code []byte, register cpu.Register) []byte {
|
||||
if register >= 8 {
|
||||
code = append(code, REX(0, 0, 0, 1))
|
||||
register -= 8
|
||||
}
|
||||
|
||||
return append(
|
||||
code,
|
||||
0x50+byte(register),
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user