Alcor6L/PicoLisp/cpu

From Wikibooks, open books for an open world
Jump to navigation Jump to search

This module deals with low-level access to CPU (and related modules) functionality, such as reading and writing memory, or enabling and disabling interrupts. It also offers access to platform specific CPU-related constants.

Functions[edit | edit source]

cpu-w32[edit | edit source]

Writes a 32-bit word to memory.

(cpu-w32 address data)
  • address - the memory address.
  • data - the 32-bit data to write.

Returns: data.

cpu-r32[edit | edit source]

Read a 32-bit word from memory.

(cpu-r32 address)
  • address - the memory address.

Returns:

  • data - the 32-bit word read from memory.

cpu-w16[edit | edit source]

Writes a 16-bit word to memory.

(cpu-w16 address data)
  • address - the memory address.
  • data - the 16-bit data to write.

Returns: data.

cpu-r16[edit | edit source]

Reads a 16-bit word from memory.

(cpu-r16 address)
  • address - the memory address.

Returns:

  • data - the 16-bit word read from memory.

cpu-w8[edit | edit source]

Writes a byte to memory.

(cpu-w8 address data)
  • address - the memory address.
  • data - the byte to write.

Returns: data.

cpu-r8[edit | edit source]

Reads a byte from memory.

(cpu-r8 address)
  • address - the memory address

Returns:

  • data - the byte read from memory.

cpu-clock[edit | edit source]

Get the CPU core frequency.

(cpu-clock)

Arguments: none.

Returns:

  • clock - the CPU clock (in Hertz).

PicoLisp Interrupts[edit | edit source]

Interrupt support is not implemented for PicoLisp yet.