導航:首頁 > 操作系統 > 單片機cplr4指令為什麼錯

單片機cplr4指令為什麼錯

發布時間:2023-03-07 05:38:37

單片機mcs51 CLR 和CPL指令疑問

CLR是對位取反的,這里的27H並非位元組定址地址,而是位定址地址。也就是從20H(51核的位定址區起始位元組地址)的bit0開始的第27H個位,因此就是24H.7。
具體你可以翻閱書籍或51單片機手冊,好好看一看位定址相關的章節。這也是51核不多的優點之一了……

CPL 08H
與上一個相同。看來你都是卡在位定址的認知缺失上面了。

簡單來說,如果位地址小於80H,那麼計算方法就是除以8,商是位元組地址,余數是位偏移。
例如27H÷08H = 04H……7H,因此對應的位就是24H.7。

㈡ 單片機編譯時出現錯誤

A51中$可以調用一些指定的控制指令,例如文件的調用$include (c8051f040.inc)
$NOMOD51;使A51匯編器預定義的SFR無效等
當$後面跟的指令錯誤或無效時。就會出現這種錯誤提示。

下面是所有的$調用的控制指令
CASE Primary Enables case-sensitive symbol names.
COND General Includes (in the listing file) conditional source lines skipped by the preprocessor.
DATE Primary Specifies the date to use in the listing file header.
DEBUG Primary Includes debugging information in the object file.
DEFINE Primary Defines C preprocessor symbols on the command line.
ECRM Primary Allow expansion of generic CALL instruction to ECALL for the NXP 80C51MX devices.
EJECT1 General Inserts a form feed character into the listing file.
ELSE General Assemble block if the condition of a previous IF is false.
ELSEIF General Assemble block if condition is true and a previous IF or ELSEIF is false.
ENDIF General Ends an IF block.
ERRORPRINT Primary Specifies the file name for error messages.
GEN General Includes all macro expansions in the listing file.
IF General Assemble block if condition is true.
INCDIR Primary Sets additional include file paths.
INCLUDE2 General Includes the contents of another file.
LIST General Includes the assembly source text in the listing file.
MACRO Primary Enables preprocessor expansion of standard macros.
MOD_CONT Primary Enables 24-bit contiguous addressing for Dallas Semiconctor devices.
MOD_MX51 Primary Enables instruction set extensions for the NXP 80C51MX architecture.
MOD51 Primary Enables code generation and defines SFRs for classic 8051 devices.
MPL Primary Enables preprocessor expansion of MPL macros.
NOAMAKE Primary Excludes build information from the object file.
NOCASE Primary Disables case-sensitive symbol names. All symbols are converted to uppercase.
NOCOND Primary Excludes (from the listing file) conditional source lines skipped by the preprocessor.
NODEBUG Primary Excludes debugging information from the object file.
NOERRORPRINT Primary Disables error messages output to the screen.
NOGEN General Excludes macro expansions from the listing file.
NOLINES Primary Excludes line number information from the generated object mole.
NOLIST General Excludes the assembly source text from the listing file.
NOMACRO Primary Disables preprocessor expansion of standard and MPL macros.
NOMOD51 Primary Suppresses SFRs definitions for classic 8051 devices
NOMPL Primary Disables preprocessor expansion of MPL macros.
NOOBJECT Primary Disables object file generation.
NOPRINT Primary Disables listing file generation.
NOREGISTERBANK Primary Disables memory space reservation for register banks.
NOSYMBOLS Primary Excludes the symbol table from the listing file.
NOSYMLIST General Excludes subsequently defined symbols from the symbol table.
NOXREF Primary Excludes the cross-reference table from the listing file.
OBJECT Primary Specifies the name for the object file.
PAGELENGTH Primary Specifies the number of lines on a page in the listing file.
PAGEWIDTH Primary Specifies the number of characters on a line in the listing file.
PRINT Primary Specifies the name for the listing file.
REGISTERBANK Primary Reserves memory space for register banks.
REGUSE General Specifies registers modified by the specified function.
RESET General Sets symbols, which may be tested by IF or ELSEIF, to false.
RESTORE1 General Restores settings for the LIST and GEN directives.
SAVE1 General Saves settings for the LIST and GEN directives.
SET General Sets symbols, which may be tested by IF or ELSEIF, to true or a specified value.
SYMBOLS Primary Includes the symbol table in the listing file.
SYMLIST General Includes subsequently defined symbols in the symbol table.
TITLE Primary Specifies the page header title in the listing file.
XREF Primary Includes the cross-reference table in the listing file.

㈢ 單片機指令判斷正誤

1、CLR A 對
2、MUL R0,R1 錯,只有MUL A,B
3、MOV DPTR,1050H 錯,猜測該題意圖應該是MOV DPTR,#1050H,並且DPTR除了立即數賦值外只能用MOVX @DPTR,A來為其賦值
4、 MOV A,@R7 錯,只有R0與R1可以間址
5、 ADD 30H,20H 錯,ADD後面只能跟A,也就是ADD A,direct
6、 MOV R1,C 錯,C是位,位與位元組不能這樣傳輸
7、 JMP @RO+DPTR 錯,該指令只能用JMP @A+DPTR
8、 MOV A,#3000H 錯,A是8位的,不能將16位立即數賦值給A
9、 MOVC @A+DPTR,A 錯,該指令應該為 MOVC A,@A+DPTR
10、 MOVX A,@A+DPTR

㈣ 這兩條單片機的指令為什麼是錯的

第一條:MOV 50H,#0FC3DH,後面的立即數顯然超出的50H地址的位數,一般單片機有8位、12位、16位、32位等
第二條:MOV R0,#FEH ,在單片機編寫程序中不允許地址和數值以字母開頭的,想這個數應寫成MOV R0,#0FEH 就好

㈤ 請問單片機MOV R7,@R1指令為什麼是錯的

單片機指令,有MOV
A,@R1,
沒有MOⅤ
R7,@R1
這條指令,如寄存器是0區.可以用MOⅤ
07H,@R1(這條指令是合法指令,0區R7等於07H),其實使用匯編語言編譯指令錯誤可以查一下指令表,用合法指令去替換就可以了。

閱讀全文

與單片機cplr4指令為什麼錯相關的資料

熱點內容
怎麼初步認識編程 瀏覽:208
為什麼程序員都喜歡谷歌 瀏覽:891
壓縮性骨拆能自愈嗎 瀏覽:277
安卓怎麼設置游戲畫面 瀏覽:114
k線上寫字源碼 瀏覽:457
單擊按鈕保存資料源碼 瀏覽:354
華為gt加密卡 瀏覽:213
河北超融合伺服器廠家雲主機 瀏覽:894
芙兒優安全座椅app怎麼連接 瀏覽:294
專業美團騎手app怎麼開通 瀏覽:949
個人音樂分享網站源碼 瀏覽:375
在新電腦上怎麼注冊加密狗 瀏覽:123
最後一戰游戲源碼 瀏覽:5
phpmysql實例下載 瀏覽:751
傳智黑馬安卓非加密 瀏覽:553
伺服器如何配置host 瀏覽:1001
守望執行命令 瀏覽:371
加密狗插上去了怎麼辦 瀏覽:624
錘子m1怎麼把文件夾重置 瀏覽:213
APP的數據會存在哪裡 瀏覽:66