資源描述:
《freescale匯編語(yǔ)言源程序標(biāo)準(zhǔn)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、行的長(zhǎng)度:???為了便于閱讀和打印,Freescale使用mono-spaced字體,這種字體每個(gè)字符寬度相等.字體大小是9?point;最大行長(zhǎng)為70個(gè)字符.示例如下:;????????1?????????2?????????3?????????4?????????5?????????6?????????7;234567890123456789012345678901234567890123456789012345678901234567890asc2hex:????bsr???ishex???????;check?for?valid?hex?#?first??????
2、??????bne???dunA2asc????;if?not?just?return????????????cmp???#’9’????????;check?for?A-F?($41-$46)????????????bls???notA2F??????;skip?if?not?A-F列表輸出文件示例如下:;????????1?????????2?????????3?????????4?????????5?????????6?????????7?????????8?????????9;23456789012345678901234567890123456789012345
3、678901234567890123456789012345678901234567890123??551?C1D7?AD?EA?????asc2hex:????bsr???ishex???????;check?for?valid?hex?#?first??552?C1D9?26?0A?????????????????bne???dunA2asc????;if?not?just?return??553?C1DB?A1?39?????????????????cmp???#’9’????????;check?for?A-F?($41-$46)??554?C1DD?23?02?
4、????????????????bls???notA2F??????;skip?if?not?A-F從以上可以看出列寬最大到93字符,因?yàn)榱斜磔敵鑫募⒉荒芙o讀者提供更多的有用信息,因此Freescale最大用到每行93字符.-----------------------------------------------------------避免使用TAB字符????TAB字符在不同的字處理軟件中有不同的含義,當(dāng)把源文件提交給其它文檔時(shí)可能會(huì)出現(xiàn)問(wèn)題,所以要避免使用TAB,而用多個(gè)空格代替.-----------------------------------------
5、------------------源程序列分配???源程序由標(biāo)號(hào),助記符,操作數(shù)和注釋組成一行;???標(biāo)號(hào)在第1列開(kāi)始???指令助記符在第13列開(kāi)始???操作數(shù)在19列開(kāi)始???注釋在31列開(kāi)始;如果操作數(shù)超過(guò)了30列,注釋必須和操作數(shù)的最后一個(gè)字符分開(kāi)1到2個(gè)空格.???如果一個(gè)標(biāo)號(hào)超過(guò)11個(gè)字符,就應(yīng)該另起一行,并在31列做注釋.短標(biāo)號(hào)也可以另起一行來(lái)突出它,這經(jīng)常用在一個(gè)子程序開(kāi)始處.見(jiàn)圖3;????????1?????????2?????????3?????????4?????????5?????????6?????????7;23456789012345678
6、9012345678901234567890123456789012345678901234567890label:??????mne???operand?????;comment????????????brset?very,long,operand???;comment?can’t?start?in?col?31veryLongLabel:????????????????;long?label?on?separate?line????????????nop???????????????;instruction?with?no?operandsshort:????????
7、????????????????;short?label?may?use?a?separate?line????????????mne?operand???????;code?to?which?‘short’?refers-----------------------------------------------------------大寫(xiě)和小寫(xiě)字符???源程序中協(xié)調(diào)一致的大小寫(xiě)可以增強(qiáng)可讀性,并使程序變得容易理解.???標(biāo)號(hào)???標(biāo)號(hào)可以混和使用大小寫(xiě),但無(wú)論在哪兒引用它都應(yīng)該嚴(yán)格匹配其初始定義.???指令助記符???指令