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

📄 asm1.c

📁 Cypress公司Cy7c6xxxx芯片的USB键盘及USB鼠标的firmware代码以及一些example代码。
💻 C
字号:
#pragma option f0 /* remove page breaks from listing file */
/* 
 * CYC Code Development System
 * Tutorial Assembly Example
 * ASM1.C
 * This code may be adapted for any purpose
 * when used with the CYC Code Development
 * System.  No warranty is implied or given
 * as to their usability for any purpose.
 * 
 * (c) Copyright 2000 Byte Craft Limited
 * 421 King St.N., Waterloo, ON, Canada, N2J 4E4
 * VOICE: 1 (519) 888 6911
 * FAX  : 1 (519) 746 6751
 * email: support@bytecraft.com
 * 
 * REVISION HISTORY
 * v1.00 AL 01/2000 Initial Version.
 */
#include <dev\c63413.h>
                                                                        /* figure_b */
long inc_long(long l) /* increment a long variable */
{
        /* return(++l);  */
#asm
        INC [l+1]
        JNZ skip_inc_high_byte
        INC [l+0]
skip_inc_high_byte:
        MOV X,[l+0]
        MOV A,[l+1]
#endasm
}
                                                                        /* figure_b */

                                                                        /* figure_a */
char arr[10]; /* declare an array of 10 characters */

void main(void)
{
    int i;
    i=sizeof(arr); /* assign the size of arr[] to i */

    while(i--) arr[i]=0;
#asm
clear_arr:
    MOV  A,[i]
    DEC  [i]
    CMP  A,00h
    JZ   done_clear_arr
    MOV  X,[i]
    MOV  A,00h
    MOV  [X+arr],A
    JMP  clear_arr
done_clear_arr:
#endasm

}
                                                                        /* figure_a */

⌨️ 快捷键说明

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