Intrinsics
Intrinsics are recognized by the compiler. They lower to inline instructions or
to routines in niblick/runtime/runtime.asm. They are not declared with
fn and cannot be redefined.
Memory
Call |
Returns |
Behavior |
|---|---|---|
|
|
Read one nibble from 8-bit data address |
|
|
Write one nibble |
|
|
Read a byte from |
|
|
Write a byte to |
|
|
Read a byte from code address |
|
|
Read a nibble from code address |
|
|
Read a byte and advance |
flash_next requires a mutable flashptr variable. The address is advanced
in place.
I/O
Call |
Returns |
Behavior |
|---|---|---|
|
|
Read the bank-0 input port |
|
|
Write the bank-0 output latch |
|
|
Set output bits in |
|
|
Clear output bits in |
|
|
Toggle output bits in |
|
|
Return 1 when any bit in |
mask is a nibble. A constant mask lowers to BSET, BCLR, BTG, or
BIT. A variable mask calls the runtime routine. gpio_test with a
single-bit constant mask lowers to BIT.
UART
Call |
Returns |
Behavior |
|---|---|---|
|
|
Write one byte |
|
|
Wait for and read one byte |
lib/uart.nbl adds setup, buffering helpers, and formatting. See
UART.
Timing
Call |
Behavior |
|---|---|
|
Busy loop; |
The duration depends on the Clock SFR. lib/time.nbl provides Sync-based
delays.
W5500 fast path
Call |
Returns |
Behavior |
|---|---|---|
|
|
Write one byte through the W5500 SPI fast path |
|
|
Exchange one byte through the W5500 SPI fast path |
These intrinsics are part of lib/drivers/w5500.nbl. They are not general SPI
API. See SPI and W5500 Ethernet driver.
Formatting
Call |
Behavior |
|---|---|
|
Compile-time format expansion; see Print formatting |
print is a statement, not an expression. The format string must be a
literal.
Nibble helpers
Call |
Returns |
Behavior |
|---|---|---|
|
|
High nibble of a |
|
|
Low nibble of a |
Internal builtins
The compiler also uses __nib_f16_bits, __nib_f16_from_bits,
__nib_f32_bits, and __nib_f32_from_bits for float bit access. They are not
part of the public library interface. See Soft float.