原创 HotC51汇编数组定义头文件(HotAsm.h V1.02)即将发布

2009-2-26 22:12 2911 6 6 分类: MCU/ 嵌入式
HotC51 发表于 2009-2-26 22:12 裸奔式实时操作系统HotTask51 ←返回版面 按此察看该网友的资料 按此把文章加入收藏夹 按此编辑本帖

楼主: HotC51汇编数组定义头文件(HotAsm.h V1.02)即将发布


/*------------------------------------------------------------
    HotC51汇编数组定义头文件(HotAsm.h V1.02)
最初建立时间: 2009.2.18
最近修改时间: 2009.2.26    (正在添加之中,最终将彻底替代嵌入汇编)
增  添原  因: 为全面支持裸奔式实时操作系统HotTask51做准备
              并替代年代久远的HotIns.h/c(不在HotTask51下使用)
应        用: 可以用COM接口技术对HotC51汇编数组进行封装
              实现比嵌入汇编更为灵活和更非典之用,“汇编数组”的
              出现,将程序战场蔓延至整个代码和数据区~~~
--------------------------------------------------------------
    HotTask51汇编数组调用函数库(正在添加之中,最后形成“水库”)
--------------------------------------------------------------
    第一步:编写汇编数组的“汇编代码” 参见HotIns.h/c
--------------------------------------------------------------
HotASM (__reset_comlib__)[] =
{//应该在C文件中编写
    HotASM_PUSH_DPL(),            
    HotASM_PUSH_DPH(),
    HotASM_RETI(),
    HotASM_CLR_A(),
    HotASM_PUSH_ACC(),            
    HotASM_PUSH_ACC(),
    HotASM_RETI(),
};
--------------------------------------------------------------
    第二步:编写普通C函数,注意它的名字与调用关系不大
--------------------------------------------------------------
void Reset()
{//此法只是演示如何替代HotIns.h/c  
    IE=0;
    DPTR = __reset_comlib__ + 5;
    _icall_(__reset_comlib__);
}
void Start()
{//此法只是演示如何替代HotIns.h/c  
    IE=0;
    PSW=0;
    _icall_(__reset_comlib__ + 4);
    _icall_(__reset_comlib__ + 4);
}
---------------------------------------------------
    第三步:编写COM接口,填入需要的C函数,
注意它的名称与调用次序关系很大,名称与调用关系不大
最后在HotAsm.h的接口里:
interface
{
    void (*HotAsm_Start)(void);
    void (*HotAsm_Reset)(void);
}IHotCom_AsmVtbl_Interface, *pIHotCom_AsmVtbl_Interface;

则在主程序里的函数名是asmLib.function.HotAsm_Reset();
----------------------------------------------------------------
IHotCom_Asm_Interface asmLib =//真实的COM接口
{
    (pHotAsmFunction)Start,//
    (pHotAsmFunction)Reset,
};

#include "hottask51.h"
void main()
{
    asmLib.function.HotAsm_Start();//二次RETI(HotC51将做专题)
    asmLib.function.HotAsm_Reset();//软件复位
    HotTaskStart();//此时任务永远不可能启动
}              
菜农HotPower@126.com 2008.2.26 于西安大雁塔村农会
---------------------------------------------------------------*/


