Re: poke2 question

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

> Hi,
>
> I have a (maybe stupid) question concerning 16-bit-ISA addressing. The
> hardware of an special ISA card in question is controlled via writing
> 16-bit-words from a base address on above 1 MB. I do know two
> possibilities using Euphoria:
>
> 1.  poke(address,{byte1,byte2})
>
> and
>
> 2.  poke(address  ,byte1)
> poke(address+1,byte2) .
>
> Is the effect on the hardware the same or is it different? And what
> would be the EU-code which should be equivalent with the C-function for
> writing a (16 bit-) Word?

Both are equivalent, although preference would be given to the first method,
as it should be faster. In this case it's trivial though.
There is no specific method for poking words to memory.
To poke bytes, use the methods above.
To poke a 16bit number, use this..
      poke(address,{remainder(num,256),floor(num/256)})

Chris

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

Search



Quick Links

User menu

Not signed in.

Misc Menu