Norimasa Okamoto
/
pymite
python-on-a-chip online compiler
- http://pymbed.appspot.com/
- https://code.google.com/p/python-on-a-chip/
- http://www.youtube.com/watch?v=Oyqc2bFRW9I
- https://bitbucket.org/va009039/pymbed/
more info: python-on-a-chip
Diff: vm/interp.h
- Revision:
- 1:28afb064a41c
- Parent:
- 0:65f1469d6bfb
--- a/vm/interp.h Sat Mar 02 11:54:20 2013 +0000 +++ b/vm/interp.h Sun Mar 10 10:13:36 2013 +0000 @@ -86,6 +86,267 @@ */ typedef enum PmBcode_e { +#ifdef HAVE_PYTHON27 + STOP_CODE=0, /* 0x00 */ + POP_TOP=1, /* 0x01 */ + ROT_TWO=2, /* 0x02 */ + ROT_THREE=3, /* 0x03 */ + DUP_TOP=4, /* 0x04 */ + ROT_FOUR=5, /* 0x05 */ + UNUSED_06=6, + UNUSED_07=7, + UNUSED_08=8, + NOP=9, /* 0x09 */ + UNARY_POSITIVE=10, /* 0x0a */ + UNARY_NEGATIVE=11, /* 0x0b */ + UNARY_NOT=12, /* 0x0c */ + UNARY_CONVERT=13, /* 0x0d */ + UNUSED_0E=14, + UNARY_INVERT=15, /* 0x0f */ + UNUSED_10=16, + UNUSED_11=17, + UNUSED_12=18, + BINARY_POWER=19, /* 0x13 */ + BINARY_MULTIPLY=20, /* 0x14 */ + BINARY_DIVIDE=21, /* 0x15 */ + BINARY_MODULO=22, /* 0x16 */ + BINARY_ADD=23, /* 0x17 */ + BINARY_SUBTRACT=24, /* 0x18 */ + BINARY_SUBSCR=25, /* 0x19 */ + BINARY_FLOOR_DIVIDE=26, /* 0x1a */ + BINARY_TRUE_DIVIDE=27, /* 0x1b */ + INPLACE_FLOOR_DIVIDE=28, /* 0x1c */ + INPLACE_TRUE_DIVIDE=29, /* 0x1d */ + SLICE_0=30, /* 0x1e */ + SLICE_1=31, /* 0x1f */ + SLICE_2=32, /* 0x20 */ + SLICE_3=33, /* 0x21 */ + UNUSED_22=34, + UNUSED_23=35, + UNUSED_24=36, + UNUSED_25=37, + UNUSED_26=38, + UNUSED_27=39, + STORE_SLICE_0=40, /* 0x28 */ + STORE_SLICE_1=41, /* 0x29 */ + STORE_SLICE_2=42, /* 0x2a */ + STORE_SLICE_3=43, /* 0x2b */ + UNUSED_2C=44, + UNUSED_2D=45, + UNUSED_2E=46, + UNUSED_2F=47, + UNUSED_30=48, + UNUSED_31=49, + DELETE_SLICE_0=50, /* 0x32 */ + DELETE_SLICE_1=51, /* 0x33 */ + DELETE_SLICE_2=52, /* 0x34 */ + DELETE_SLICE_3=53, /* 0x35 */ + STORE_MAP=54, /* 0x36 */ + INPLACE_ADD=55, /* 0x37 */ + INPLACE_SUBTRACT=56, /* 0x38 */ + INPLACE_MULTIPLY=57, /* 0x39 */ + INPLACE_DIVIDE=58, /* 0x3a */ + INPLACE_MODULO=59, /* 0x3b */ + STORE_SUBSCR=60, /* 0x3c */ + DELETE_SUBSCR=61, /* 0x3d */ + BINARY_LSHIFT=62, /* 0x3e */ + BINARY_RSHIFT=63, /* 0x3f */ + BINARY_AND=64, /* 0x40 */ + BINARY_XOR=65, /* 0x41 */ + BINARY_OR=66, /* 0x42 */ + INPLACE_POWER=67, /* 0x43 */ + GET_ITER=68, /* 0x44 */ + UNUSED_45=69, + PRINT_EXPR=70, /* 0x46 */ + PRINT_ITEM=71, /* 0x47 */ + PRINT_NEWLINE=72, /* 0x48 */ + PRINT_ITEM_TO=73, /* 0x49 */ + PRINT_NEWLINE_TO=74, /* 0x4a */ + INPLACE_LSHIFT=75, /* 0x4b */ + INPLACE_RSHIFT=76, /* 0x4c */ + INPLACE_AND=77, /* 0x4d */ + INPLACE_XOR=78, /* 0x4e */ + INPLACE_OR=79, /* 0x4f */ + BREAK_LOOP=80, /* 0x50 */ + WITH_CLEANUP=81, /* 0x51 */ + LOAD_LOCALS=82, /* 0x52 */ + RETURN_VALUE=83, /* 0x53 */ + IMPORT_STAR=84, /* 0x54 */ + EXEC_STMT=85, /* 0x55 */ + YIELD_VALUE=86, /* 0x56 */ + POP_BLOCK=87, /* 0x57 */ + END_FINALLY=88, /* 0x58 */ + BUILD_CLASS=89, /* 0x59 */ + + /* Opcodes from here have an argument */ + HAVE_ARGUMENT=90, /* 0x5a */ + STORE_NAME=90, /* 0x5a */ + DELETE_NAME=91, /* 0x5b */ + UNPACK_SEQUENCE=92, /* 0x5c */ + FOR_ITER=93, /* 0x5d */ + LIST_APPEND=94, /* 0x5e */ + STORE_ATTR=95, /* 0x5f */ + DELETE_ATTR=96, /* 0x60 */ + STORE_GLOBAL=97, /* 0x61 */ + DELETE_GLOBAL=98, /* 0x62 */ + DUP_TOPX=99, /* 0x63 */ + LOAD_CONST=100, /* 0x64 */ + LOAD_NAME=101, /* 0x65 */ + BUILD_TUPLE=102, /* 0x66 */ + BUILD_LIST=103, /* 0x67 */ + BUILD_SET=104, /* 0x68 */ + BUILD_MAP=105, /* 0x69 */ + LOAD_ATTR=106, /* 0x6a */ + COMPARE_OP=107, /* 0x6b */ + IMPORT_NAME=108, /* 0x6c */ + IMPORT_FROM=109, /* 0x6d */ + JUMP_FORWARD=110, /* 0x6e */ + JUMP_IF_FALSE_OR_POP=111, /* 0x6f */ + JUMP_IF_TRUE_OR_POP=112, /* 0x70 */ + JUMP_ABSOLUTE=113, /* 0x71 */ + POP_JUMP_IF_FALSE=114, /* 0x72 */ + POP_JUMP_IF_TRUE=115, /* 0x73 */ + LOAD_GLOBAL=116, /* 0x74 */ + UNUSED_75=117, + UNUSED_76=118, + CONTINUE_LOOP=119, /* 0x77 */ + SETUP_LOOP=120, /* 0x78 */ + SETUP_EXCEPT=121, /* 0x79 */ + SETUP_FINALLY=122, /* 0x7a */ + UNUSED_7B=123, + LOAD_FAST=124, /* 0x7c */ + STORE_FAST=125, /* 0x7d */ + DELETE_FAST=126, /* 0x7e */ + UNUSED_7F=127, + UNUSED_80=128, + UNUSED_81=129, + RAISE_VARARGS=130, /* 0x82 */ + CALL_FUNCTION=131, /* 0x83 */ + MAKE_FUNCTION=132, /* 0x84 */ + BUILD_SLICE=133, /* 0x85 */ + MAKE_CLOSURE=134, /* 0x86 */ + LOAD_CLOSURE=135, /* 0x87 */ + LOAD_DEREF=136, /* 0x88 */ + STORE_DEREF=137, /* 0x89 */ + UNUSED_8A=138, + UNUSED_8B=139, + CALL_FUNCTION_VAR=140, /* 0x8c */ + CALL_FUNCTION_KW=141, /* 0x8d */ + CALL_FUNCTION_VAR_KW=142, /* 0x8e */ + SETUP_WITH=143, /* 0x8f */ + UNUSED_90=144, + EXTENDED_ARG=145, /* 0x91 */ + SET_ADD=146, /* 0x92 */ + MAP_ADD=147, /* 0x93 */ + UNUSED_94=148, + UNUSED_95=149, + UNUSED_96=150, + UNUSED_97=151, + UNUSED_98=152, + UNUSED_99=153, + UNUSED_9A=154, + UNUSED_9B=155, + UNUSED_9C=156, + UNUSED_9D=157, + UNUSED_9E=158, + UNUSED_9F=159, + UNUSED_A0=160, + UNUSED_A1=161, + UNUSED_A2=162, + UNUSED_A3=163, + UNUSED_A4=164, + UNUSED_A5=165, + UNUSED_A6=166, + UNUSED_A7=167, + UNUSED_A8=168, + UNUSED_A9=169, + UNUSED_AA=170, + UNUSED_AB=171, + UNUSED_AC=172, + UNUSED_AD=173, + UNUSED_AE=174, + UNUSED_AF=175, + UNUSED_B0=176, + UNUSED_B1=177, + UNUSED_B2=178, + UNUSED_B3=179, + UNUSED_B4=180, + UNUSED_B5=181, + UNUSED_B6=182, + UNUSED_B7=183, + UNUSED_B8=184, + UNUSED_B9=185, + UNUSED_BA=186, + UNUSED_BB=187, + UNUSED_BC=188, + UNUSED_BD=189, + UNUSED_BE=190, + UNUSED_BF=191, + UNUSED_C0=192, + UNUSED_C1=193, + UNUSED_C2=194, + UNUSED_C3=195, + UNUSED_C4=196, + UNUSED_C5=197, + UNUSED_C6=198, + UNUSED_C7=199, + UNUSED_C8=200, + UNUSED_C9=201, + UNUSED_CA=202, + UNUSED_CB=203, + UNUSED_CC=204, + UNUSED_CD=205, + UNUSED_CE=206, + UNUSED_CF=207, + UNUSED_D0=208, + UNUSED_D1=209, + UNUSED_D2=210, + UNUSED_D3=211, + UNUSED_D4=212, + UNUSED_D5=213, + UNUSED_D6=214, + UNUSED_D7=215, + UNUSED_D8=216, + UNUSED_D9=217, + UNUSED_DA=218, + UNUSED_DB=219, + UNUSED_DC=220, + UNUSED_DD=221, + UNUSED_DE=222, + UNUSED_DF=223, + UNUSED_E0=224, + UNUSED_E1=225, + UNUSED_E2=226, + UNUSED_E3=227, + UNUSED_E4=228, + UNUSED_E5=229, + UNUSED_E6=230, + UNUSED_E7=231, + UNUSED_E8=232, + UNUSED_E9=233, + UNUSED_EA=234, + UNUSED_EB=235, + UNUSED_EC=236, + UNUSED_ED=237, + UNUSED_EE=238, + UNUSED_EF=239, + UNUSED_F0=240, + UNUSED_F1=241, + UNUSED_F2=242, + UNUSED_F3=243, + UNUSED_F4=244, + UNUSED_F5=245, + UNUSED_F6=246, + UNUSED_F7=247, + UNUSED_F8=248, + UNUSED_F9=249, + UNUSED_FA=250, + UNUSED_FB=251, + UNUSED_FC=252, + UNUSED_FD=253, + UNUSED_FE=254, + UNUSED_FF=255, +#else /* HAVE_PYTHON27 */ /* * Python source to create this list: * import dis @@ -272,6 +533,7 @@ UNUSED_F4, UNUSED_F5, UNUSED_F6, UNUSED_F7, UNUSED_F8, UNUSED_F9, UNUSED_FA, UNUSED_FB, UNUSED_FC, UNUSED_FD, UNUSED_FE, UNUSED_FF +#endif /* HAVE_PYTHON27 */ } PmBcode_t, *pPmBcode_t;