Here is a simple example by assembly language. It is based on openMSP430. Very important is to understand "interrupt vectors".

 .global main

 .set   P1OUT, 0x0021
.set WDTCTL, 0x0120 main: /* ------------ Disable Watchdog ---------------- */
MOV #0x5A80, &WDTCTL /* ------------ Toggle P1 ------------------------*/
loop:
MOV.B #0x00, &P1OUT
MOV.B #0xff, &P1OUT jmp loop /* ---------------------------- INTERRUPT VECTORS --------------- */
.section .vectors, "a"
.word loop ; Interrupt 0 (lowest priority) <unused>
.word loop ; Interrupt 1 <unused>
.word loop ; Interrupt 2 <unused>
.word loop ; Interrupt 3 <unused>
.word loop ; Interrupt 4 <unused>
.word loop ; Interrupt 5 <unused>
.word loop ; Interrupt 6 <unused>
.word loop ; Interrupt 7 <unused>
.word loop ; Interrupt 8 <unused>
.word loop ; Interrupt 9 <unused>
.word main ; Interrupt 10 Watchdog timer
.word loop ; Interrupt 11 <unused>
.word loop ; Interrupt 12 <unused>
.word loop ; Interrupt 13 <unused>
.word loop ; Interrupt 14 NMI
.word main ; Interrupt 15 (highest priority) RESET

Assembly之example的更多相关文章

  1. 为C# as 类型转换及Assembly.LoadFrom埋坑!

    背景: 不久前,我发布了一个调试工具:发布:.NET开发人员必备的可视化调试工具(你值的拥有) 效果是这样的: 之后,有小部分用户反映,工具用不了(没反应或有异常)~~~ 然后,建议小部分用户换个电脑 ...

  2. ASP.NET Core: You must add a reference to assembly mscorlib, version=4.0.0.0

    ASP.NET Core 引用外部程序包的时候,有时会出现下面的错误: The type 'Object' is defined in an assembly that is not referenc ...

  3. An error occurred during the installation of assembly 'Microsoft.VC90.CRT……的问题

    有一段时间没有用到AnkhSvn了,今天工作需要安装了一下.结果安装到一半就无法继续了,提示An error occurred during the installation of assembly ...

  4. Beennan的内嵌汇编指导(译)Brennan's Guide to Inline Assembly

    注:写在前面,这是一篇翻译文章,本人的英文水平很有限,但内嵌汇编是学习操作系统不可少的知识,本人也常去查看这方面的内容,本文是在做mit的jos实验中的一篇关于内嵌汇编的介绍.关于常用的内嵌汇编(AT ...

  5. MAC上安装 HLA(High Level Assembly)

    1.安装HLA 最新版的hla汇编器可在这里下载,支持MacOs,Linux,Windows平台 2.安装步骤 将下载好的hla程序包放在Mac根目录下 最重要的一步是设置好环境变量,打开Mac根目录 ...

  6. .NET 程序集Assembly使用

    概述 一直以来,我们都在用C#编写程序,编写程序的时候,我们用到继承.多态.接口以及泛型,我们也都明白子类可以继承抽象类,并能够重写父类的抽象方法,可是大家是否想过,如下几个问题: 1.凡树必有根和叶 ...

  7. configuration error-could not load file or assembly crystaldecisions.reportappserver.clientdoc

    IIS启动网站后报错: configuration error Could not load file or assembly 'crystaldecisions.reportappserver.cl ...

  8. Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its de

    页面加载时出现这个错误: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Cul ...

  9. How to make your assembly more secure from referencing by unauthorized bits

    Now the security has a trend to become more and more important in our daily work, hence I did some r ...

  10. Linux+Mono+WebService:CS1703: An assembly with the same identity--mscorlib

    最近把一些东西开始往Linux迁移了,因为老系统大部分都是.NET,所以直接使用Mono,代码一般都使用MonoDevelop把代码重新编译,把一些WMI和windows DLL调用改Linux的os ...

随机推荐

  1. python--(socket与粘包解决方案)

    python--(socket与粘包解决方案) 一.socket: Socket 是任何一种计算机网络通讯中最基础的内容.例如当你在浏览器地址栏中输入 http://www.cnblogs.com/ ...

  2. 【codeforces 527B】Error Correct System

    [题目链接]:http://codeforces.com/contest/527/problem/B [题意] 给你两个字符串; 允许你交换一个字符串的两个字符一次: 问你这两个字符串最少会有多少个位 ...

  3. hdu6096 String

    String Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others) Problem De ...

  4. 清北学堂模拟赛d7t3 天上掉馅饼

    题目描述小 G 进入了一个神奇的世界,在这个世界,天上会掉下一些馅饼.今天,天上会随机掉下 k 个馅饼.每次天上掉下馅饼,小 G 可以选择吃或者不吃(必须在下一个馅饼掉下来之前作出选择,并且现在决定不 ...

  5. 运维系列之一 Linux的文件与目录权限解析

    在Linux中,万事万物皆文件,普通文件是文件,目录是文件,硬件设备也是文件,因此学习了解Linux中的文件非常重要. Linux中有三种文件类型: (1) 普通文件:又分为文本文件和二进制文件 (2 ...

  6. D - Cyclic Nacklace

    CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, ...

  7. HDU 5433

    每次BC都好心酸... BFS+queue..状态可以设为p_val[x][y][k],加上斗志的值. #include <iostream> #include <cstdio> ...

  8. org.hibernate.PropertyValueException: not-null property references a null or transient value: model.

    今天在写一个SSH整合的项目时,首先将数据库操作部分单独分离出来,写完后使用Junit进行測试,经过測试.发现没有不论什么问题,对数据库中的内容进行增删改查没有问题,可是将他整合到SSH的项目中时,报 ...

  9. [Cypress] Test Variations of a Feature in Cypress with a data-driven Test

    Many applications have features that can be used with slight variations. Instead of maintaining mult ...

  10. TF101出现“DMClient已停止”处理办法

    设定->应用程式->全部->DMClient强制停止 然后 清除数据 然后 重开机 测试通过.