Showing posts with label Assembly Code. Show all posts
Showing posts with label Assembly Code. Show all posts

Monday, November 3, 2014

Assembly command note

 

The syntax of MOV can also be more complex as the following examples show.[7]

MOV EAX, [EBX]	  ; Move the 4 bytes in memory at the address contained in EBX into EAX
MOV [ESI+EAX], CL ; Move the contents of CL into the byte at address ESI+EAX

 


Reference


[1] http://en.wikipedia.org/wiki/Assembly_language

Thursday, November 7, 2013

Pipelined

這在設計組合語言(Assembly Code)是一個另一項觀念,通常我們C語言去撰寫程式再透過Compilar編譯成我們所需要的Machine Code,Compilar都將這些觀念給包裝起來了。

主要的概念精神在於instruction彼此之間在控制硬體時會相互影響。

以RISC pipeline最基本的五個間段為

IF –> ID –> EX –> MEM –> WB

Instruction fetch

Decode

Execute

Memory access

Write Back

這彼此之間會因為硬體設計不同而有所互相影響,

例如Data Hazard問題,在一段時間內不該使用同一個資源,這樣資料同步會出現問題。

簡單來說,第一秒下指令Write寫入資料D到位置A,馬上又在下一秒使用Read去A位置拿資料,但D的值要等到第三秒才能完整的寫入到A位置,此時錯誤的使用Read, Write會得到不預期的錯誤資料。

設計不當會造成下述三個問題,之後有機會再細部陳述這些問題。

Structure Hazards

Data Hazards

Control Hazards

Reference

http://en.wikipedia.org/wiki/Classic_RISC_pipeline

http://www.cs.iastate.edu/~prabhu/Tutorial/PIPELINE/hazards.html

Register Transfer Level Design with Verilog (1) [ebook]

設計程式之所以有趣不外乎是它的千變萬化,同樣的結果卻有不同的寫法。 但這些不同寫法當中也並沒有分誰對誰錯,也沒有制定標準來規範何事該用何解。 這也就是我們設計者的珍貴!! [1] Primitive Instantiations 在Verilog中最基本的邏輯...