! Copyright (C) 2020 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators cpu.arm.assembler.opcodes kernel
-math math.bitwise namespaces sequences ;
+math math.bitwise namespaces sequences combinators.extras ;
IN: cpu.arm.assembler
! pre-index mode: computed addres is the base-register + offset
: LSRi32 ( imm6 Rn Rd -- ) LSRi32-encode >out ;
: LSRi64 ( imm6 Rn Rd -- ) LSRi64-encode >out ;
-: with-output-variable ( value variable quot -- value )
- over [ get ] curry compose with-variable ; inline
-
: with-new-arm64-offset ( offset quot -- arm64-assembler )
[ <arm64-assembler> \ arm64-assembler ] dip with-output-variable ; inline
0 swap offset-test-arm64 ; inline
: test-arm64-instruction ( quot -- instructions )
- 0 swap offset-test-arm64-instruction ; inline
\ No newline at end of file
+ 0 swap offset-test-arm64-instruction ; inline
! Copyright (C) 2013 Doug Coleman, John Benediktsson.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays assocs combinators combinators.smart fry
-generalizations kernel macros math quotations sequences locals
-math.order sequences.generalizations sequences.private
+generalizations kernel locals macros math math.order namespaces
+quotations sequences sequences.generalizations sequences.private
stack-checker.transforms system words ;
IN: combinators.extras
MACRO: chain ( quots -- quot )
<reversed> [ ] [ swap '[ [ @ @ ] [ f ] if* ] ] reduce ;
+
+: with-output-variable ( value variable quot -- value )
+ over [ get ] curry compose with-variable ; inline