Assembly routines

new topic     » goto parent     » topic index » view thread      » older message » newer message

James Powell writes:
> 1.  When using an assembly routine in Euphoria, is it interpreted like the
> rest of the program, or does Euphoria actually release control to the
> assembly function?

Euphoria turns over complete control to your machine code. Your machine
code is running on the "bare metal" so to speak.  smile

> 2.  Euphoria uses protected mode (I think).  Is an assembly routine in a
> Euphoria program also run in protected mode, or is the computer switched to
> real mode before the assembly is run, and switched back to protected mode
> when the assembly returns?

Your machine code routine runs in 32-bit protected mode, just like
Euphoria itself. Euphoria does not switch modes before calling your code.

> 3.  Is it possible to pass data back and forth between an assembly function
> and the Euphoria program?

Yes. Your Euphoria program can call allocate() or allocate_low()
to reserve space in memory. It can peek()/poke() data into that
space and your machine code can access that area of memory.
See demo\callmach.ex, demo\hardint.ex, and some
of Jacques Deschenes .e files, for some good examples of this.

Regards,
  Rob Craig
  Rapid Deployment Software

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu