ARM基礎:ARM中“字”的長度
參考:
說明:ARM基礎:ARM中“字”的長度。
/
(這里不討論一個“漢字”代表兩個“字節(jié)”的問題,這個差點都干擾我了都)
在學習匯編時用到了LDRHR2,[R1] ;將存儲器地址為R1的半字數(shù)據(jù)讀入寄存器R2,并將R2的高16位清零。以前沒有聽過字這個這個概念,就很糾結(jié)。就引起了我弄清“字”的長度的好奇心。字到底有多少個字節(jié),這是一個很晦澀的問題,都特別是這樣的解釋:
“在計算機領域,對于某種特定的計算機設計而言,字是用于表示其自然的數(shù)據(jù)單位的術(shù)語。在這個特定計算機中,字是其用來一次性處理事務的一個固定長度的位(bit)組。一個字的位數(shù)(即字長)是計算機系統(tǒng)結(jié)構(gòu)中的一個重要特性。”
就是不明白,不過上邊的LDRHR2,[R1]實驗結(jié)果是R1指向的內(nèi)存地址的16bit都給了R2,說明“字”是32位的。但是當我用Win7上的計算器時卻發(fā)現(xiàn)了另一種情況。如下圖可見,一個“字”,卻給出了16bit。
這更激怒我了,非要搞明白不可了。在google時在wiki上找到了答案,這個“字”并不是固定的,對于X86來說是16位,對于ARM來說是32位。(鏈接這里)
對各個架構(gòu)都做了字長的統(tǒng)計,轉(zhuǎn)來看看。
這就說明誰都沒有錯了,Win7自帶的計算器是按照x86的標準來的。要想用這個計算器來計算ARM中的字,要用這里的“雙字”來代表ARM中的一個“字”。
字長表
年份 | 計算機 | 字長 | 整數(shù) | 浮點數(shù) | 長度 | 編址單位 | 字符 | |
1941 | ZuseZ3 | 22b | – | w | 8b | w | – | |
1942 | ABC | 50b | w | – | – | – | – | |
1944 | HarvardMarkI | 23d | w | – | 24b | – | – | |
1946 | ENIAC | 10d | w,2w | – | – | – | – | |
1951 | UNIVACI | 12d | w | – | ½w | w | 1d | |
1952 | IASmachine | 40b | w | – | ½w | w | 5b | |
1952 | IBM701 | 36b | ½w,w | – | ½w | ½w,w | 6b | |
1952 | UNIVAC60 | nd | 1d,...10d | – | – | – | 2d,3d | |
1953 | IBM702 | nd | 0d,...511d | – | 5d | d | 1d | |
1953 | UNIVAC120 | nd | 1d,...10d | – | – | – | 2d,3d | |
1954 | IBM650 | 10d | w | – | w | w | 2d | |
1954 | IBM704 | 36b | w | w | w | w | 6b | |
1954 | IBM705 | nd | 0d,...255d | – | 5d | d | 1d | |
1954 | IBMNORC | 16d | w | w,2w | w | w | – | |
1956 | IBM305 | nd | 1d,...100d | – | 10d | d | 1d | |
1958 | UNIVACII | 12d | w | – | ½w | w | 1d | |
1958 | SAGE | 32b | ½w | – | w | w | 6b | |
1958 | AutoneticsRecompII | 40b | w,79b,8d,15d | 2w | ½w | ½w,w | 5b | |
1959 | IBM1401 | nd | 1d,... | – | d,2d,4d,5d,7d,8d | d | 1d | |
1959 | IBM1620 | nd | 2d,... | – | 12d | d | 2d | |
1960 | LARC | 12d | w,2w | w,2w | w | w | 2d | |
1960 | IBM1410 | nd | 1d,... | – | d,2d,6d,7d,11d,12d | d | 1d | |
1960 | IBM7070 | 10d | w | w | w | w,d | 2d | |
1960 | PDP-1 | 18b | w | – | w | w | 6b | |
1961 | IBM7030 | 64b | 1b,...64b, | w | ½w,w | b,½w,w | 1b,...8b | |
1961 | IBM7080 | nd | 0d,...255d | – | 5d | d | 1d | |
1962 | UNIVACIII | 25b,6d | w,2w,3w,4w | – | w | w | 6b | |
1962 | UNIVAC1107 | 36b | 1/6w,?w,½w,w | w | w | w | 6b | |
1962 | IBM7010 | nd | 1d,... | – | d,2d,6d,7d,11d,12d | d | 1d | |
1962 | IBM7094 | 36b | w | w,2w | w | w | 6b | |
1963 | GeminiGuidanceComputer | 39b | 26b | – | 13b | 13b,26b | – | |
1963 | ApolloGuidanceComputer | 15b | w | – | w,2w | w | – | |
1964 | CDC6600 | 60b | w | w | ¼w,½w | w | 6b | |
1965 | IBM360 | 32b | ½w,w, | w,2w | ½w,w,1½w | 8b | 8b | |
1965 | UNIVAC1108 | 36b | 1/6w,¼w,?w,½w,w,2w | w,2w | w | w | 6b,9b | |
1965 | PDP-8 | 12b | w | – | w | w | 8b | |
1970 | PDP-11 | 16b | w | 2w,4w | w,2w,3w | 8b | 8b | |
1971 | Intel4004 | 4b | w,d | – | 2w,4w | w | – | |
1972 | Intel8008 | 8b | w,2d | – | w,2w,3w | w | 8b | |
1972 | Calcomp900 | 9b | w | – | w,2w | w | 8b | |
1974 | Intel8080 | 8b | w,2w,2d | – | w,2w,3w | w | 8b | |
1975 | Cray-1 | 64b | 24b,w | w | ¼w,½w | w | 8b | |
1975 | Motorola6800 | 8b | w,2d | – | w,2w,3w | w | 8b | |
1975 | MOSTech.6501 | 8b | w,2d | – | w,2w,3w | w | 8b | |
1976 | ZilogZ80 | 8b | w,2w,2d | – | w,2w,3w,4w,5w | w | 8b | |
1978 | Intel8086 | 16b | ½w,w,2d | – | ½w,w,...7w | 8b | 8b | |
1978 | VAX-11/780 | 32b | ¼w,½w,w,1d,...31d,1b,...32b | w,2w | ¼w,...14¼w | 8b | 8b | |
1979 | Motorola68000 | 32b | ¼w,½w,w,2d | – | ½w,w,...7½w | 8b | 8b | |
1982 | Motorola68020 | 32b | ¼w,½w,w,2d | – | ½w,w,...7½w | 8b | 8b | |
1985 | ARM1 | 32b | w | – | w | 8b | 8b | |
1985 | MIPS | 32b | ¼w,½w,w | w,2w | w | 8b | 8b | |
1989 | Intel80486 | 16b | ½w,w,2d | 2w,4w,5w,17d | ½w,w,...7w | 8b | 8b | |
1989 | Motorola68040 | 32b | ¼w,½w,w,2d | w,2w,2½w | ½w,w,...7½w | 8b | 8b | |
1991 | PowerPC | 32b | ¼w,½w,w | w,2w | w | 8b | 8b | |
2000 | IA-64 | 64b | 8b,¼w,½w,w | ½w,w | 41b | 8b | 8b | |
2002 | XScale | 32b | w | w,2w | ½w,w | 8b | 8b | |
說明:b:位,d:10進制數(shù),w:該構(gòu)架的字長,n:變量長度(variablesize) |
評論