[comp.lang.c] movedata

cs106132@umbc5.umbc.edu (cs106132) (02/15/91)

   Hi,
I was wondering if anyone out there show me an example of coding a
routine that will do the equivalent of Turbo C's "movedata()" function.
In other words, a routine that will copy  a block of memory from any
segment:offset to any segment:offset.  The important thing is that it does not
use any interrupt calls.  I would like to see an implementation using
inline assembly capability of Turbo C.  If you have such a routine or know
where I can find one, please let me know either by e-mail or post here.


    Something like:

    void  my_movedata (unsigned src_seg, unsigned src_off,
                       unsigned dst_seg, unsigned dst_off,
                       unsigned count) {

      asm  push es
      asm  push ds
      asm  mov  ax, src_seg
      asm  mov  es, 
      asm  mov  si, src_off
      asm  mov  ax, dst_seg
      asm  mov  ds, ax
      asm  mov  di, dst_off
      asm  mov  cx, count/2
      asm  cld
      asm  rep movsw
    }


  I am not really familiar with the assemler, so any help will be appreciated.

Regards,
Tark

dave@cs.arizona.edu (Dave P. Schaumann) (02/15/91)

In article <5024@umbc3.UMBC.EDU> cs106132@umbc5.umbc.edu (cs106132) writes:
>
>   Hi,
>I was wondering if anyone out there show me an example of coding a
>routine that will do the equivalent of Turbo C's "movedata()" function.

I was going to reply to this through e-mail, but I think it is something
worth saying to the whole net.  The name of this group is "comp.lang.c",
not "comp.lang.c.ibm".  This, and a lot of other posts in this group have
little or nothing to do with the language C.

I would suggest to everyonewho is considering posting a message to comp.lang.c
to ask themselves this question:

"will anyone without a <insert name of your computer here> care about this?"

If the answer is no, please, please PLEASE don't post it here.  Somebody will
no doubt suggest I use my kill file.  Well, this is my kill file for this
group:

/:*TURBO C*/:j
/:*TurboC*/:j
/:*Quick C*/:j
/:*QuickC*/:j
/:*Microsoft C/:j

And it *still* doesn't catch all the IBM-specific noise that goes through this
group.  :(  Instead of trying to catch every permutation of IBM-ese in my kill
file, I'd like to see everyone show a little common sense in posting.  When I
have a machine-specific question, I post it to comp.sys.amiga.programmer.
Please have the courtesy to post machine-specific questions to machine-
specific groups.

Thank you.
-- 
Dave Schaumann      | DANGER: Access holes may tear easily.  Use of the access
		    | holes for lifting or carrying may result in damage to the
dave@cs.arizona.edu | carton and subsequent injury to the user.

mcdonald@aries.scs.uiuc.edu (Doug McDonald) (02/15/91)

In article <872@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave P. Schaumann) writes:
>In article <5024@umbc3.UMBC.EDU> cs106132@umbc5.umbc.edu (cs106132) writes:
>>
>>   Hi,
>>I was wondering if anyone out there show me an example of coding a
>>routine that will do the equivalent of Turbo C's "movedata()" function.
>
>
>I would suggest to everyonewho is considering posting a message to comp.lang.c
>to ask themselves this question:
>
>"will anyone without a <insert name of your computer here> care about this?"
>
>If the answer is no, please, please PLEASE don't post it here.  Somebody will
>no doubt suggest I use my kill file.  Well, this is my kill file for this
>group:
>
>/:*TURBO C*/:j
>/:*TurboC*/:j
>/:*Quick C*/:j
>/:*QuickC*/:j
>/:*Microsoft C/:j
>

And here would be mine if kill files weren't so SLOWWWWWWWWWWWWWWWWWWWWWWW

/:*UNIX*/:j
/:*Unix*/:j
/:*Posix*/:j
/:*BSD*/:j
/:*SYSV*/:j



And they *still* would not catch all the Unix-specific noise that goes through this
>group.   Instead of trying to catch every permutation of Unix-ese in my kill
>file, I'd like to see everyone show a little common sense in posting.  When I
>have a Unix -specific question, I post it to comp.unix.???




Doug McDonald