1 / 17

การอ้างแอดเดรสหน่วยความจำ

การอ้างแอดเดรสหน่วยความจำ. โหมดของแอดเดรส Addressing Mode. Immediate Addressing Direct Addressing Indirect Addressing Register Direct Addressing Register Indirect Addressing Indexed Addressing Relative Addressing Stack. Immediate Addressing.

shyla
Download Presentation

การอ้างแอดเดรสหน่วยความจำ

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. การอ้างแอดเดรสหน่วยความจำการอ้างแอดเดรสหน่วยความจำ

  2. โหมดของแอดเดรส Addressing Mode • Immediate Addressing • Direct Addressing • Indirect Addressing • Register Direct Addressing • Register Indirect Addressing • Indexed Addressing • Relative Addressing • Stack

  3. Immediate Addressing • MOV X , 1000 ;โหลดข้อมูล 1000 มาเก็บในตัวแปร X Op Operand

  4. Direct Addressing • MOV X , [1000] ;โหลดข้อมูลในตำแหน่ง 1000 มาเก็บในตัวแปร X 1002 Op Operand 1001 10 1000 999

  5. Indirect Addressing • MOV X , (1000) ;โหลดข้อมูลจากตำแหน่งที่อยู่ในแอดเดรส 1000 มาเก็บในตัวแปร X 1002 20 Op Operand 1001 1002 1000 999

  6. Register Direct Addressing • MOV X , R1 ;โหลดข้อมูลที่อยู่ใน R1 มาเก็บในตัวแปร X Op R1 R1 0FF

  7. Register Indirect Addressing • MOV X , [R1] ;โหลดข้อมูลจากแอดเดรสที่อยู่ใน R1 มาเก็บในตัวแปร X 1002 20 Op R1 40 1001 R1 1002 1000 1001 999

  8. Indexed Addressing • MOV X , [R1] + Re ;โหลดข้อมูลจากแอดเดรสที่อยู่ใน R1 บวกกับค่าคงที่มาเก็บในตัวแปร X 1002 20 Op R1 2 40 1001 R1 1002 1000 1000 999

  9. Relative Addressing • MOV X , PC + Re ;โหลดข้อมูลจากแอดเดรสของ PC บวกกับค่าคงที่มาเก็บในตัวแปร X 1002 20 Op 1 40 1001 PC 1002 1000 1000 999

  10. Stack 1002 20 Op R1 2 40 1001 R1 1002 1000 1000 999

  11. ไมโครโอเปอเรชัน (Micro-Operation) • ในหนึ่งวงรอบคำสั่ง (Instruction Cycle) ประกอบด้วย • เฟ็ตซ์ (fetch) • อินไดเร็กต์ (indirect) • เอ็กซิคิวต์ (execute) • อินเทอร์รัพต์ (interrupt)

  12. Fetch cycle Address Data Control Memory MAR MAR Control u IR MBR

  13. วงรอบเฟ็ตซ์ • มี 3 ขั้นตอน และ 4 ไมโครโอเปอเรชัน t1 : MAR (PC) t2 : MBR Memory PC (PC) + 1 t3 : IR (MBR)

  14. วงรอบอินไดเร็กต์ (indirect cycle) • หลังจากดึงคำสั่งเข้าไปแล้ว ขั้นต่อไปจะเป็นการนำโอเปอแรนด์ หรือค่าที่จะนำมาคำนวณเข้ามา t1 : MAR (IR (Address) ) t2 : MBR Memory t3 : IR(Address) (MBR (Address) )

  15. Address Data Control Memory MAR Control u MBR

  16. วงรอบอินเทอร์รัพต์ (interrupt cycle) • สำหรับวงรอบเอ็กซิคิวต์ที่สมบูรณ์นั้นจะต้องตรวจสอบด้วยว่ามีการอินเตอร์รัปต์เกิดขึ้นหรือไม่ t1 : MBR ( PC ) t2 : MBR Save_Address PC Routine_Address t3 : Memory (MBR )

  17. Interrupt cycle Address Data Control Memory MAR PC Control u MBR

More Related