if_pn_s.s
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:1k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* if_pn_s.s - proNet-80 assembly language support routines */
  2. /* Copyright 1984,1985,1986,1987,1988,1989 Wind River Systems, Inc. */
  3. .data
  4. .globl _copyright_wind_river
  5. .long _copyright_wind_river
  6. /* @(#)if_pn_s.s 2.1 7/17/86 (c) 1986 Proteon, Inc. */
  7. /*
  8. modification history
  9. --------------------
  10. 01d,24mar89,gae  changed movl's to movel's for Apollo's sake.
  11. 01c,10dec88,gae  changed labels for HP's sake.
  12. 01b,05sep88,gae  cleaned up.
  13. 01a,06nov87,rdc  written.
  14. */
  15. #define ASMLANGUAGE
  16. #include "vxWorks.h"
  17. #include "asm.h"
  18.     .globl _movep
  19.     .text
  20.     .even
  21. /*******************************************************************************
  22. *
  23. * movep - move bytes into destination
  24. *
  25. * RETURNS: whether to start on a word
  26. * BOOL movep (from, to, nbytes, flag)
  27. *     char *from; /* source *
  28. *     char *to; /* destination *
  29. *     int nbytes; /* number of bytes to copy *
  30. *     BOOL flag; /* true = start on word *
  31. */
  32. _movep:
  33. movel   sp@(4),a0 /* "from" */
  34. movel   sp@(8),a1 /* "to" */
  35. movel   sp@(12),d0 /* "nbytes" */
  36. bles    lab1 /* == 0, bye */
  37. clrl    d1
  38. tstl    sp@(16) /* "flag" */
  39. beqs    lab2
  40. movw    a0@+,a1@ /* copy first word */
  41. subql   #2,d0
  42. lab2:
  43. btst    #1,d0 /* all longs? */
  44. beqs    lab3
  45. movel   #1,d1 /* word ending */
  46. lab3:
  47. lsrl    #2,d0 /* bytes -> longs */
  48. bras    lab5
  49. lab4:
  50. movel   a0@+,a1@ /* do copy */
  51. lab5:
  52. dbra    d0,lab4
  53. movel   d1,d0 /* return flag in d0 */
  54. beqs    lab1
  55. movw    a0@,a1@ /* copy last word */
  56. lab1:
  57. rts