1. Help for a confused soul

I need some help converting this asm code to euphoria byte code.
Any help would be appreciated!

Video = #A0000 and buffer is an atom representing a virtual screen.

push ds
les di, video
lds si, buffer
mov cx, 32000  ;320*200/2
rep movsw
pop ds
ret

Greg Harris
blackdog at cdc.net

new topic     » topic index » view message » categorize

2. Re: Help for a confused soul

At 22:58 97-06-12 -0400, you wrote:
>---------------------- Information from the mail header -----------------------
>Sender:       Euphoria Programming for MS-DOS <EUPHORIA at
>MIAMIU.ACS.MUOHIO.EDU>
>Poster:       Greg Harris <blackdog at CDC.NET>
>Subject:      Help for a confused soul
>-------------------------------------------------------------------------------
>
>I need some help converting this asm code to euphoria byte code.
>Any help would be appreciated!
>
>Video = #A0000 and buffer is an atom representing a virtual screen.
>
>push ds
>les di, video
>lds si, buffer
>mov cx, 32000  ;320*200/2
>rep movsw
>pop ds
>ret
>
>Greg Harris
>blackdog at cdc.net
>

What about mem_copy(Video,buffer,32000)
Jacques Deschenes
Baie-Comeau, Quebec
Canada
desja at quebectel.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Help for a confused soul

> >I need some help converting this asm code to euphoria byte code.
> >Any help would be appreciated!
> >
> >Video = #A0000 and buffer is an atom representing a virtual screen.
> >
> >push ds
> >les di, video
> >lds si, buffer
> >mov cx, 32000  ;320*200/2
> >rep movsw
> >pop ds
> >ret
> >

> What about mem_copy(Video,buffer,32000)

What I am trying to do is similar with mem_copy, however I think mem copy
only copies a byte at a time this should copy words at a time. So my screen
update time will be 2X as fast I hope.

Does any one know how many bytes an atom is?

Thanks,

Greg..

new topic     » goto parent     » topic index » view message » categorize

4. Re: Help for a confused soul

> > >I need some help converting this asm code to euphoria byte code.
> > >Any help would be appreciated!
> > >
> > >Video = #A0000 and buffer is an atom representing a virtual screen.
> > >
> > >push ds
> > >les di, video
> > >lds si, buffer
> > >mov cx, 32000  ;320*200/2
> > >rep movsw
> > >pop ds
> > >ret
> > >
>
> > What about mem_copy(Video,buffer,32000)
>
> What I am trying to do is similar with mem_copy, however I think mem copy
> only copies a byte at a time this should copy words at a time. So my screen
> update time will be 2X as fast I hope.

        I assume calling a machine-code thing trough an interpreter is
slower than using its inbuild routines...
        Don't underestemate RDS, i'll bet there code is as fast as possible
        (At least now, with 15a)
        Also know that is ussualy is the video-memory itself which is slow
and the video memory itself is totally byte-oriented (in mode 19)
        But maybe... if it is faster i think RDS should use this routine in
their next version...

> Does any one know how many bytes an atom is?

        An atom CAN be 32 bit (thus 32/4 = 8) chars, their are routines for
converting 32-bits atoms to bytes, but if you only use the fist 8 it
totally acts like a byte....
        Also know that when you poke with atoms only the 8 most right bits
are used....
        An integer is just like a byte, but a bit faster and it doesn't
allow 32 bit values, the highest value you can give it is 31-bit.....
        ALso 31-bit integers pass the 8 most right bits when you poke or do
a memset....
        If you normally declare an atom and give it a value it will not use
the full 32 bit, he will use 32 bit only if needed, but to check the
value takes some time and thus you can better use integer for things
that won't be 32-bit....

Hope this helps...

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » goto parent     » topic index » view message » categorize

5. Re: Help for a confused soul

> > What about mem_copy(Video,buffer,32000)
>
> What I am trying to do is similar with mem_copy, however I think mem copy
> only copies a byte at a time this should copy words at a time. So my screen
> update time will be 2X as fast I hope.

mem_copy() copies four bytes at a time, and is very close to the
fastest possible method for copying memory.

Regards,
               Michael Bolin

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu