Current section
Files
Jump to
Current section
Files
lib/asm.ex
defmodule Asm do
use Constants
@name :max_int
@value 0x7fff_ffff_ffff_ffff
@name :min_int
@value -0x8000_0000_0000_0000
@moduledoc """
Asm aimed at implementing an inline assembler.
Currently, it provides the following:
* `is_int64` macro that can be used in `when` clauses to judge that a value is within INT64.
* `max_int` is the constant value of maxium of INT64.
* `min_int` is the constant value of minimum of INT64.
"""
@doc """
is_int64(value) returns true if the value is an integer, equals or is less than max_int and equals or is greater than min_int.
"""
defmacro is_int64(value) do
quote do
is_integer(unquote(value))
and unquote(value) <= unquote(Asm.max_int)
and unquote(value) >= unquote(Asm.min_int)
end
end
def dummy(a), do: a
end