首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

用ADS汇编怎样实现打开一个文本的编程阿

用ADS汇编怎样实现打开一个文本的编程阿

我是一个初学者,有没有人知道,怎样用用ADS汇编怎样实现打开一个文本的编程阿,有高手吗?用到SWI


下面是问题:


Refer to the ARM System Calls document and read about the following system calls:fficeffice" />


SWI_Open, SWI_Flen, SWI_Read, SWI_Write. An example is given to show how you can write a short file on disk. Write a program to open the file turing.txt, and print its content on the screen. (More system calls information on http://www.arm.com, look for ADS 1.2 Debugger Target Guide) Two examples of system calls are attached at the end of this assignment specification. (One is outputting string to the debugger console, one is writing string to a file on the host debugger (PC).


例如:


AREA Hello_Word, CODE, READONLY ; name this block of code


 


; function ID codes to be put into r0


SWI_WriteC   EQU 0x03             ;output character address in r1


SWI_Exit       EQU 0x18             ;finish program


SWI_FUN             EQU       0x123456


             


              ENTRY   ;code entry point


START   LDR r1,=TEXT


              SUB r1,r1,#1 


              LDR  r0, = SWI_WriteC


ffice:smarttags" />LOOP     ADD r1,r1,#1


              LDRB r2, [r1]


              CMP r2, #0                 


              SWINE SWI_FUN             


              BNE LOOP                 


              LDR  r0, = SWI_Exit


           SWI  SWI_FUN      


TEXT DCB "Hello World!", &0a, &0d, 0 ; string + CR + LF + null


            END

这个倒还真没有试过... ...
51 c8051f(f020,f040) msp430 arm(2410,2510) fpga(xc3s4000) dsp(5116 dm642) keilc vc++ matlab linux protel Ten_layerPCB mpegx h.26x Rscode Turbocode ofdm VideoBroadcasting ldpc_code(now!)
返回列表