Paste: writing raw x86 in factor

Author: not given
Mode: factor
Date: Thu, 2 Sep 2010 21:59:09
Plain Text |
! Goal: have a trivial example involving writing raw
! x86 code in factor, compiling, linking, and using it
! as a word


STRUCT: vec
  { x c:double }
  { y c:double } ;

:: vecop ( v3 v1 v2 -- )
  v3
    v1 x>> v2 x>> + >>x
    v1 y>> v2 y>> - >>y
  ; 
  
Now, I want to define a new opefator asm_vecop
  which does the same thing as vecop,
  except it's written entirely in the
  x86_64 assembly DSL of factor,
  then compiled + loaded into factor.

New Annotation

Summary:
Author:
Mode:
Body: