add Alpha big-endian (#2227)

This commit is contained in:
R3v0LT 2024-01-02 07:02:38 +03:00 committed by GitHub
parent a128f31d20
commit a21f7ce310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 257 additions and 13 deletions

View File

@ -8,9 +8,11 @@ from capstone.alpha import *
from xprint import to_x, to_hex
ALPHA_CODE = b'\x02\x00\xbb\x27\x50\x7a\xbd\x23\xd0\xff\xde\x23\x00\x00\x5e\xb7'
ALPHA_CODE_BE = b'\x27\xbb\x00\x02\x23\xbd\x7a\x50\x23\xde\xff\xd0\xb7\x5e\x00\x00'
all_tests = (
(CS_ARCH_ALPHA, 0, ALPHA_CODE, "Alpha"),
(CS_ARCH_ALPHA, CS_MODE_LITTLE_ENDIAN, ALPHA_CODE, "Alpha (Little-endian)"),
(CS_ARCH_ALPHA, CS_MODE_BIG_ENDIAN, ALPHA_CODE_BE, "Alpha (Big-endian)"),
)

View File

@ -41,6 +41,7 @@ EBPF_CODE = b"\x97\x09\x00\x00\x37\x13\x03\x00\xdc\x02\x00\x00\x20\x00\x00\x00\x
RISCV_CODE32 = b"\x37\x34\x00\x00\x97\x82\x00\x00\xef\x00\x80\x00\xef\xf0\x1f\xff\xe7\x00\x45\x00\xe7\x00\xc0\xff\x63\x05\x41\x00\xe3\x9d\x61\xfe\x63\xca\x93\x00\x63\x53\xb5\x00\x63\x65\xd6\x00\x63\x76\xf7\x00\x03\x88\x18\x00\x03\x99\x49\x00\x03\xaa\x6a\x00\x03\xcb\x2b\x01\x03\xdc\x8c\x01\x23\x86\xad\x03\x23\x9a\xce\x03\x23\x8f\xef\x01\x93\x00\xe0\x00\x13\xa1\x01\x01\x13\xb2\x02\x7d\x13\xc3\x03\xdd\x13\xe4\xc4\x12\x13\xf5\x85\x0c\x13\x96\xe6\x01\x13\xd7\x97\x01\x13\xd8\xf8\x40\x33\x89\x49\x01\xb3\x0a\x7b\x41\x33\xac\xac\x01\xb3\x3d\xde\x01\x33\xd2\x62\x40\xb3\x43\x94\x00\x33\xe5\xc5\x00\xb3\x76\xf7\x00\xb3\x54\x39\x01\xb3\x50\x31\x00\x33\x9f\x0f\x00"
RISCV_CODE64 = b"\x13\x04\xa8\x7a"
ALPHA_CODE = b'\x02\x00\xbb\x27\x50\x7a\xbd\x23\xd0\xff\xde\x23\x00\x00\x5e\xb7'
ALPHA_CODE_BE = b'\x27\xbb\x00\x02\x23\xbd\x7a\x50\x23\xde\xff\xd0\xb7\x5e\x00\x00'
all_tests = (
@ -76,7 +77,8 @@ all_tests = (
(CS_ARCH_BPF, CS_MODE_LITTLE_ENDIAN | CS_MODE_BPF_EXTENDED, EBPF_CODE, "eBPF", None),
(CS_ARCH_RISCV, CS_MODE_RISCV32, RISCV_CODE32, "RISCV32", None),
(CS_ARCH_RISCV, CS_MODE_RISCV64, RISCV_CODE64, "RISCV64", None),
(CS_ARCH_ALPHA, 0, ALPHA_CODE, "Alpha", None),
(CS_ARCH_ALPHA, CS_MODE_LITTLE_ENDIAN, ALPHA_CODE, "Alpha (Little-endian)", None),
(CS_ARCH_ALPHA, CS_MODE_BIG_ENDIAN, ALPHA_CODE_BE, "Alpha (Big-endian)", None),
)
# ## Test cs_disasm_quick()

View File

@ -31,6 +31,7 @@ M680X_CODE = b"\x06\x10\x19\x1a\x55\x1e\x01\x23\xe9\x31\x06\x34\x55\xa6\x81\xa7\
MOS65XX_CODE = b"\x0A\x00\xFE\x34\x12\xD0\xFF\xEA\x19\x56\x34\x46\x80"
EBPF_CODE = b"\x97\x09\x00\x00\x37\x13\x03\x00\xdc\x02\x00\x00\x20\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\xdb\x3a\x00\x01\x00\x00\x00\x00\x84\x02\x00\x00\x00\x00\x00\x00\x6d\x33\x17\x02\x00\x00\x00\x00"
ALPHA_CODE = b'\x02\x00\xbb\x27\x50\x7a\xbd\x23\xd0\xff\xde\x23\x00\x00\x5e\xb7'
ALPHA_CODE_BE = b'\x27\xbb\x00\x02\x23\xbd\x7a\x50\x23\xde\xff\xd0\xb7\x5e\x00\x00'
all_tests = (
(CS_ARCH_X86, CS_MODE_16, X86_CODE16, "X86 16bit (Intel syntax)", None),
@ -58,7 +59,8 @@ all_tests = (
(CS_ARCH_M680X, CS_MODE_M680X_6809, M680X_CODE, "M680X_M6809", None),
(CS_ARCH_MOS65XX, 0, MOS65XX_CODE, "MOS65XX", None),
(CS_ARCH_BPF, CS_MODE_LITTLE_ENDIAN | CS_MODE_BPF_EXTENDED, EBPF_CODE, "eBPF", None),
(CS_ARCH_ALPHA, CS_MODE_LITTLE_ENDIAN, ALPHA_CODE, "Alpha", None),
(CS_ARCH_ALPHA, CS_MODE_LITTLE_ENDIAN, ALPHA_CODE, "Alpha (Little-endian)", None),
(CS_ARCH_ALPHA, CS_MODE_BIG_ENDIAN, ALPHA_CODE_BE, "Alpha (Big-endian)", None),
)

View File

@ -29,6 +29,7 @@ XCORE_CODE = b"\xfe\x0f\xfe\x17\x13\x17\xc6\xfe\xec\x17\x97\xf8\xec\x4f\x1f\xfd\
M68K_CODE = b"\xd4\x40\x87\x5a\x4e\x71\x02\xb4\xc0\xde\xc0\xde\x5c\x00\x1d\x80\x71\x12\x01\x23\xf2\x3c\x44\x22\x40\x49\x0e\x56\x54\xc5\xf2\x3c\x44\x00\x44\x7a\x00\x00\xf2\x00\x0a\x28\x4E\xB9\x00\x00\x00\x12\x4E\x75"
M680X_CODE = b"\x06\x10\x19\x1a\x55\x1e\x01\x23\xe9\x31\x06\x34\x55\xa6\x81\xa7\x89\x7f\xff\xa6\x9d\x10\x00\xa7\x91\xa6\x9f\x10\x00\x11\xac\x99\x10\x00\x39"
ALPHA_CODE = b'\x02\x00\xbb\x27\x50\x7a\xbd\x23\xd0\xff\xde\x23\x00\x00\x5e\xb7'
ALPHA_CODE_BE = b'\x27\xbb\x00\x02\x23\xbd\x7a\x50\x23\xde\xff\xd0\xb7\x5e\x00\x00'
all_tests = (
@ -57,7 +58,8 @@ all_tests = (
(CS_ARCH_XCORE, 0, XCORE_CODE, "XCore", None),
(CS_ARCH_M68K, CS_MODE_BIG_ENDIAN | CS_MODE_M68K_040, M68K_CODE, "M68K (68040)", None),
(CS_ARCH_M680X, CS_MODE_M680X_6809, M680X_CODE, "M680X_M6809", None),
(CS_ARCH_ALPHA, 0, ALPHA_CODE, "Alpha", None),
(CS_ARCH_ALPHA, CS_MODE_LITTLE_ENDIAN, ALPHA_CODE, "Alpha (Little-endian)", None),
(CS_ARCH_ALPHA, CS_MODE_BIG_ENDIAN, ALPHA_CODE_BE, "Alpha (Big-endian)", None),
)
# ## Test class Cs

2
cs.c
View File

@ -260,7 +260,7 @@ static const struct {
{
ALPHA_global_init,
ALPHA_option,
0,
~(CS_MODE_LITTLE_ENDIAN | CS_MODE_BIG_ENDIAN),
},
#else
{ NULL, NULL, 0 },

View File

@ -114,7 +114,8 @@ static struct {
{ "tc160", CS_ARCH_TRICORE, CS_MODE_TRICORE_160 },
{ "tc161", CS_ARCH_TRICORE, CS_MODE_TRICORE_161 },
{ "tc162", CS_ARCH_TRICORE, CS_MODE_TRICORE_162 },
{ "alpha", CS_ARCH_ALPHA, 0 },
{ "alpha", CS_ARCH_ALPHA, CS_MODE_LITTLE_ENDIAN },
{ "alphabe", CS_ARCH_ALPHA, CS_MODE_BIG_ENDIAN },
{ NULL }
};
@ -210,7 +211,8 @@ static void usage(char *prog)
}
if (cs_support(CS_ARCH_ALPHA)) {
printf(" alpha alpha\n");
printf(" alpha alpha + little endian\n");
printf(" alphabe alpha + big endian\n");
}
if (cs_support(CS_ARCH_MIPS)) {

View File

@ -0,0 +1,199 @@
# CS_ARCH_ALPHA, CS_MODE_BIG_ENDIAN, None
0x40,0x22,0x00,0x03 = addl $1,$2,$3
0x40,0x3b,0xd0,0x03 = addl $1,0xde,$3
0x40,0x22,0x04,0x03 = addq $1,$2,$3
0x40,0x3b,0xd4,0x03 = addq $1,0xde,$3
0x58,0x22,0xb0,0x03 = adds/su $f1,$f10,$f11
0x58,0x22,0xb4,0x03 = addt/su $f1,$f10,$f11
0x44,0x22,0x00,0x03 = and $1,$2,$3
0x44,0x3b,0xd0,0x03 = and $1,0xde,$3
0xe4,0x20,0x3f,0xfc = beq $1,0xfffffffffffffff4
0xf8,0x20,0x3f,0xfc = bge $1,0xfffffffffffffff4
0xfc,0x20,0x3f,0xfc = bgt $1,0xfffffffffffffff4
0x44,0x22,0x01,0x03 = bic $1,$2,$3
0x44,0x3b,0xd1,0x03 = bic $1,0xde,$3
0x44,0x22,0x04,0x03 = bis $1,$2,$3
0x44,0x3b,0xd4,0x03 = bis $1,0xde,$3
0xe0,0x20,0x3f,0xfc = blbc $1,0xfffffffffffffff4
0xf0,0x20,0x3f,0xfc = blbs $1,0xfffffffffffffff4
0xec,0x20,0x3f,0xfc = ble $1,0xfffffffffffffff4
0xe8,0x20,0x3f,0xfc = blt $1,0xfffffffffffffff4
0xf4,0x20,0x3f,0xfc = bne $1,0xfffffffffffffff4
0xc3,0xe0,0x3f,0xfc = br $31,0xfffffffffffffff4
0xd3,0x40,0x3f,0xfc = bsr $26,$0xfffffffffffffff4 ..ng
0x44,0x22,0x04,0x83 = cmoveq $1,$2,$3
0x44,0x22,0x08,0xc3 = cmovge $1,$2,$3
0x44,0x22,0x0c,0xc3 = cmovgt $1,$2,$3
0x44,0x22,0x02,0xc3 = cmovlbc $1,$2,$3
0x44,0x22,0x02,0x83 = cmovlbs $1,$2,$3
0x44,0x22,0x0c,0x83 = cmovle $1,$2,$3
0x44,0x22,0x08,0x83 = cmovlt $1,$2,$3
0x44,0x22,0x04,0xc3 = cmovne $1,$2,$3
0x40,0x22,0x01,0xe3 = cmpbge $1,$2,$3
0x40,0x3b,0xd1,0xe3 = cmpbge $1,0xde,$3
0x40,0x22,0x05,0xa3 = cmpeq $1,$2,$3
0x40,0x3b,0xd5,0xa3 = cmpeq $1,0xde,$3
0x40,0x22,0x0d,0xa3 = cmple $1,$2,$3
0x40,0x3b,0xdd,0xa3 = cmple $1,0xde,$3
0x40,0x22,0x09,0xa3 = cmplt $1,$2,$3
0x40,0x3b,0xd9,0xa3 = cmplt $1,0xde,$3
0x58,0x22,0xb4,0xa3 = cmpteq/su $f1,$f10,$f11
0x58,0x22,0xb4,0xe3 = cmptle/su $f1,$f10,$f11
0x58,0x22,0xb4,0xc3 = cmptlt/su $f1,$f10,$f11
0x58,0x22,0xb4,0x83 = cmptun/su $f1,$f10,$f11
0x40,0x22,0x07,0xa3 = cmpule $1,$2,$3
0x40,0x3b,0xd7,0xa3 = cmpule $1,0xde,$3
0x40,0x22,0x03,0xa3 = cmpult $1,$2,$3
0x40,0x3b,0xd3,0xa3 = cmpult $1,0xde,$3
0x5c,0x22,0x04,0x43 = cpyse $f1,$f10,$f11
0x5c,0x22,0x04,0x23 = cpysn $f1,$f10,$f11
0x5c,0x22,0x04,0x03 = cpys $f1,$f10,$f11
0x73,0xe1,0x06,0x42 = ctlz $1,$2
0x73,0xe1,0x06,0x02 = ctpop $1,$2
0x73,0xe1,0x06,0x62 = cttz $1,$2
0x5b,0xe1,0xf7,0x82 = cvtqs/sui $f1,$f10
0x5b,0xe1,0xf7,0xc2 = cvtqt/sui $f1,$f10
0x5b,0xe1,0xd5,0x82 = cvtst/s $f1,$f10
0x5b,0xe1,0xa5,0xe2 = cvttq/svc $f1,$f10
0x5b,0xe1,0xf5,0x82 = cvtts/sui $f1,$f10
0x58,0x22,0xb0,0x63 = divs/su $f1,$f10,$f11
0x58,0x22,0xb4,0x63 = divt/su $f1,$f10,$f11
0x63,0xe1,0xe8,0x00 = ecb ($1)
0x44,0x22,0x09,0x03 = eqv $1,$2,$3
0x44,0x3b,0xd9,0x03 = eqv $1,0xde,$3
0x60,0x00,0x04,0x00 = excb
0x48,0x22,0x00,0xc3 = extbl $1,$2,$3
0x48,0x3b,0xd0,0xc3 = extbl $1,0xde,$3
0x48,0x22,0x0d,0x43 = extlh $1,$2,$3
0x48,0x3b,0xdd,0x43 = extlh $1,0xde,$3
0x48,0x22,0x04,0xc3 = extll $1,$2,$3
0x48,0x3b,0xd4,0xc3 = extll $1,0xde,$3
0x48,0x22,0x0f,0x43 = extqh $1,$2,$3
0x48,0x3b,0xdf,0x43 = extqh $1,0xde,$3
0x48,0x22,0x06,0xc3 = extql $1,$2,$3
0x48,0x3b,0xd6,0xc3 = extql $1,0xde,$3
0x48,0x22,0x0b,0x43 = extwh $1,$2,$3
0x48,0x3b,0xdb,0x43 = extwh $1,0xde,$3
0x48,0x22,0x02,0xc3 = extwl $1,$2,$3
0x48,0x3b,0xd2,0xc3 = extwl $1,0xde,$3
0xc4,0x20,0x3f,0xfc = fbeq $f1,0xfffffffffffffff4
0xd8,0x20,0x3f,0xfc = fbge $f1,0xfffffffffffffff4
0xdc,0x20,0x3f,0xfc = fbgt $f1,0xfffffffffffffff4
0xcc,0x20,0x3f,0xfc = fble $f1,0xfffffffffffffff4
0xc8,0x20,0x3f,0xfc = fblt $f1,0xfffffffffffffff4
0xd4,0x20,0x3f,0xfc = fbne $f1,0xfffffffffffffff4
0x5c,0x22,0x05,0x43 = fcmoveq ,$f10,$f11
0x5c,0x22,0x05,0xa3 = fcmovge ,$f10,$f11
0x5c,0x22,0x05,0xe3 = fcmovgt ,$f10,$f11
0x5c,0x22,0x05,0xc3 = fcmovle ,$f10,$f11
0x5c,0x22,0x05,0x83 = fcmovlt ,$f10,$f11
0x5c,0x22,0x05,0x63 = fcmovne ,$f10,$f11
0x63,0xe1,0x80,0x00 = fetch ($1)
0x63,0xe1,0xa0,0x00 = fetch_m ($1)
0x70,0x3f,0x0f,0x01 = ftois $f1,$1
0x70,0x3f,0x0e,0x01 = ftoit $f1,$1
0x48,0x22,0x01,0x63 = insbl $1,$2,$3
0x48,0x3b,0xd1,0x63 = insbl $1,0xde,$3
0x48,0x22,0x0c,0xe3 = inslh $1,$2,$3
0x48,0x3b,0xdc,0xe3 = inslh $1,0xde,$3
0x48,0x22,0x05,0x63 = insll $1,$2,$3
0x48,0x3b,0xd5,0x63 = insll $1,0xde,$3
0x48,0x22,0x0e,0xe3 = insqh $1,$2,$3
0x48,0x3b,0xde,0xe3 = insqh $1,0xde,$3
0x48,0x22,0x07,0x63 = insql $1,$2,$3
0x48,0x3b,0xd7,0x63 = insql $1,0xde,$3
0x48,0x22,0x0a,0xe3 = inswh $1,$2,$3
0x48,0x3b,0xda,0xe3 = inswh $1,0xde,$3
0x48,0x22,0x03,0x63 = inswl $1,$2,$3
0x48,0x3b,0xd3,0x63 = inswl $1,0xde,$3
0x50,0x3f,0x00,0x81 = itofs $1,$f1
0x50,0x3f,0x04,0x81 = itoft $1,$f1
0x6b,0xfa,0x00,0x00 = jmp $31,$12,0
0x6b,0x5b,0x40,0x00 = jsr $26,($27),0
0x68,0x22,0xcf,0xff = jsr_coroutine $1,($2),0xfff
0x20,0x22,0x00,0x10 = lda $1,0x10($2)
0x24,0x22,0x00,0x10 = ldah $1,0x10($2)
0x28,0x22,0x00,0x10 = ldbu $1,0x10($2)
0xa0,0x22,0x00,0x10 = ldl $1,0x10($2)
0xa8,0x22,0x00,0x10 = ldl_l $1,0x10($2)
0xa4,0x22,0x00,0x10 = ldq $1,0x10($2)
0xac,0x22,0x00,0x10 = ldq_l $1,0x10($2)
0x2c,0x22,0x00,0x10 = ldq_u $1,0x10($2)
0x88,0x22,0x00,0x10 = lds $f1,0x10($2)
0x8c,0x22,0x00,0x10 = ldt $f1,0x10($2)
0x30,0x22,0x00,0x10 = ldwu $1,0x10($2)
0x60,0x00,0x40,0x00 = mb
0x48,0x22,0x00,0x43 = mskbl $1,$2,$3
0x48,0x3b,0xd0,0x43 = mskbl $1,0xde,$3
0x48,0x22,0x0c,0x43 = msklh $1,$2,$3
0x48,0x3b,0xdc,0x43 = msklh $1,0xde,$3
0x48,0x22,0x04,0x43 = mskll $1,$2,$3
0x48,0x3b,0xd4,0x43 = mskll $1,0xde,$3
0x48,0x22,0x0e,0x43 = mskqh $1,$2,$3
0x48,0x3b,0xde,0x43 = mskqh $1,0xde,$3
0x48,0x22,0x06,0x43 = mskql $1,$2,$3
0x48,0x3b,0xd6,0x43 = mskql $1,0xde,$3
0x48,0x22,0x0a,0x43 = mskwh $1,$2,$3
0x48,0x3b,0xda,0x43 = mskwh $1,0xde,$3
0x48,0x22,0x02,0x43 = mskwl $1,$2,$3
0x48,0x3b,0xd2,0x43 = mskwl $1,0xde,$3
0x4c,0x22,0x00,0x03 = mull $1,$2,$3
0x4c,0x3b,0xd0,0x03 = mull $1,0xde,$3
0x4c,0x22,0x04,0x03 = mulq $1,$2,$3
0x4c,0x3b,0xd4,0x03 = mulq $1,0xde,$3
0x58,0x22,0xb0,0x43 = muls/su $f1,$f10,$f11
0x58,0x22,0xb4,0x43 = mult/su $f1,$f10,$f11
0x44,0x22,0x05,0x03 = ornot $1,$2,$3
0x44,0x3b,0xd5,0x03 = ornot $1,0xde,$3
0x60,0x20,0xe0,0x00 = rc $1
0x6b,0xfa,0x80,0x01 = ret $31,($26),1
0x60,0x1f,0xc0,0x00 = rpcc $0
0x60,0x20,0xf0,0x00 = rs $1
0x40,0x22,0x00,0x43 = s4addl $1,$2,$3
0x40,0x3b,0xd0,0x43 = s4addl $1,0xde,$3
0x40,0x22,0x01,0x63 = s4subl $1,$2,$3
0x40,0x3b,0xd1,0x63 = s4subl $1,0xde,$3
0x40,0x22,0x05,0x63 = s4subq $1,$2,$3
0x40,0x3b,0xd5,0x63 = s4subq $1,0xde,$3
0x40,0x22,0x02,0x43 = s8addl $1,$2,$3
0x40,0x3b,0xd2,0x43 = s8addl $1,0xde,$3
0x40,0x22,0x06,0x43 = s8addq $1,$2,$3
0x40,0x3b,0xd6,0x43 = s8addq $1,0xde,$3
0x40,0x22,0x03,0x63 = s8subl $1,$2,$3
0x40,0x3b,0xd3,0x63 = s8subl $1,0xde,$3
0x40,0x22,0x07,0x63 = s8subq $1,$2,$3
0x40,0x3b,0xd7,0x63 = s8subq $1,0xde,$3
0x73,0xe1,0x00,0x02 = sextb $1,$2
0x73,0xe1,0x00,0x22 = sextw $1,$2
0x48,0x22,0x07,0x23 = sll $1,$2,$3
0x48,0x3b,0xd7,0x23 = sll $1,0xde,$3
0x53,0xe1,0xb1,0x62 = sqrts/su $f1,$f10
0x53,0xe1,0xb5,0x62 = sqrtt/su $f1,$f10
0x48,0x22,0x07,0x83 = sra $1,$2,$3
0x48,0x3b,0xd7,0x83 = sra $1,0xde,$3
0x48,0x22,0x06,0x83 = srl $1,$2,$3
0x48,0x3b,0xd6,0x83 = srl $1,0xde,$3
0x38,0x22,0x00,0x10 = stb $1, 0x10($2)
0xb0,0x22,0x00,0x10 = stl $1,0x10($2)
0xb8,0x22,0x00,0x10 = stl_c $1,0x10($2)
0xb4,0x22,0x00,0x10 = stq $1,0x10($2)
0xbc,0x22,0x00,0x10 = stq_c $1,0x10($2)
0x3c,0x22,0x00,0x10 = stq_u $1, 0x10($2)
0x98,0x22,0x00,0x10 = sts $f1,0x10($2)
0x9c,0x22,0x00,0x10 = stt $f1,0x10($2)
0x34,0x22,0x00,0x10 = stw $1,0x10($2)
0x40,0x22,0x01,0x23 = subl $1,$2,$3
0x40,0x3b,0xd1,0x23 = subl $1,0xde,$3
0x40,0x22,0x05,0x23 = subq $1,$2,$3
0x40,0x3b,0xd5,0x23 = subq $1,0xde,$3
0x58,0x22,0xb0,0x23 = subs/su $f1,$f10,$f11
0x58,0x22,0xb4,0x23 = subt/su $f1,$f10,$f11
0x60,0x00,0x00,0x00 = trapb
0x4c,0x22,0x06,0x03 = umulh $1,$2,$3
0x4c,0x3b,0xd6,0x03 = umulh $1,0xde,$3
0x63,0xe1,0xf8,0x00 = wh64 ($1)
0x63,0xe1,0xfc,0x00 = wh64en ($1)
0x60,0x00,0x44,0x00 = wmb
0x44,0x22,0x08,0x03 = xor $1,$2,$3
0x44,0x3b,0xd8,0x03 = xor $1,0xde,$3
0x48,0x3b,0xd6,0x23 = zapnot $1,0xde,$3

View File

@ -117,6 +117,7 @@ def test_file(fname):
("CS_ARCH_TRICORE", "CS_MODE_TRICORE_162"): 53,
("CS_ARCH_PPC", "CS_MODE_BIG_ENDIAN+CS_MODE_QPX"): 54,
("CS_ARCH_ALPHA", "CS_MODE_LITTLE_ENDIAN"): 55,
("CS_ARCH_ALPHA", "CS_MODE_BIG_ENDIAN"): 56,
}
#if not option in ('', 'None'):

View File

@ -127,6 +127,7 @@ def test_file(fname):
("CS_ARCH_TRICORE", "CS_MODE_TRICORE_162"): 53,
("CS_ARCH_PPC", "CS_MODE_BIG_ENDIAN+CS_MODE_QPX"): 54,
("CS_ARCH_ALPHA", "CS_MODE_LITTLE_ENDIAN"): 55,
("CS_ARCH_ALPHA", "CS_MODE_BIG_ENDIAN"): 56,
}
# if not option in ('', 'None'):

View File

@ -64,14 +64,23 @@ static void test()
{
#define ALPHA_CODE \
"\x02\x00\xbb\x27\x50\x7a\xbd\x23\xd0\xff\xde\x23\x00\x00\x5e\xb7"
#define ALPHA_CODE_BE \
"\x27\xbb\x00\x02\x23\xbd\x7a\x50\x23\xde\xff\xd0\xb7\x5e\x00\x00"
struct platform platforms[] = {
{
CS_ARCH_ALPHA,
0,
CS_MODE_LITTLE_ENDIAN,
(unsigned char *)ALPHA_CODE,
sizeof(ALPHA_CODE) - 1,
"Alpha",
"Alpha (Little-endian)",
},
{
CS_ARCH_ALPHA,
CS_MODE_BIG_ENDIAN,
(unsigned char *)ALPHA_CODE_BE,
sizeof(ALPHA_CODE) - 1,
"Alpha (Big-endian)",
},
};

View File

@ -93,6 +93,7 @@ static void test()
#endif
#ifdef CAPSTONE_HAS_ALPHA
#define ALPHA_CODE "\x02\x00\xbb\x27\x50\x7a\xbd\x23\xd0\xff\xde\x23\x00\x00\x5e\xb7"
#define ALPHA_CODE_BE "\x27\xbb\x00\x02\x23\xbd\x7a\x50\x23\xde\xff\xd0\xb7\x5e\x00\x00"
#endif
struct platform {
@ -373,7 +374,14 @@ static void test()
CS_MODE_LITTLE_ENDIAN,
(unsigned char*)ALPHA_CODE,
sizeof(ALPHA_CODE) - 1,
"Alpha"
"Alpha (Little-endian)"
},
{
CS_ARCH_ALPHA,
CS_MODE_BIG_ENDIAN,
(unsigned char*)ALPHA_CODE_BE,
sizeof(ALPHA_CODE) - 1,
"Alpha (Big-endian)"
},
#endif
};

View File

@ -80,6 +80,7 @@ static void test()
#endif
#ifdef CAPSTONE_HAS_ALPHA
#define ALPHA_CODE "\x02\x00\xbb\x27\x50\x7a\xbd\x23\xd0\xff\xde\x23\x00\x00\x5e\xb7"
#define ALPHA_CODE_BE "\x27\xbb\x00\x02\x23\xbd\x7a\x50\x23\xde\xff\xd0\xb7\x5e\x00\x00"
#endif
struct platform platforms[] = {
@ -290,7 +291,14 @@ static void test()
CS_MODE_LITTLE_ENDIAN,
(unsigned char*)ALPHA_CODE,
sizeof(ALPHA_CODE) - 1,
"Alpha"
"Alpha (Little-endian)"
},
{
CS_ARCH_ALPHA,
CS_MODE_BIG_ENDIAN,
(unsigned char*)ALPHA_CODE_BE,
sizeof(ALPHA_CODE) - 1,
"Alpha (Big-endian)"
},
#endif
};

View File

@ -81,6 +81,7 @@ static void test()
#ifdef CAPSTONE_HAS_ALPHA
#define ALPHA_CODE "\x02\x00\xbb\x27\x50\x7a\xbd\x23\xd0\xff\xde\x23\x00\x00\x5e\xb7"
#define ALPHA_CODE_BE "\x27\xbb\x00\x02\x23\xbd\x7a\x50\x23\xde\xff\xd0\xb7\x5e\x00\x00"
#endif
struct platform platforms[] = {
@ -269,10 +270,17 @@ struct platform platforms[] = {
#ifdef CAPSTONE_HAS_ALPHA
{
CS_ARCH_ALPHA,
0,
CS_MODE_LITTLE_ENDIAN,
(unsigned char*)ALPHA_CODE,
sizeof(ALPHA_CODE) - 1,
"Alpha"
"Alpha (Little-endian)"
},
{
CS_ARCH_ALPHA,
CS_MODE_BIG_ENDIAN,
(unsigned char*)ALPHA_CODE_BE,
sizeof(ALPHA_CODE) - 1,
"Alpha (Big-endian)"
},
#endif
};