/*--------------------------------------------------------------------------------------------
                HotASM51汇编指令集宏指令定义
  Rn(x)   Rn(0~7)                  asm_MOV_A,R0(), asm_MOV_A_Rn(5),      mov a,r0;mov a,r5;
@ iRn(x)  iRn(0~1)                  asm_MOV_A_iR1(), asm_MOVX_iRn_A(0), mov a,@r1;movx @r0,a;
! BIT(x)  BIT(0~0x7f, 0x80~0xff)  asm_CLR_BIT(0x30),asm_SETB_P0_0(),  clr 30h;setb p0.0;
& REG(x)  REG(0~0x7f, 0x80~0xff)  asm_MOV_REG_A(HotASM_B),              mov b,a;
# DATA(x) DATA(0~0xff, 0~0xffff)  asm_MOV_A_DATA(250),                  mov a,#250;
---------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------
NOP
指令名称:空操作指令
指令功能:不执行任何操作,常用于产生一个机器周期的时间延迟
操作内容:PC←(PC)+l
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_NOP(),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
    #define asm_NOP()               (HotASM_REG)0x00
/*--------------------------------------------------------------------------------------------
AJMP addr11
指令名称:绝对转移指令
指令功能:构造目的地址,实现程序转移。其方法是以指令提供的11位地址,取代PC的低11位,.
          而PC的高5位保持不变。
操作内容:PC←(PC)+2 PCl0~0←addrll
字 节 数:2
机器周期:2
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_AJMP(0x2500),
            asm_AJMP(0x2500),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_AJMP             (HotASM_REG)0x01
      #define asm_AJMP(addr11)         HotASM_AAREG(HotASM_Code_AJMP, addr11)
/*--------------------------------------------------------------------------------------------
LJMP addrl6
指令名称:长转移指令
指令功能:使程序按指定地址进行无条件转移
操作内容:PC←addrl6
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_LJMP(0x2500),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_LJMP             (HotASM_REG)0x02
      #define asm_LJMP(addrl6)     HotASM_Code_LJMP, HotASM_LAREG(addrl6)
/*--------------------------------------------------------------------------------------------
RR A
指令名称:循环右移指令
指令功能:累加器内容循环右移一位
操作内容:An←(An+1);n=0~6 A7←(A0)
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_RR_A(),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
    #define asm_RR_A()               (HotASM_REG)0x03
/*--------------------------------------------------------------------------------------------
INC A
指令名称:累加器加1指令
指令功能:累加器内容加1
操作内容:A←(A)+1
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_INC_A(),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
    #define asm_INC_A()              (HotASM_REG)0x04
/*--------------------------------------------------------------------------------------------
INC direct
指令名称:直接寻址单元加1指令
指令功能:内部BAM低128单元或专用寄存器内容加1
操作内容:direct←(direct)+1
字 节 数:2
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_INC_ACC(),
            asm_INC_REG(HotASM_B),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_INC_REG          (HotASM_REG)0x05
#define asm_INC_REG(direct)         HotASM_Code_INC_REG, (HotASM_REG)(direct)
    #define asm_INC_SP()             HotASM_Code_INC_REG, HotASM_SP
    #define asm_INC_PSW()             HotASM_Code_INC_REG, HotASM_PSW
    #define asm_INC_ACC()             HotASM_Code_INC_REG, HotASM_ACC
    #define asm_INC_B()             HotASM_Code_INC_REG, HotASM_B
    #define asm_INC_DPL()             HotASM_Code_INC_REG, HotASM_DPL
    #define asm_INC_DPH()             HotASM_Code_INC_REG, HotASM_DPH


/*--------------------------------------------------------------------------------------------
INC @Ri
指令名称:间接寻址单元加1指令
指令功能:内部RAM低128单元内容加1
操作内容:(Ri)←((Ri))+1;i=0,l
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_INC_iR0(),
            asm_INC_iRn(HotASM_R0),
            asm_INC_iRn(HotASM_R1),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define asm_INC_iRn(Ri)            (HotASM_REG)(0x06 + Ri % 1)
        #define asm_INC_iR0()      (HotASM_REG)0x06
        #define asm_INC_iR1()      (HotASM_REG)0x07
/*--------------------------------------------------------------------------------------------
INC Rn
指令名称:寄存器加1指令
指令功能:寄存器内容加1
操作内容:Rn←(Rn)+1,n=0~7
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_INC_R3(),
            asm_INC_Rn(HotASM_R0),
            asm_INC_Rn(HotASM_R1),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
    #define asm_INC_Rn(Rn)         (HotASM_REG)(0x08 + Rn % 8)
        #define asm_INC_R0()        (HotASM_REG)0x08
        #define asm_INC_R1()        (HotASM_REG)0x09
        #define asm_INC_R2()        (HotASM_REG)0x0a
        #define asm_INC_R3()        (HotASM_REG)0x0b
        #define asm_INC_R4()        (HotASM_REG)0x0c
        #define asm_INC_R5()        (HotASM_REG)0x0d
        #define asm_INC_R6()        (HotASM_REG)0x0e
        #define asm_INC_R7()        (HotASM_REG)0x0f
/*--------------------------------------------------------------------------------------------
JBC bit,rel
指令名称:位条件转移清0指令
指令功能:对指定位的状态进行测试。若为1,则把该位清0并进行转移;否则程序顺序执行
操作内容:若(bit)=1,则PC←(PC)+3+rel,bit←0 若(bit)≠1,则PC←(PC)+3
字 节 数:3
机器周期:2
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_JBC_BIT(HotASM_24H_1, __HotASM_Fuction__1),
            asm_RET()
          };
          HotASM (__HotASM_Fuction__1)[] =
          {
            asm_JBC_BIT(HotASM_24H_X(0), __HotASM_Fuction__),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_JBC              (HotASM_REG)0x10
    #define asm_JBC_BIT(bit, rel)    HotASM_Code_JBC, (bit), (rel)
/*--------------------------------------------------------------------------------------------
ACALL addr11
指令名称:绝对调用指令
指令功能:构造目的地址,进行子程序调用。其方法是以指令提供的11位地址(al0~a0),
          取代PC的低11位,PC的高5位不变。
操作内容:PC←(PC)+2 SP←(SP)+1 (SP)←(PC)7~0 SP←(SP)+1 (SP)←(PC)15~8 PC10~0←addrl0~0
字 节 数:2
机器周期:2
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_ACALL(0x250),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_ACALL             (HotASM_REG)0x11
    #define asm_ACALL(addr)         HotASM_AAREG(HotASM_Code_ACALL, addr)

/*--------------------------------------------------------------------------------------------
LCALL addr16
指令名称:长调用指令
指令功能:按指令给定地址进行子程序调用
操作内容:PC←(PC)+3 SP←(SP)+1 SP)←(PC)7~0 SP←(SP)+1 (SP)←(PC)15~8 PC←addrl6
字 节 数:3
机器周期:2
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_LCALL(0x250),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_LCALL             (HotASM_REG)0x12
    #define asm_LCALL(addr16)     HotASM_Code_LCALL, HotASM_LAREG(addr16)
/*--------------------------------------------------------------------------------------------
RRC A
指令名称:带进位循环右移指令
指令功能:累加器内容连同进位标志位循环右移一位
操作内容:An←(An+1);n=0~6 A7←(C) C←(A0)
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_RRC_A(),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
    #define asm_RRC_A()               (HotASM_REG)0x13
/*--------------------------------------------------------------------------------------------
DEC A
指令名称:累加器减1指令
指令功能:累加器内容减1
操作内容:A←(A)-1
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_DEC_A(),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
    #define asm_DEC_A()              (HotASM_REG)0x14
/*--------------------------------------------------------------------------------------------
DEC direct
指令名称:直接寻址减1指令
指令功能:内部RAM低128单元及专用寄存器内容减1
操作内容:direct←(direct)-1
字 节 数:2
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_DEC_ACC(),
            asm_DEC_B(),
            asm_DEC_REG(HotASM_SP),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_DEC              (HotASM_REG)0x15
    #define asm_DEC_REG(direct)      HotASM_Code_DEC,(HotASM_REG)(direct)
        #define asm_DEC_SP()          HotASM_Code_DEC, HotASM_SP
        #define asm_DEC_SP()          HotASM_Code_DEC, HotASM_SP
        #define asm_DEC_PSW()          HotASM_Code_DEC, HotASM_PSW
        #define asm_DEC_ACC()          HotASM_Code_DEC, HotASM_ACC
        #define asm_DEC_B()          HotASM_Code_DEC, HotASM_B
        #define asm_DEC_DPL()          HotASM_Code_DEC, HotASM_DPL
        #define asm_DEC_DPH()          HotASM_Code_DEC, HotASM_DPH
/*--------------------------------------------------------------------------------------------
DEC @Ri
指令名称:间接寻址减1指令
指令功能:内部RAM低128单元内容减1
操作内容:(Ri)←((Ri))-1, i=0,1
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_DEC_iR0(),
            asm_DEC_iRn(HotASM_R0),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define asm_DEC_iRn(Ri)            (HotASM_REG)(0x16 + Ri % 1)
        #define asm_DEC_iR0()       (HotASM_REG)0x16
        #define asm_DEC_iR1()       (HotASM_REG)0x17
/*--------------------------------------------------------------------------------------------
DEC Rn
指令名称:寄存器减1指令
指令功能:寄存器内容减1
操作内容:Rn←(Rn)-1,n=0~7
字 节 数:1
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_DEC_R0(),
            asm_DEC_Rn(HotASM_R0),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
    #define asm_DEC_Rn(Rn)             (HotASM_REG)(0x18 + Rn % 8)
        #define asm_DEC_R0()        (HotASM_REG)0x18
        #define asm_DEC_R1()        (HotASM_REG)0x19
        #define asm_DEC_R2()        (HotASM_REG)0x1a
        #define asm_DEC_R3()        (HotASM_REG)0x1b
        #define asm_DEC_R4()        (HotASM_REG)0x1c
        #define asm_DEC_R5()        (HotASM_REG)0x1d
        #define asm_DEC_R6()        (HotASM_REG)0x1e
        #define asm_DEC_R7()        (HotASM_REG)0x1f
/*--------------------------------------------------------------------------------------------
JB bit,rel
指令名称:位条件转移指令
指令功能:根据指定位的状态,决定程序是否转移。若为1则转移;否则顺序执行
操作内容:若(bit)=1,则PC←(PC)+3+rel 若(bit)≠1,则PC←(PC)+3
字 节 数:3
机器周期:2
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_JB_BIT(HotASM_P0_0, 0x250),
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_JB              (HotASM_REG)0x20
    #define asm_JB_BIT(bit, rel)    HotASM_Code_JB, HotASM_BIT(bit), (HotASM_REG)rel
//#define HotASM_Code_AJMP_21        (HotASM_REG)0x21
/*--------------------------------------------------------------------------------------------
RET
指令名称:子程序返回指令
指令功能:子程序返回
操作内容:PC15~8←((SP)) SP←(SP)-1 PC7~0←((SP)) SP←(SP)-1
字 节 数:1
机器周期:2
--------------------------------------------------------------------------------------------*/
#define asm_RET()                   (HotASM_REG)0x22
/*--------------------------------------------------------------------------------------------
RL A
指令名称:循环左移指令
指令功能:累加器内容循环左移一位
操作内容:An+1←(An); n=0~6 A0←(A7)
字 节 数:1
机器周期:1
--------------------------------------------------------------------------------------------*/
#define asm_RL_A()                   (HotASM_REG)0x23
/*--------------------------------------------------------------------------------------------
ADD A,#data
指令名称:立即数加法指令
指令功能:累加器内容与立即数相加
操作内容:A←(A)+data
字 节 数:1
机器周期:1
--------------------------------------------------------------------------------------------*/
#define asm_ADD_A_DATA(data)           (HotASM_REG)0x24, (HotASM_REG)data
/*--------------------------------------------------------------------------------------------
ADD A,direct
指令名称:直接寻址加法指令
指令功能:累加器内容与内部RAM单元或专用寄存器内容相加
操作内容:A←(A)+(direct)
字 节 数:2
机器周期:1
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_ADD_A_REG     (HotASM_REG)0x25
#define asm_ADD_A_REG(direct)       HotASM_Code_ADD_A_REG, (HotASM_REG)direct
    #define asm_ADD_A_SP()          HotASM_Code_ADD_A_REG, HotASM_SP
    #define asm_ADD_A_SP()          HotASM_Code_ADD_A_REG, HotASM_SP
    #define asm_ADD_A_PSW()      HotASM_Code_ADD_A_REG, HotASM_PSW
    #define asm_ADD_A_ACC()      HotASM_Code_ADD_A_REG, HotASM_ACC
    #define asm_ADD_A_B()          HotASM_Code_ADD_A_REG, HotASM_B
    #define asm_ADD_A_DPL()      HotASM_Code_ADD_A_REG, HotASM_DPL
    #define asm_ADD_A_DPH()      HotASM_Code_ADD_A_REG, HotASM_DPH
/*--------------------------------------------------------------------------------------------
ADD A,@Ri
指令名称:间接寻址加法指令
指令功能:累加器内容与内部RAM低128单元内容相加
操作内容:A←(A)+((Ri)), i=0,1
字 节 数:1
机器周期:1
--------------------------------------------------------------------------------------------*/
#define asm_ADD_A_iRn(Ri)             (HotASM_REG)(0x26 + Ri % 1)
    #define asm_ADD_A_iR0()         (HotASM_REG)0x26
    #define asm_ADD_A_iR1()         (HotASM_REG)0x27
