⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmplc56k.h

📁 美国Delta Tau公司PMAC多轴运动控制卡的VC++示例程序
💻 H
📖 第 1 页 / 共 2 页
字号:
                                 // 0x0A7057          BCLR    #23,Y:$D000
#define BSETXMEM        0x0A7020 // BSET    #0,X:$D000
                                 //
                                 //      UNPACK Inline Code - Uses 3 vs 2 for JSR
                                 //
#define UNPACK0         0x0C1881 //   EXTRACTU #$00C000,A,B ; EXTRACT EXPONENT
#define UNPACK1         0x00C000
#define UNPACK2         0x213514 //   SUB   B,A   B0,R5     ; REMOVE EXPONENT FROM MANTISA
                                 //
                                 //      Other 56K code
                                 //
#define MOVEMPRtoR1     0x07ED91 // MOVEM P:(R5+N5),R1
#define MOVILtoX1       0x45F400 // MOV IMMEDIATE LONG TO REG 'X1'
#define MOVItoX1        0x250000 // MOVE #<n,X1 + (n << 8)
#define MOVILtoX0       0x44F400 // MOV IMMEDIATE LONG TO REG 'X0'
#define MOVM5toX1       0x254000 // MOV IMMED .5 mantisa to X1
#define MOVPQtoA        0x48F000 // MOV P or Q TO A ( MOVE L:P000 ,A )
#define MOVPQtoX        0x42F000 // MOV P or Q TO X ( MOVE L:P000 ,X )
#define MOVAtoPQ        0x487000 // MOV A to P     ( MOVE A,L:P000 )
#define MOVAtoSTK       0x487F00 // MOV A to STACK ( MOVE A,L:-(R7) )
#define MOVBtoSTK       0x497F00 // MOV B to STACK ( MOVE B,L:-(R7) )
#define MOVXtoSTK       0x427F00 // MOV X to STACK ( MOVE X,L:-(R7) )
#define MOVSTKtoX       0x42DF00 // MOV STACK to X ( MOVE L:(R7)+,X )
#define MOVSTKNtoX      0x42E700 // MOV STACK to X ( MOVE L:(R7),X )
#define MOVSTKtoA       0x48DF00 // MOV STACK to A ( MOVE L:(R7)+,A )
#define TFRABSTKtoA     0x48DF09 // TFR A,B STACK to A ( TFR A,B L:(R7)+,A )
#define TFRABSTKNtoA    0x48E709 // TFR A,B STACK to A ( TFR A,B L:(R7),A )
#define MOVR1toXSTK     0x617F00 // MOVE R1,X:-(R7)
#define MOVXSTKtoR1     0x61DF00 // MOVE X:(R7)+,R1
#define MOVI79toM1      0x054FA1 // MOVE #79,M1
#define MOVM0toM1       0x0461A0 // MOVE M0,M1
#define SUBX0A          0x200044 // SUB  X0,A
#define CMPBtoA         0x200000 // CMP  B,A
#define TGTBtoA         0x200000 // TGT  B,A
#define JCC             0x0AF0A0 // JCC Carry Clr
#define JGE             0x0AF0A1 // JMP >=
#define JNE             0x0AF0A2 // JMP !=
#define JGT             0x0AF0A7 // JMP >
#define JCS             0x0AF0A8 // JCS Carry Set
#define JLT             0x0AF0A9 // JMP <
#define JEQ             0x0AF0AA // JMP =
#define JLE             0x0AF0AF // JMP <=
#define JMP             0x0AF080 // JMP LONG
#define RTS             0x00000C // RET from S/R
#define NOP             0        // NOP
#define BEQ             0x05A400 // BEQ + ( offset )
#define BRA             0x050C00 // BRA + ( offset ) B0-9, B5 is always Zero
#define BRAL            0x0D10C0 // BRA + Next address is 255 < displacement  < -256

//***************************************************************
//**  Conditional JMP Flag Defines **
//***************************************************************

#define JMP_TRUE        0x1000000 // Conditional JMP True flag
#define JMP_FALSE       0x2000000
#define IFWHL_START     0x4000000 // If - While Start Flag
#define ANDOR_START     0x8000000 // AND - OR CMD Start Flag
#define ENDWCODE        13        // End While code 56k locations

//****************************************************************************
//
//**    Defines for strings types for 56k code
//
//****************************************************************************

#define CMD             0 // Code for 1st word of string
#define SENDP           0x10
#define SENDS           0x20
#define SEND            0x30
                          //
                          //**    Defines for strings types for 56k Turbo code
                          //
