factor/basis/bootstrap/assembler/x86.64.unix.factor

25 lines
956 B
Factor
Raw Normal View History

2008-11-07 21:33:32 -05:00
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
2009-10-28 14:38:27 -04:00
USING: bootstrap.image.private cpu.x86.assembler
cpu.x86.assembler.operands kernel layouts namespaces parser
sequences system vocabs ;
2008-11-07 21:33:32 -05:00
IN: bootstrap.x86
2011-12-13 18:13:32 -05:00
: leaf-stack-frame-size ( -- n ) 2 bootstrap-cells ;
: signal-handler-stack-frame-size ( -- n ) 20 bootstrap-cells ;
2008-11-07 21:33:32 -05:00
: stack-frame-size ( -- n ) 4 bootstrap-cells ;
: nv-regs ( -- seq ) { RBX R12 R13 R14 R15 } ;
: volatile-regs ( -- seq ) { RAX RCX RDX RSI RDI R8 R9 R10 R11 } ;
! The first four parameter registers according to the Unix 64bit
! calling convention.
: arg1 ( -- reg ) RDI ;
: arg2 ( -- reg ) RSI ;
: arg3 ( -- reg ) RDX ;
: arg4 ( -- reg ) RCX ;
: red-zone-size ( -- n ) 128 ;
2008-11-07 21:33:32 -05:00
<< "vocab:bootstrap/assembler/x86.unix.factor" parse-file suffix! >> call
<< "vocab:bootstrap/assembler/x86.64.factor" parse-file suffix! >> call
<< "vocab:bootstrap/assembler/x86.factor" parse-file suffix! >> call