1. poke2 question
- Posted by rolf.schroeder at desy.de Sep 14, 2001
- 481 views
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? Any idea or advice? Thanks, Rolf
2. Re: poke2 question
- Posted by Chris Bensler <bensler at telus.net> Sep 14, 2001
- 477 views
> 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
3. Re: poke2 question
- Posted by stabmaster_ at HOTMAIL.COM Sep 14, 2001
- 474 views
>To poke a 16bit number, use this.. > poke(address,{remainder(num,256),floor(num/256)}) Though this would be faster: poke(address,{and_bits(num,255),floor(num/256)}) or (probably) even: poke(address,{num, floor(num/256)}) since poke() only will store the lower 8 bits of the first value anyway.
4. Re: poke2 question
- Posted by "Thomas Parslow (PatRat)" <patrat at rat-software.com> Sep 16, 2001
- 459 views
> 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) . They should be pretty much the same, except the second will be a little slower... > 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? Untested, but this should write a 16-bit value contained in "Word" to "Address" include machine.e sequence bytes bytes = int_to_bytes(Word) poke(Address,Word[1..2]) > Any idea or advice? > Thanks, Rolf Thomas Parslow (PatRat) ICQ #:26359483 Rat Software http://www.rat-software.com/ Please leave quoted text in place when replying