/*--------------------------------------------------------------------------------------------
ADD A,Rn
指令名称:寄存器加法指令
指令功能:累加器内容与寄存器内容相加
操作内容:A←(A)+(Rn), n=0~7
字 节 数:1
机器周期:1
--------------------------------------------------------------------------------------------*/
#define asm_ADD_A_Rn(Rn)             (HotASM_REG)(0x28 + Rn % 8)
    #define asm_ADD_A_R0()             (HotASM_REG)0x28
    #define asm_ADD_A_R1()             (HotASM_REG)0x29
    #define asm_ADD_A_R2()             (HotASM_REG)0x2a
    #define asm_ADD_A_R3()             (HotASM_REG)0x2b
    #define asm_ADD_A_R4()             (HotASM_REG)0x2c
    #define asm_ADD_A_R5()             (HotASM_REG)0x2d
    #define asm_ADD_A_R6()             (HotASM_REG)0x2e
    #define asm_ADD_A_R7()             (HotASM_REG)0x2f
/*--------------------------------------------------------------------------------------------
JNB bit,rel                
指令名称:位条件转移指令
指令功能:根据指定位的状态,决定程序是否转移。若为0则转移;否则顺序执行
操作内容:若(bit)=0,则PC←(PC)+3+rel 若(bit)≠0,则PC←(PC)+3
字 节 数:3
机器周期:1
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_JNB                (HotASM_REG)0x30
    #define asm_JNB_BIT(bit, rel) HotASM_Code_JNB, HotASM_BIT(bit), (HotASM_REG)rel
//#define HotASM_Code_AJMP_31        (HotASM_REG)0x31
/*--------------------------------------------------------------------------------------------
RETI
指令名称:中断返回指令
指令功能:中断服务程序返回
操作内容:PC15?/FONT>8←((SP)) SP←(SP)-l PC7~0←((SP)) SP←(SP)-1
字 节 数:1
机器周期:2
--------------------------------------------------------------------------------------------*/
#define asm_RETI()                   (HotASM_REG)0x32
/*--------------------------------------------------------------------------------------------
RLC A
指令名称:带进位循环左移指令
指令功能:累加器内容连同进位标志位循环左移一位
操作内容:An-1←(An);n=0~6 A0←(C) C←(A7)
字 节 数:1
机器周期:1
--------------------------------------------------------------------------------------------*/
#define asm_RLC_A()                   (HotASM_REG)0x33
/*--------------------------------------------------------------------------------------------
ADDC A,#data
指令名称:立即数带进位加法指令
指令功能:累加器内容、立即数及进位位相加
操作内容:A←(A)+data+(C)
字 节 数:2
机器周期:1
--------------------------------------------------------------------------------------------*/
#define asm_ADDC_A_DATA(data)           (HotASM_REG)0x34, (HotASM_REG)data
/*--------------------------------------------------------------------------------------------
ADDC A,direct
指令名称:直接寻址带进位加法指令
指令功能:累加器内容、内部RAM低128单元或专用寄存器内容与进位位加
操作内容:A←(A)+(direct)+(C)
字 节 数:2
机器周期:1
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_ADDC_A_REG     (HotASM_REG)0x35
#define asm_ADDC_A_REG(direct)   HotASM_Code_ADDC_A_REG, (HotASM_REG)direct
    #define asm_ADDC_A_SP()      HotASM_Code_ADDC_A_REG, HotASM_SP
    #define asm_ADDC_A_SP()      HotASM_Code_ADDC_A_REG, HotASM_SP
    #define asm_ADDC_A_PSW()      HotASM_Code_ADDC_A_REG, HotASM_PSW
    #define asm_ADDC_A_ACC()      HotASM_Code_ADDC_A_REG, HotASM_ACC
    #define asm_ADDC_A_B()          HotASM_Code_ADDC_A_REG, HotASM_B
    #define asm_ADDC_A_DPL()      HotASM_Code_ADDC_A_REG, HotASM_DPL
    #define asm_ADDC_A_DPH()      HotASM_Code_ADDC_A_REG, HotASM_DPH
/*--------------------------------------------------------------------------------------------
ADDC A,@Ri
指令名称:间接寻址带进位加法指令
指令功能:累加器内容、内部RAM低128单元内容及进位位相加
操作内容:A←(A)+((Ri)), i=0,1
字 节 数:1
机器周期:1
--------------------------------------------------------------------------------------------*/
#define asm_ADDC_A_iRn(Ri)         (HotASM_REG)(0x36 + Ri % 1)
    #define asm_ADDC_A_iR0()     (HotASM_REG)0x36
    #define asm_ADDC_A_iR1()     (HotASM_REG)0x37
