deep

a Cross Development Platform for Java

User Tools

Site Tools


crosscompiler:hardware

Accessing the Hardware

Java was developed as a safe language. It does not allow direct access and manipulation of absolute memory locations. Nevertheless this is essential for embedded programming. We therefore include this possibility by the use a special java class ch.ntb.inf.deep.unsafe.US (US stand for unsafe). Wenn methods of this class are used the code generator inserts machine code accordingly.
By using US.java you can

  • read from absolute memory locations (1, 2, 4, 8 bytes)
  • write to absolute memory locations (1, 2, 4, 8 bytes)
  • test a bit at an absolute memory location
  • directly insert machine code
  • get the address of a static method at compile time
  • get the address of a object

Depending on the processor architecture there are some more unsafe capabilities.

On the PowerPC platform

ch.ntb.inf.deep.unsafe.ppc.US implements

  • read and write directly to machine registers (GPRs, FPRs, SPRs)
  • enable the use of floats for exception routines

On the ARM platform

ch.ntb.inf.deep.unsafe.arm.US implements

  • read and write directly to machine registers (GPRs, EXTRs, CPRs)
  • enable the use of floats for exception routines

The API of US can be found under: API US, API US PPC, API US ARM

crosscompiler/hardware.txt · Last modified: 2019/11/06 14:39 by ursgraf