#include #include void put(int x) { char str[6]; str[5]=0; int i; for(i=4;i>=0;i--) { str[i]=x%2+'0'; x/=2; } printf("%s",str); } int main() { int op; while(scanf("%d",&op)!=EOF) { if(op==1) { char str[10]; scanf("%s",str); char temp[20]; scanf("%s",temp); int i=0; if(strcmp(str,"ADD")==0) printf("000001"); if(strcmp(str,"SUB")==0) printf("000010"); if(strcmp(str,"DIV")==0) printf("000011"); if(strcmp(str,"MUL")==0) printf("000100"); if(strcmp(str,"MOVE")==0) printf("000101"); if(strcmp(str,"SET")==0) printf("000110"); int b=0,c=0; if(strcmp(str,"SET")==0) { for(i=1;i>10); int b=((ans & 0x3ff)>>5); int c=(ans & 0x1f); if(a==1 && b && c) printf("ADD R%d,R%d\n",b,c); else if(a==2 && b && c) printf("SUB R%d,R%d\n",b,c); else if(a==3 && b && c) printf("DIV R%d,R%d\n",b,c); else if(a==4 && b && c) printf("MUL R%d,R%d\n",b,c); else if(a==5 && b && c) printf("MOVE R%d,R%d\n",b,c); else if(a==6 && b && !c) printf("SET R%d\n",b); else printf("Error!\n"); } } return 0; }