/*--------------------------------------------------------------------------------------------
ADDC A,Rn
指令名称:寄存器带进位加法指令
指令功能:累加器内容、寄存器内容和进位位相加
操作内容:A←(A)+(Rn)+(C), n=0~7
字 节 数:1
机器周期:1
--------------------------------------------------------------------------------------------*/
#define asm_ADDC_A_Rn(Rn)         (HotASM_REG)(0x38 + Rn % 8)
    #define asm_ADDC_A_R0()         (HotASM_REG)0x38
    #define asm_ADDC_A_R1()         (HotASM_REG)0x39
    #define asm_ADDC_A_R2()         (HotASM_REG)0x3a
    #define asm_ADDC_A_R3()         (HotASM_REG)0x3b
    #define asm_ADDC_A_R4()         (HotASM_REG)0x3c
    #define asm_ADDC_A_R5()         (HotASM_REG)0x3d
    #define asm_ADDC_A_R6()         (HotASM_REG)0x3e
    #define asm_ADDC_A_R7()         (HotASM_REG)0x3f
/*--------------------------------------------------------------------------------------------
JC rel
指令名称:累加位条件转移指令
指令功能:根据累加位(C)的状态决定程序是否转移,若为1则转移,否则顺序执行
操作内容:若(C)=1,则PC←(PC)+2+rel 若(C)≠1,则PC←(PC)+2
字 节 数:2
机器周期:2
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_JC              (HotASM_REG)0x40
    #define asm_JC(rel)          HotASM_Code_JC, (HotASM_REG)rel
//#define HotASM_Code_AJMP_41        (HotASM_REG)0x41
/*--------------------------------------------------------------------------------------------
ORL direct,A
指令名称:逻辑或操作指令
指令功能:内部RAM低128单元或专用寄存器内容与累加器内容进行逻辑或操作
操作内容:direct←(direct)∨(A)
字 节 数:2
机器周期:1
HotASM例: HotASM (__HotASM_Fuction__)[] =
          {
            asm_ORL_B_A(),
            asm_ORL_REG_A(HotASM_DPL)
            asm_RET()
          };
--------------------------------------------------------------------------------------------*/
#define HotASM_Code_ORL_REG_A         (HotASM_REG)0x42
    #define asm_ORL_REG_A(direct)       HotASM_Code_ORL_REG_A, (HotASM_REG)direct
        #define asm_ORL_SP_A()           HotASM_Code_ORL_REG_A, HotASM_SP
        #define asm_ORL_PSW_A()      HotASM_Code_ORL_REG_A, HotASM_PSW
        #define asm_ORL_B_A()          HotASM_Code_ORL_REG_A, HotASM_B
        #define asm_ORL_DPL_A()      HotASM_Code_ORL_REG_A, HotASM_DPL
        #define asm_ORL_DPH_A()      HotASM_Code_ORL_REG_A, HotASM_DPH

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
6
关闭 站长推荐上一条 /3 下一条