亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? c5110.txt

?? dsp&c51的編程,從小百合上down的
?? TXT
字號:
發(fā)信人: reflection (似水流年), 信區(qū): EEtechnology 

標(biāo)  題: C51 Primer (9) Other C51 Extentions 

發(fā)信站: 南京大學(xué)小百合站 (Wed Nov 24 12:02:32 1999), 轉(zhuǎn)信 

  

  

9 Other C51 Extensions 

9.1 Special Function Bits 

.v.A frustration for assembler programmers with the old C51 version was the 

need to use bit masks when testing for specific bits with chars and ints, de 

spite there being a good set of bit-orientated assembler instructions within 

 the 8051. In version 3, however, it is possible to force data into the bit- 

addressable area (starting at 0x20) where the 8051's bit instructions can be 

 used. 

An example is testing the sign of a char by checking for bit = 1. 

Here the char is declared as "bdata" thus: 

   bdata char test_char ; 

sign_bit is defined as: 

   sbit sign_bit = test_char ^ 7 ; 

to use this: 

     test_char = counter ; 

     if(sign_bit) { /* test_char is negative */ } 

the opcodes executed are: 

     MOV   A,counter    ; 

     MOV   test_char,A  ; 

     JNB   0,DONE       ; 

     /* Negative */ 

All of which is a lot faster than using bit masks and &'s! 

The important points are that the "bdata" tells C51 and L51 that this variab 

le is to be placed in the bit-addressable RAM area and the "sbit sign_bit = 

test_char ^ 7" tells C51 to assume that a bit called sign_bit will be locate 

d at position 7 in the test_char byte. 

Byte Number: test_char           20H    Start Of BDATA area 

Bit Number:  0,1,2,3,4,5,6,7<_ sign_bit 

Byte Number:                     21H 

Bit Number:  8,9,10,11,12,13,14,15 

Byte Number:                     22H 

Bit Number:  16,17,18,19,20,21,22,23,24..... 

The situation with ints is somewhat more complicated. The problem is that th 

e 8051 does not store things as you first expect. The same sign test for an 

int would require bit 7 to be tested. This is because the 8051 stores int's 

high byte at the lower address. Thus bit 7 is the highest bit of the higher 

byte and 15 is the highest bit of the lower. 

Byte Number: test_int(high)          20H 

Bit Number:  0,1,2,3,4,5,6,7 

Byte Number: test_int+1(low)         21H 

Bit Number:  8,9,10,11,12,13,14,15 

Bit locations in an integer 

9.2 Support For 80C517/537 32-bit Maths Unit 

The Siemens 80C537 and 80C517A group have a special hardware maths unit, the 

 MDU, aimed at speeding-up number-crunching applications. 

9.2.1 The MDU - How To Use It 

To allow the 8051 to cope with 16 and 32-bit ("int" and "long") multiplicati 

on and division, the Siemens 80C517 variant has a special maths co-processor 

 (MDU) integrated on the cpu silicon. A 32-bit normalise and shift is also i 

ncluded for floating point number support. It also has 8 data pointers to ma 

ke accessing external RAM more efficient. 

The compiler can take advantage of these enhancements if the "MOD517" switch 

 is used, either as a #pragma or as a command line extension. This will resu 

lt in the use of the MDU to perform > 8 bit multiplies and divides. However 

a special set of runtime libraries is required from Keil for linking. 

Using the MDU will typically yield a runtime improvement of 6 to 9 times the 

 basic 8051 cpu for 32 bit unsigned integer arithmetic. 

Optionally the blanket use of the 80C517 enhancements after MOD517 can be se 

lectively disabled by the NOMDU and NODP pragmas. Predictably NOMDU will inh 

ibit the use of the maths unit, while NODP will stop the eight data pointers 

 being used. 

9.2.2 The 8 Datapointers 

To speed up block data moves between external addresses, the 517A has 8 data 

pointers. These are only used by C51 in the memcpy() and strcpy() library fu 

nctions. 

The general "MOD517" switch will enable their use. Note that the strcat() ro 

utine does not use the additional data pointers. 

If the extra pointers are to be used both in background and interrupt functi 

ons, the DPSEL register is automatically stacked on entry to the interrupt a 

nd a new DPSEL value allocated for the duration of the function. 

9.2.3 80C517 - Things To Be Aware Of 

The 80C517 MDU is used effectively like a hardware subroutine, as it is not 

actually part of the 8051 cpu. As such it is subject to normal sub-routine r 

ules regarding re-entrancy. If, as an example, both a background program and 

 an interrupt routine try to use the MDU simultaneously, the background calc 

ulation will be corrupted. This is because the MDU input and output register 

s are fixed locations and the interrupt will simply overwrite the background 

 values. 

To allow the background user to detect corruption of the MDU registers, the 

MDEF bit is provided within the ARCON register. After any background use of 

the MDU, a check should be made for this flag being set. If so, the calculat 

ion must be repeated. Appropriate use of the NOMDU pragma could be used inst 

ead. 

Note: the compiler does not do this - the user must add the following code t 

o overcome the problem: 

#pragma MOD517 

#include "reg517.h" 

    long x,y,z ; 

    func() 

      { 

      while(1) 

         { 

           x = y / z ;      /* 32-bit calculation */ 

           if(MDEF == 0)    /* If corruption has */ 

              { break ; }   /* occurred then repeat */ 

         }                  /* else exit loop */ 

      } 

9.3 87C751 Support 

The Philips 87C751 differs from the normal 8051 CPU by having a 2k code spac 

e with no option for external ROM. This renders the long LJMP and LCALL inst 

ructions redundant. To cope with this the compiler must be forced to not gen 

erate long branch instructions but to use AJMPs and ACALLs instead 

9.3.1 87C751 - Steps To Take 

Invoke C51 with C51 myfile.c ROM(SMALL) NOINTVECTOR or use "#pragma ROM(SMAL 

L)" 

Use the INIT751.A51 startup file in the LIB directory. 

Do not use floating point arithmetic, integer or long divides, printf, scanf 

 etc., as they all use LCALLs. 

A special 87C751 library package is available which will contain short call 

versions of the standard library routines. 

9.3.2 Integer Promotion 

Automatic integer promotion within IF statements is incorporated in version 

>= 3.40 to meet recent ANSI stipulations in this area. This makes porting co 

de from Microsoft or Borland PC C compilers much easier. Thus any char(s) wi 

thin a conditional statement are pre-cast to int before the compare is perfo 

rmed. This makes some sense on 16 bit machines where int is as efficient as 

char but, in the 8051, char is the natural size for data and so some loss of 

 efficiency results. Fortunately Keil have provided "#pragma NOINTPROMOTE" t 

o disable this feature! In this case explicit casts should be used if anothe 

r data type might result from an operation. 

To show why this #pragma is important, this C fragment's code sizes are infl 

uenced thus: 

char c ; unsigned char c1, c2 ; int i ; 

main() { 

   if((char)c == 0xff) c = 0 ; 

   if((char)c == -1) c = 1 ; 

   i = (char)c + 5 ; 



   if((char)c1 < (char)c2 + 4) c1 = 0 ; 

   } 

Code Sizes 

47 bytes - C51 v3.20 

49 bytes - C51 v3.40 (INTPROMOTE) 

63 bytes - C51 v3.40 (NOINTPROMOTE) 

Again this goes to show that C portability compromises efficiency in 8051 pr 

ograms... 

---------------------------------------------------------------------------- 

---- 

  

-- 

Ours is essentially a tragic age, so we refuse to take it tragically. 

  

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丝袜美腿亚洲一区二区图片| 精品久久久三级丝袜| 欧美国产综合色视频| 亚洲va欧美va天堂v国产综合| www.欧美日韩| 日本一区二区高清| 狠狠色丁香久久婷婷综合_中| 欧美撒尿777hd撒尿| 亚洲无线码一区二区三区| 97成人超碰视| 国产精品美女久久久久久久久| 国产揄拍国内精品对白| 欧美成人性福生活免费看| 午夜精品久久久久久久蜜桃app| 色菇凉天天综合网| 一区二区三区不卡视频在线观看| 国产91露脸合集magnet| www精品美女久久久tv| 久久国产综合精品| 欧美zozozo| 国产一区二区美女| 国产丝袜美腿一区二区三区| 国内精品久久久久影院色| 亚洲免费电影在线| 久久综合久久综合久久综合| 91福利精品视频| 国产精品资源在线| 热久久国产精品| 亚洲影视在线观看| 国产精品美女久久久久久| 欧美大白屁股肥臀xxxxxx| 色婷婷久久久久swag精品| 国产凹凸在线观看一区二区| 日韩福利视频网| 亚洲va国产天堂va久久en| 最新日韩av在线| 久久综合九色综合欧美亚洲| eeuss鲁片一区二区三区在线观看| 日韩av中文字幕一区二区| 1024亚洲合集| 精品卡一卡二卡三卡四在线| 99久久精品国产网站| 欧美aa在线视频| 亚洲黄色小视频| 国产欧美日韩久久| 国产精品免费aⅴ片在线观看| 7777精品伊人久久久大香线蕉经典版下载 | 国产伦理精品不卡| 国产精品不卡一区| 国产亚洲精品aa午夜观看| 欧美高清性hdvideosex| 色老综合老女人久久久| 风间由美一区二区av101| 麻豆精品一区二区三区| 亚洲另类一区二区| 亚洲欧美日韩电影| 亚洲欧洲精品一区二区三区| 精品成人在线观看| 欧美一区二区视频网站| 91精彩视频在线| 欧美午夜寂寞影院| 欧美一区二区精品久久911| 在线欧美小视频| 亚洲欧美激情视频在线观看一区二区三区 | 五月天欧美精品| 老司机精品视频一区二区三区| 久久爱另类一区二区小说| 欧美成人乱码一区二区三区| 精品国产髙清在线看国产毛片| 欧美综合视频在线观看| 欧美日韩中文一区| 日韩精品一区二| 中文在线免费一区三区高中清不卡| 成人欧美一区二区三区| 夜夜嗨av一区二区三区中文字幕| 男男成人高潮片免费网站| 国产一区二区精品久久99| 色偷偷一区二区三区| 欧美一区二区成人| 成人免费在线播放视频| 日韩中文字幕1| 成人av网址在线| 日韩午夜在线观看| 综合久久给合久久狠狠狠97色 | 日本道精品一区二区三区| 精品国产伦一区二区三区观看体验| 国产精品国产三级国产aⅴ入口| 亚洲电影视频在线| 国产成人av一区二区三区在线 | 九九视频精品免费| 色乱码一区二区三区88| 日韩欧美成人一区| 香蕉成人啪国产精品视频综合网| 成人美女视频在线观看| 国产日韩高清在线| 亚洲精品国产第一综合99久久| 91精品欧美综合在线观看最新| 精品综合久久久久久8888| 欧美人xxxx| 欧美一级在线免费| 日韩视频在线一区二区| 精品福利一二区| 久久精品视频一区| 中文欧美字幕免费| 亚洲日本va午夜在线影院| 亚洲国产精品久久久久秋霞影院| 亚洲成人在线观看视频| 三级一区在线视频先锋| 精品亚洲成a人| 福利视频网站一区二区三区| 91免费国产视频网站| 欧美人伦禁忌dvd放荡欲情| 精品少妇一区二区三区| 中文字幕一区二区三中文字幕| 亚洲一区在线观看网站| 国产老女人精品毛片久久| 97se亚洲国产综合在线| 日韩一区二区中文字幕| 亚洲国产精品成人久久综合一区| 一区二区三区色| 婷婷中文字幕综合| 欧美中文字幕亚洲一区二区va在线| 色哟哟日韩精品| 欧美国产一区在线| 卡一卡二国产精品| 国产成人在线视频网站| 91麻豆.com| 色婷婷久久综合| 日韩精品一区二区三区在线观看 | 国产精品美女一区二区| 国产精品资源网站| 久久久久久久久久电影| 欧美一区二区三区视频免费播放| 91视频你懂的| 国产电影一区二区三区| 美国毛片一区二区三区| 亚洲国产精品综合小说图片区| 国产精品私人影院| 久久五月婷婷丁香社区| 欧美一区二区视频在线观看2020 | 亚洲人吸女人奶水| 美国三级日本三级久久99| 色吧成人激情小说| 日韩精品一区二区三区swag| 婷婷中文字幕综合| 在线免费观看一区| 国产精品久久久久7777按摩| 国产一区二区调教| 精品少妇一区二区三区在线视频| 亚洲成人免费视| 欧美自拍偷拍一区| 1024亚洲合集| 91美女片黄在线| 一区二区三区免费| 色婷婷亚洲精品| 亚洲国产欧美一区二区三区丁香婷| av在线一区二区三区| 国产精品美女www爽爽爽| 国产精品夜夜爽| 亚洲国产激情av| 99视频精品免费视频| 亚洲欧美日韩国产手机在线| 91丝袜美女网| 一区二区三区av电影 | 欧美优质美女网站| 国产真实精品久久二三区| 欧美视频一区二区三区在线观看| 国产三级三级三级精品8ⅰ区| 国产一区二区三区久久悠悠色av| 欧美一区二区三区播放老司机| 99国内精品久久| 国产一区二区三区在线观看免费 | 国产精品每日更新| 久久久久久久久97黄色工厂| 国产亚洲一区二区三区在线观看 | 欧美精品久久久久久久久老牛影院| 亚洲伊人伊色伊影伊综合网| 欧美日韩一区二区三区四区五区| 日日夜夜精品免费视频| 日韩欧美不卡在线观看视频| 国产精品一区二区三区99| 亚洲人成精品久久久久| 欧美一区二区三区啪啪| 国产成人在线看| 欧美高清一级片在线观看| 欧美日韩一级二级| 国产成人鲁色资源国产91色综| 亚洲美女在线国产| 26uuu欧美日本| 在线看不卡av| 高清视频一区二区| 免费欧美高清视频| 玉米视频成人免费看| wwwwxxxxx欧美| 欧美日韩高清在线播放| 99精品久久只有精品| 久久国产精品露脸对白| 一区二区三区免费网站| 国产三级精品三级| 欧美xxxxxxxx|