vax_b.s 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * QuickThreads -- Threads-building toolkit.
  3. * Copyright (c) 1993 by David Keppel
  4. *
  5. * Permission to use, copy, modify and distribute this software and
  6. * its documentation for any purpose and without fee is hereby
  7. * granted, provided that the above copyright notice and this notice
  8. * appear in all copies. This software is provided as a
  9. * proof-of-concept and for demonstration purposes; there is no
  10. * representation about the suitability of this software for any
  11. * purpose.
  12. */
  13. .text
  14. .globl _b_call_reg
  15. .globl _b_call_imm
  16. .globl _b_add
  17. .globl _b_load
  18. _b_null:
  19. .word 0x0
  20. ret
  21. _b_call_reg:
  22. .word 0x0
  23. movl 4(ap),r0
  24. moval _b_null,r1
  25. L0:
  26. calls $0,(r1)
  27. calls $0,(r1)
  28. calls $0,(r1)
  29. calls $0,(r1)
  30. calls $0,(r1)
  31. subl2 $5,r0
  32. bgtr L0
  33. ret
  34. _b_call_imm:
  35. .word 0x0
  36. movl 4(ap),r0
  37. L1:
  38. calls $0,_b_null
  39. calls $0,_b_null
  40. calls $0,_b_null
  41. calls $0,_b_null
  42. calls $0,_b_null
  43. subl2 $5,r0
  44. bgtr L1
  45. ret
  46. _b_add:
  47. .word 0x0
  48. movl 4(ap),r0
  49. L2:
  50. subl2 $1,r0
  51. subl2 $1,r0
  52. subl2 $1,r0
  53. subl2 $1,r0
  54. subl2 $1,r0
  55. subl2 $1,r0
  56. subl2 $1,r0
  57. subl2 $1,r0
  58. subl2 $1,r0
  59. subl2 $1,r0
  60. bgtr L2
  61. ret
  62. _b_load:
  63. .word 0x0
  64. movl 4(ap),r0
  65. L3:
  66. movl 0(sp),r1
  67. movl 4(sp),r1
  68. movl 8(sp),r1
  69. movl 12(sp),r1
  70. movl 16(sp),r1
  71. movl 20(sp),r1
  72. movl 24(sp),r1
  73. movl 28(sp),r1
  74. movl 32(sp),r1
  75. movl 36(sp),r1
  76. subl2 $1,r0
  77. bgtr L3
  78. ret