1. RE: petes asm.e question.
- Posted by Pete E <euphoria at eberlein.org> Sep 01, 2004
- 737 views
Using DS and other segment registers isn't recommended in Euphoria, since it is running in 32-bit protected mode. The segment registers are only needed in 16-bit real mode. The asm.e support for 16-bit is flakey at best, and would only work if you were generating instructions for a .com executable file, not for running in Euphoria. What are you really trying to do? Post your goal and we'll try to help. -- Pete Hayden McKay wrote: > > > posted by: Hayden McKay <hmck1 at dodo.com.au> > > I was wondering how to place a segment in [ds]. > I've looked at a heap of assembly on the net and found that a very > common way was to use: }}} <eucode> > -- work arround for [ds] direct access. > "mov ax, segg " & > "mov ds, ax " > </eucode> {{{ > > I found that pete's asm.e does'nt like this since [ds] can't be accessed > directly. Can some please show me how to place a segg in [DS]? I've also > tried an "@data" method wich also annoyed pete's asm.e. I've looked at > varuois assembly and cant find a way that works. I'm useing July/9/2000.
2. RE: petes asm.e question.
- Posted by Hayden McKay <hmck1 at dodo.com.au> Sep 01, 2004
- 665 views
I was trying to replace my fastfile.e lib with an assembly routine to see if I could get some extra speed. the filename buf and the read/write buf pointers are placed in ds:dx. The fastfile.lib is currently on par with Euphoria's read/write routines. I was just looking for some extra speed. I use it frequently to load in "intelhex" format records and other data that can be modified then written back out to disk with not much effort. n.b. I use "int #21" to call dos interrupt useing the july/9/2000 ver from Alexander's mini debugger.
3. RE: petes asm.e question.
- Posted by Alexander Toresson <toressonodakra at swipnet.se> Sep 01, 2004
- 638 views
The problem is that you're trying to use a routine which should run in real mode, though Euphoria runs in protected mode. It would have to be rewritten. Regards, Alexander Toresson Shhh! Be vewy quiet! I'm hunting wuntime ewwows!
4. RE: petes asm.e question.
- Posted by Pete E <euphoria at eberlein.org> Sep 01, 2004
- 630 views
- Last edited Sep 02, 2004
Hayden McKay wrote: > > I was trying to replace my fastfile.e lib with an assembly routine to see > if I could get some extra speed. the filename buf and the read/write buf > pointers are placed in ds:dx. The fastfile.lib is currently on par with > Euphoria's read/write routines. I was just looking for some extra speed. > I use it frequently to load in "intelhex" format records and other data > that can be modified then written back out to disk with not much effort. > n.b. I use "int #21" to call dos interrupt useing the july/9/2000 ver from > Alexander's mini debugger. Unfortunately, I doubt you'll be able to beat Euphoria on file io. The overhead for peeking and poking the sequence of data into memory before calling the interrupt is where the most of your time is spent. Optimizing the interrupt call into assembly isn't going to do any good. There are a few places in your code where I think you can get some performance gains though. In fast_read, find out the length of the file first, then make your data sequence that length before reading any data. Put the peek'ed sequence into data using a slice: data[index..index+status[REG_AX]-1] = peek({buffer, status[REG_AX]}) index += status[REG_AX] The same goes for fast_write: if bytesin > 32768 then bytesout = 32768 else bytesout = bytesin end if poke(buffer, data[index..index+bytesout-1]) index += bytesout bytesin -= bytesout In both cases, the variable index should start at 1 outside the loop. Regards, Pete
5. RE: petes asm.e question.
- Posted by Hayden McKay <hmck1 at dodo.com.au> Sep 02, 2004
- 640 views
Thanx Pete, I see how it goes.