#define TSENDP          0x14
#define TSENDR          0x24
#define TSENDS          0x34
#define TSENDA          0x44
#define TSENDM          0x54
#define TCMD            0x84

//***************************************************************
//**  Function Addresses **
//***************************************************************
#define I_SUB           0x0040CE
#define M_SUB           0x0040D6
#define P_SUB           0x0040DE
#define Q_SUB           0x0040E3
#define FSIN            0x000A2E
#define FCOS            0x000AC5
#define FTAN            0x000AF2
#define FABS            0x0008D9
#define FASIN           0x000BC3
#define FACOS           0x000BD0
#define FATAN           0x000BE9
#define FSQRT           0x000A01
#define FEXP            0x000D4A
#define FLN             0x000CDD
#define FINT            0x000DCD
#define FATAN2          0x000BDA

//***************************************************************
//**  Operator Addresses **
//***************************************************************

#define FADD_XA         0x0008E2
#define FSUB_XA         0x000918
#define FMPY_XA         0x00093E
#define FDIV_XA         0x000975
#define FOR_XA          0x0009D5
#define FEOR_XA         0x0009DB
#define FAND_XA         0x0009CF
#define FMOD_XA         0x0009A0
#define FSUB_AX         0x0008E1
#define FDIV_AX         0x000967
#define FMOD_AX         0x000993

//***************************************************************
//**  Other Addresses **
//***************************************************************

#define I_READ 0x001B23
#define M_READ 0x0015F7
#define I_WRITE 0x001B5F
#define M_WRITE 0x001768

#define FNEG            0x0008DD
#define FCMP_XA         0x000922
#define PACK            0x000DF4
#define UNPACK          0x000DE5
#define PLCENADIS       0x001C1C
#define PLCQ_BASE       0x005B29
#define MOVPDISP        0x00222F
#define FTOAF           0x000EF8

//***************************************************************
//**  OPEN SERVO STARTUP CODE **
//***************************************************************

#define SRV_RTN       0x04000B    // JMP     SRV_RTN
#define SERVO_BUFFER  0x040000    
#define SMTR_NUM      0x040015
#define SERVO_SIZE    0x014
#define FLIMIT        0x04001D

//***************************************************************
//**  OPEN MACPLCC STARTUP buffer && FIXED LINK VECTOR TABLE **
//***************************************************************

#define MACPLCC_BUF   0x04004
#define MACPLCC_SIZE  0x04000
#define MDIVX1A       0x4
#define MDIVAX1       0x5
#define MMODX1A       0x6
#define MMODAX1       0x7
#define MI_READ       0x8
#define MM_READ       0x9
#define MI_WRITE      0x0A
#define MM_WRITE      0x0B
#define CHN_WRITE     0x0C
#define ENDWMCODE     5        // End While MACRO code 56k locations
#define MP_TBL        0x400    // Macro Pnn Table start
//***************************************************************
//** Addresses that do not change **
//***************************************************************

#define PBUFFER         0x1000
#define TQ_BASE         0x2000            // Turbo C.S. 1 Q Base Address

#define TPBUFFER        0x6000
#define TQBUFFER        0x8000
#define PLCBUFFER       0x8000
#define PLCJMPOFF       0x20
#define PLCRETOFF       PLCJMPOFF + 2 * 32 // number of PLCC's * 2
                                           // #define PLCJMP          PLCBUFFER + PLCJMPOFF
                                           // #define PLCRET          PLCBUFFER + PLCRETOFF
                                           // #define PLCSTART        PLCRET + 2         // allow room for size of mem used
                                           // #define PLCCSIZE        PLCRET + 1         // PLCC size stored by compiler
#define PLCCEXSIZE      98                 // PLCC Executive size
#define PLCEND          16
#define DISPLAY         0x000780           // Display Buffer Addr
#define FPTEN           0x0007DE           // FPTEN Address Table
#define CMD_STACK       0x00075A           // PMAC PLC CMD Stack
#define PLCREQ          0x031              // TURB0 PLC CMD Stack(X: PLCn, Y: PLC0 )
#define PLC_IN_PTR      0x032              // TURB0 PLC INP END PTR(X: PLCn, Y: PLC0 )
#define PLCN_BUFFER     0x1A00             // TURBO PLCn1..31 BUFFER
#define PLC0_BUFFER     0x1900             // TURBO PLC 0 BUFFER
#define TDISPLAY        0x001080           // TURBO Display Buffer Addr
#define TFPTEN          0x0010DE           // TURBO FPTEN Address Table
#define TPLC0_EXT       0x0035C2           // TURBO PLC0_EXT RAM Address



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -