• R/O
  • HTTP
  • SSH
  • HTTPS

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A complete (I think) set of code generator macros to generate published op-codes


File Info

Rev. b281f65ed7aeceaaf5feefa53f71dc6a4c0a99ac
大小 2,289 字节
时间 2020-10-08 20:37:04
作者 Joel Matthew Rees
Log Message

As it survived the trip across the Mac and ocean

Content

/* Scatter test of bit ops */
/* Assigned by the author to the public domain, February 2000, Takino, Japan. */
/* joel_rees@sannet.ne.jp */
/* http://www.page.sannet.ne.jp/joel_rees */


#include "code.h"
#include <stdio.h>

int main()
{  int err;
   CODE *v1 = dap;
   CODE *v2 = dap += 4;
   CODE *s1 = dap += 4;
   CODE *s2 = dap += 16;
   CODE *f = cap;
   CODE *targ1, *targ2, *obj;

   printf("here?\n");
   v1[0] = 0x0000;
   v1[1] = 0x4321;
   v1[2] = 0x5678;
   v1[3] = 0x9012;
   v2[0] = 0x0876;
   v2[1] = 0x2345;
   v2[2] = 0x9012;
   v2[3] = 0x5489;
   strcpy((char *) s1, "hello there");
   err = genLINK(6, -30);
   err = genPUSH(CLONG, _PSH(E_An|1)|_PSH(E_An|2)|_PSH(E_An|3)
			|_PSH(E_Dn|6)|_PSH(E_Dn|7),
		 E_InDEC|7, 0, 0);
   err = genMOVE(CLONG, E_IMM, 0, (long) v1, E_An|2, 0, 0);
   err = genMOVE(CBYTE, E_IMM, 0, 0xc, E_Dn|7, 0, 0);
   err = genBCHG(E_Dn|7, 0, E_Dn|6, 0, 0);
   err = genBSET(E_IMM, 6, E_In|2, 0, 0);
   err = genBSET(E_IMM, 2, E_An|1, 0, 0); /* */
   err = genBCLR(E_Dn|6, 0, E_AnXi|2, iDl(7), 8);
   err = genBTST(E_Dn|7, 0, E_ABSl, 0, (long) v2);
   err = genBCHG(E_IMM, 3, E_pcOFF, 0, 0x10); /* */
   err = genBCLR(E_IMM, 1, E_pcOFF, 0, 0x10); /* */
   err = genBSET(E_IMM, 2, E_pcOFF, 0, 0x10); /* */
   err = genBTST(E_Dn|7, 0, E_pcOFF, 0, 0x10);
   err = genBTST(E_Dn|7, 0, E_pcXi, iDl(6), 0x12);
   err = genMOVE(CLONG, E_IMM, 0, 4, E_Dn|7, 0, 0);
   err = genMOVE(CLONG, E_IMM, 0, 4, E_Dn|6, 0, 0);
   err = genBTST(E_Dn|7, 0, E_IMM, 0, 0x4);
   err = genBTST(E_Dn|7, 0, E_Dn|6, 0, 0);
   err = genBTST(E_IMM, 4, E_Dn|6, 0, 0);
   err = genSUBQ(CBYTE, 1, E_Dn|7, 0, 0);
   err = genBTST(E_Dn|7, 0, E_IMM, 0, 0x4);
   err = genBTST(E_Dn|7, 0, E_Dn|6, 0, 0);
   err = genBTST(E_IMM, 3, E_Dn|6, 0, 0);
   err = genSUBQ(CBYTE, 1, E_Dn|7, 0, 0);
   err = genBTST(E_Dn|7, 0, E_IMM, 0, 0x4);
   err = genBTST(E_Dn|7, 0, E_Dn|6, 0, 0);
   err = genBTST(E_IMM, 2, E_Dn|6, 0, 0);
   err = genBTST(E_IMM, 4, E_pcOFF, 0, 0x10);
   err = genBTST(E_IMM, 5, E_pcXi, iDl(6), 0x12);
   err = genBTST(E_IMM, 6, E_IMM, 0, 0xdf); /* */
   err = genPULL(CLONG, E_InINC|7, 0, 0,
		 _PUL(E_An|1)|_PUL(E_An|2)|_PUL(E_An|3)
		 |_PUL(E_Dn|6)|_PUL(E_Dn|7));
   err = genUNLK(6);
   err = genRTS;
   err = (*(PFI) f)();
   printf("what? %lx\n", err);
   return(0);
}