 ! Copyright (C) 2020 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators combinators.extras
-cpu.arm.assembler.opcodes io.binary kernel math
-math.bitwise namespaces sequences ;
+USING: accessors combinators cpu.arm.assembler.opcodes io.binary
+kernel make math math.bitwise namespaces sequences ;
 IN: cpu.arm.assembler
 
 ! pre-index mode: computed addres is the base-register + offset

    '[ @ \ arm64-assembler get ] with-variable ; inline

: assemble-arm ( quot -- bytes )
    with-new-arm64 out>> [ 4 >le ] map concat ; inline

: offset-test-arm64 ( offset quot -- instuctions )
    with-new-arm64-offset out>> ; inline

! B but that is breakpoint
: Br ( imm26 -- ) 26 ?bits B-encode >out ;
: B.cond ( imm19 cond4 -- ) [ 19 ?bits ] dip B.cond-encode >out ;
! : BL ( offset -- ) ip - 4 / BL-encode >out ;
: BL ( offset -- ) BL-encode >out ;
: BR ( Rn -- ) BR-encode >out ;
: BLR ( Rn -- ) BLR-encode >out ;
