home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 357_01 / cstar1.exe / X1GOOD.TST < prev    next >
Text File  |  1991-11-15  |  2KB  |  148 lines

  1. /*
  2.     Test of one-argument machine mnemonics.
  3.  
  4.     NO line of this file should generate an error.
  5.  
  6.     The first test in each series is short one argument.
  7.     The last test in each series has one extra argument.
  8. */
  9. int mem;
  10. char *a1;
  11. char *pc;
  12. long d2, d3;
  13.  
  14. /* WARNING:  jmp(&func());  does not work yet. */
  15.  
  16.  
  17. main()
  18. {
  19. lab1:
  20.  
  21. nop();
  22. reset();
  23. rte();
  24. rtr();
  25. rts();
  26. trapv();
  27.  
  28. bcc(lab1);
  29. bcs(lab1);
  30. beq(lab1);
  31. bge(lab1);
  32. bgt(lab1);
  33. bhi(lab1);
  34. ble(lab1);
  35. bls(lab1);
  36. blt(lab1);
  37. bmi(lab1);
  38. bne(lab1);
  39. bpl(lab1);
  40. bvc(lab1);
  41. bvs(lab1);
  42. bra(lab1);
  43. bsr(lab1);
  44. jsr(lab1);
  45. /* comment out -----
  46. jsr(&main+5);
  47. ----- end comment out */
  48.  
  49. clr(d2);
  50. clr(*a1);
  51. clr(*a1++);
  52. clr(*--a1);
  53. clr(*(a1+5));
  54. clr(*(a1+d3+5));
  55. clr(*(a1+d3));
  56. clr(mem);
  57.  
  58. ext(d2);
  59.  
  60. jmp(lab1);
  61. jmp(*a1);
  62. jmp(*(a1+5));
  63. jmp(*(a1+d3+5));
  64. jmp(*(a1+d3));
  65. jmp(*(pc+5));
  66. jmp(*(pc+d3+5));
  67. jmp(*(pc+d3));
  68.  
  69. jsr(lab1);
  70. jsr(*a1);
  71. jsr(*(a1+5));
  72. jsr(*(a1+d3+5));
  73. jsr(*(a1+d3));
  74. jsr(*(pc+5));
  75. jsr(*(pc+d3+5));
  76. jsr(*(pc+d3));
  77.  
  78. nbcd(d2);
  79. nbcd(*a1);
  80. nbcd(*a1++);
  81. nbcd(*--a1);
  82. nbcd(*(a1+5));
  83. nbcd(*(a1+d3+5));
  84. nbcd(*(a1+d3));
  85. nbcd(mem);
  86.  
  87. neg(d2);
  88. neg(*a1);
  89. neg(*a1++);
  90. neg(*--a1);
  91. neg(*(a1+5));
  92. neg(*(a1+d3+5));
  93. neg(*(a1+d3));
  94. neg(mem);
  95.  
  96. negx(d2);
  97. negx(*a1);
  98. negx(*a1++);
  99. negx(*--a1);
  100. negx(*(a1+5));
  101. negx(*(a1+d3+5));
  102. negx(*(a1+d3));
  103. negx(mem);
  104.  
  105. not(d2);
  106. not(*a1);
  107. not(*a1++);
  108. not(*--a1);
  109. not(*(a1+5));
  110. not(*(a1+d3+5));
  111. not(*(a1+d3));
  112. not(mem);
  113.  
  114. pea(*a1);
  115. pea(*(a1+5));
  116. pea(*(a1+d3+5));
  117. pea(mem);
  118. pea(*(pc+5));
  119. pea(*(pc+d3+5));
  120. pea(*(pc+d3));
  121.  
  122. stop(6);
  123.  
  124. swap(d2);
  125.  
  126. tas(d2);
  127. tas(*a1);
  128. tas(*a1++);
  129. tas(*--a1);
  130. tas(*(a1+5));
  131. tas(*(a1+d3+5));
  132. tas(*(a1+d3));
  133. tas(mem);
  134.  
  135. trap(6);
  136.  
  137. tst(d2);
  138. tst(*a1);
  139. tst(*a1++);
  140. tst(*--a1);
  141. tst(*(a1+5));
  142. tst(*(a1+d3+5));
  143. tst(*(a1+d3));
  144. tst(mem);
  145.  
  146. unlk(a1);
  147. }
  148.