More Related Content
Similar to 嵌入式系統 課程講義 (20)
嵌入式系統 課程講義
- 1. 1
UEE1076
Introduction to Embedded Systems
Lecture 1
Introduction
YuLun Huang
http://rtes.cn.nctu.edu.tw
UEE 3303 <1> YL Huang Spring‘14 © NCTU
What is a computer?
° Components:
• Input (mouse, keyboard)
• Output (display, printer)
• Memory (disk drives, DRAM, SRAM, CD)
• Network
° Our primary focus: the processor (datapath and
control)
• Implemented using millions of transistors
• Impossible to understand by looking at each transistor
• We need …
UEE 3303 <2> YL Huang Spring‘14 © NCTU
What are embedded computing systems?
° Processing Unit: CPU
• On-chip memory
• Off-chip memory
° Input: mouse, keyboard
° Output: screen
° Memory and storage
° Communication (data): NIC
° Software
UEE 3303 <3> YL Huang Spring‘14 © NCTU
Definition
° Embedded computing system:
• Any device that includes a programmable computer but is not
itself a general-purpose computer
° Take advantage of application characteristics to
optimize the design:
• Don’t need all the general-purpose bells and whistles
UEE 3303 <4> YL Huang Spring‘14 © NCTU
- 2. 2
Embedding a computer
CPU
output analog
input
mem
analog
embedded
computer
UEE 3303 <5> YL Huang Spring‘14 © NCTU
The History
° System
° Systom on Board
° System on Chip (SoC)
° …
° MCU
• Memory embedded
° MPU
• High frequency
• External memory required
UEE 3303 <6> YL Huang Spring‘14 © NCTU
Examples
° Cell phone
° Printer
° Automobile: engine, brakes, dash, etc
° Airplane: engine, flight controls
° Digital television
° Household appliances
UEE 3303 <7> YL Huang Spring‘14 © NCTU
Early history
° Late 1940’s: MIT Whirlwind computer was designed
for real-time operations
• Originally designed to control an aircraft simulator
° First microprocessor was Intel 4004 in early 1970’s.
° HP-35 calculator used several chips to implement a
microprocessor in 1972
° Automobiles used microprocessor-based engine
controllers starting in 1970’s
• Control fuel/air mixture, engine timing, etc.
• Multiple modes of operation: warm-up, cruise, hill climbing, etc.
• Provides lower emissions, better fuel efficiency
UEE 3303 <8> YL Huang Spring‘14 © NCTU
- 3. 3
Instruction Set Architecture
° A very important abstraction
• interface between hardware and low-level software
• standardizes instructions, machine language bit patterns, etc.
• advantage: different implementations of the same architecture
• disadvantage: sometimes prevents using new innovations
True or False: Binary compatibility is extraordinarily
important?
° Modern instruction set architectures:
• IA-32, PowerPC, MIPS, SPARC, ARM, and others
UEE 3303 <9> YL Huang Spring‘14 © NCTU
CISC vs. RISC
° CISC emphasizes hardware complexity. RISC
emphasizes compiler complexity.
CISC emphasizes hardware complexity.
RISC emphasizes compiler complexity.
RISC processor: simpler; the core can operate at higher clock frequencies.
CISC processor: more complex and operate at lower clock frequencies.
UEE 3303 <10> YL Huang Spring‘14 © NCTU
The Instruction Set: a Critical Interface
instruction set
software
hardware
R12 = R14 – R15
11100000010011101100000000001111
UEE 3303 <11> YL Huang Spring‘14 © NCTU
MIPS R3000 Instruction Set Architecture (Summary)
° Instruction Categories
• Load/Store
• Computational
• Jump and Branch
• Floating Point
- coprocessor
• Memory Management
• Special
Registers
R0 - R31
PC
HI
LO
3 Instruction Formats: all 32 bits wide
OP
OP
OP
rs rt rd sa funct
rs rt immediate
jump target
UEE 3303 <12> YL Huang Spring‘14 © NCTU
- 4. 4
ISA in a System
Application
Compiler
Operating
System
Firmware
Instr. Set Proc. I/O system
Datapath & Control
Digital Design
Circuit Design
Instruction Set
Architecture
Layout
° Coordination of many levels of abstraction
° Under a rapidly changing set of forces
° Design, Measurement, and Evaluation
UEE 3303 <13> YL Huang Spring‘14 © NCTU
- 5. 1
DCN2561
Computer Architecture
Lecture 2
Instructions: Language of the Computer
YuLun Huang
rtes.cn.nctu.edu.tw
UEE 3303 <1> YL Huang Spring‘14 © NCTU
von Neumann architecture
° Central processing unit (CPU) fetches instructions
from memory.
• Separate CPU and memory distinguishes programmable
computer.
° CPU registers help out: program counter (PC),
instruction register (IR), general-purpose registers,
etc.
° Memory holds data and instructions.
UEE 3303 <2> YL Huang Spring‘14 © NCTU
Registers vs. Memory
° MIPS: arithmetic instructions operands must be
registers,
— only 32 registers provided
° Compiler associates variables with registers
° What about programs with lots of variables
Control
Datapath
Memory
Input
Output
Processor I/O
UEE 3303 <3> YL Huang Spring‘14 © NCTU
Memory Organization
° Viewed as a large, single-dimension array, with an
address.
° A memory address is an index into the array
° "Byte addressing" means that the index points to
a byte of memory.
0
1
2
3
4
5
6
...
8 bits of data
8 bits of data
8 bits of data
8 bits of data
8 bits of data
8 bits of data
8 bits of data
UEE 3303 <4> YL Huang Spring‘14 © NCTU
- 6. 2
Memory Operands
° Complex data structures – array/structures – are kept in memory
° Arithmetic operations occur only on registers in MIPS instr.
• MIPS must include instructions that transfer data between memory and
registers
- Data transfer instructions
• To access a word in memory, the instruction must supply the memory
‘address’
UEE 3303 <5> YL Huang Spring‘14 © NCTU
Byte vs. Word
° Bytes are nice, but most data items use larger
"words"
° For MIPS, a word is 32 bits or 4 bytes.
0
4
8
12
...
32 bits of data
Word must start at addr
32 bits of data
the are multiples of 4
32 bits of data
32 bits of data Registers hold 32 bits of data
° 232 bytes with byte addresses from 0 to 232-1
° 230 words with byte addresses 0, 4, 8, ... 232-4
° Words are aligned
i.e., what are the least 2 significant bits of a word address?
- Left most: big endian
- Right most: little endian
UEE 3303 <6> YL Huang Spring‘14 © NCTU
Instructions
° Load and store instructions
° Example:
C code: A[12] = h + A[8];
MIPS code: lw $t0, 32($s3)
add $t0, $s2, $t0
sw $t0, 48($s3)
1. h is associated with $s2
2. base addr of array A is in
$s3
° Can refer to registers by name (e.g., $s2, $t2) instead of number
° Store word has destination last
° Remember arithmetic operands are registers, not memory!
Can’t write: add 48($s3), $s2, 32($s3)
UEE 3303 <7> YL Huang Spring‘14 © NCTU
So far
° Instruction Meaning
add $s1,$s2,$s3 $s1 = $s2 + $s3
sub $s1,$s2,$s3 $s1 = $s2 – $s3
lw $s1,100($s2) $s1 = Memory[$s2+100]
sw $s1,100($s2) Memory[$s2+100] = $s1
bne $s4,$s5,L Next instr. is at Label if $s4 ≠ $s5
beq $s4,$s5,L Next instr. is at Label if $s4 = $s5
j Label Next instr. is at Label
° Formats:
?
op rs rt rd shamt funct
op rs rt 16 bit address
op 26 bit address
R
I
J
R: register
I: immediate
UEE 3303 <8> YL Huang Spring‘14 © NCTU
- 7. 3
Assembly Language vs. Machine Language
° Assembly provides convenient symbolic representation
• much easier than writing down numbers
• e.g., destination first
° Machine language is the underlying reality
• e.g., destination is no longer first
° Assembly can provide 'pseudoinstructions'
• e.g., “move $t0, $t1” exists only in Assembly
• would be implemented using “add $t0,$t1,$zero”
° When considering performance you should count real instructions
UEE 3303 <9> YL Huang Spring‘14 © NCTU
Other Issues
° Discussed in your assembly language programming lab:
support for procedures
linkers, loaders, memory layout
stacks, frames, recursion
manipulating strings and pointers
interrupts and exceptions
system calls and conventions
° Some of these we'll talk more about later
° We’ll talk about compiler optimizations when we hit chapter 4.
UEE 3303 <10> YL Huang Spring‘14 © NCTU
Overview of MIPS
° simple instructions all 32 bits wide
° very structured, no unnecessary baggage
° only three instruction formats
op rs rt rd shamt funct
op rs rt 16 bit address
op 26 bit address
R
I
J
° rely on compiler to achieve performance
— what are the compiler's goals?
° help compiler where we can
UEE 3303 <11> YL Huang Spring‘14 © NCTU
- 8. 1
UEE3303
Introduction to Embedded Systems
Lecture 3
ARM
YuLun Huang
http://rtes.cn.nctu.edu.tw
Ď
UEE 3303 <1> YL Huang Spring ‘14 © NCTU
ARM instruction set
° ARM versions
° ARM assembly language
° ARM programming model
° ARM memory organization
° ARM data operations
° ARM flow of control
UEE 3303 <2> YL Huang Spring ‘14 © NCTU
ARM versions
° ARM architecture has been extended over several
versions
• ARM7
• ARM9/9E
• ARM10E
• ARM11
• Cortex
• SecurCore
° We will concentrate on ARM7
UEE 3303 <3> YL Huang Spring ‘14 © NCTU
ARM11 FamilyĎ
CatchĎ Tightly
Couple
MemoryĎ
Memory
ManagementĎ
AHBĎ Thumb Ď DSP Ď Jazelle Ď
ARM11MP
Core Ď
MM
U+cache
coherency Ď
1× or
2×AMBA
AXI Ď
v Ď v Ď v Ď
ARM1136J
(F)-S Ď
variable Ď v Ď MMU Ď 5×AHB Ď vĎ v Ď v Ď
ARM1156T
2(F)-S Ď
variable Ď v Ď MPU Ď 3×AXI Ď v Ď v Ď x Ď
ARM1176J
Z(F)-S Ď
variable Ď v Ď MMU+
TrustZone Ď
4×AXI Ď v Ď v Ď v Ď
UEE 3303 <4> YL Huang Spring ‘14 © NCTU
- 9. 2
ARM Design Philosophy
Ď° Many physical features drove the ARM processor design:
• Portability (require some form of battery power): smaller
- reduce power consumption and extend battery operation
-essential for applications (eg. PDAs).
- more available space for specialized peripherals (low cost)
• Limited Memory (due to cost and/or physical size restrict)
- High code density
• Price sensitive:
- Use slow and low-cost memory devices
° ARM core: not a pure RISC architecture due to the
constraints of its primary application - the embedded
system.
• In some sense, the strength of the ARM core is that it does
not take the RISC concept too far.
° The key is not raw processor speed but total effective
system performance and power consumption. UEE 3303 <6> YL Huang Spring ‘14 © NCTU
UEE 3303 <5> YL Huang Spring ‘14 © NCTU
ARM vs. MIPSĎ
° ⎰Ἕ㊯Ẍ
• MIPS ㊯Ẍ⣒忶䯉╖炻ARM㊯Ẍ▿娎⎴㗪⬴ㆸ怷廗嗽䎮冯䦣
ỵ嗽䎮
° 忋临屯㕁嗽䎮
• 慵㕘姕妰ġlw/swġ㊯Ẍ炻ἧ℞⎗ẍ忋临⁛廠屯㕁炻㍸ὃ屯㕁䘬
⁛廠㓰䌯
° 㡅ẞ⺷㊯Ẍ
• ὅ㒂⇵朊➟埴䳸㝄㰢⭂㗗⏎➟埴娚㊯Ẍ炻啱ẍ㍸檀㊯Ẍ䘬➟
埴㓰䌯
° 䯉妨ᷳ, ARM ㍉䓐悐↮ġRISC 姕妰㤪⾝:
• Load-store architecture
• Fixed-length 32-bit instructions
• 3-address instruction format
ARM Design Philosophy
Ď° The ARM instruction set differs from the pure RISC
definition in several ways that make the ARM
instruction set suitable for embedded applications:
• Variable cycle execution for certain instructions
• Inline barrel shifter leading to more complex instructions
• Thumb 16-bit instruction set
• Conditional execution
• Enhanced instructions
° These additional features have made the ARM
processor one of the most commonly used 32-bit
embedded processor cores. Ď
UEE 3303 <7> YL Huang Spring ‘14 © NCTU
High Code Density?Ď
° Two types of instruction sets
- Subset of ARM instructions
ARMĎ ThumbĎ
• ARM instructions: 32 bit
• Thumb instructions: 16 bits
Length/instructionĎ 32 bitĎ 16 bitĎ
Number of Instr.Ď NĎ 1.4NĎ
Code sizeĎ K Ď 0.7KĎ
Code DensityĎ LowĎ High
Performance (16bit memory)Ď PĎ 1.43P (faster)
UEE 3303 <8> YL Huang Spring ‘14 © NCTU
- 10. 3
Different ARM cores: StrongARM vs. XscaleĎ
CatchĎ Tightly
Couple
MemoryĎ
Memory
Mangem
entĎ
AHBĎ Thumb Ď DSP Ď Jazelle Ď
Strong
ARM Ď
16K/8K Ď xĎ MMU Ď N/A Ď xĎ xĎ xĎ
XScale Ď 32K/32K Ď xĎ MMU Ď N/A Ď vĎ vĎ xĎ
UEE 3303 <9> YL Huang Spring ‘14 © NCTU
ARM ArchitectureĎ
° 7 modes
• usr – normal execution
• sys – privileged OS tasks
• fiq – fast interrupt
• irq – general interrupt
• svc – protected mode for OS
• abt – vir mem (mem protect)
• und – for s/w emulation
° 37 registers
• 30: general purpose
• 6: status
• 1: program counter
UEE 3303 <10> YL Huang Spring ‘14 © NCTU
ModesĎ
ModeĎ CodeĎ DescriptionĎ
User (usr)Ď 10000Ď Normal mode; only condition flags in cpsr
can be changedĎ
FIQ (fiq)Ď 10001Ď Fast interruptĎ
IRQ (irq)Ď 10010Ď Normal interruptĎ
Supervisor (svc)Ď 10011Ď OS kernelĎ
Abort (abt)Ď 10111Ď Memory protectionĎ
Undefined (und)Ď 11011Ď Software emulationĎ
System (sys)Ď 11111Ď Normal mode, but be able to r/w cpsrĎ
UEE 3303 <11> YL Huang Spring ‘14 © NCTU
RegistersĎ
° ARM 嗽䎮☐㚱ġ37ġᾳ㙓⬀☐炻⊭㊔
• [15] 30ᾳ忂䓐㙓⬀☐
• [1] 1 PC
• [1] 6ġᾳ䉨ン㙓⬀☐烉CPSR x 1 + SPSR x 5
° ARM 㚱ġ7ġ䧖ⶍἄ㧉⺷
• 㭷ᶨ䧖㧉⺷ᶳ悥㚱ᶨ䳬䚠⮵䘬㙓⬀☐冯ᷳ⮵ㅱ
UEE 3303 <12> YL Huang Spring ‘14 © NCTU
- 11. 4
ARM Register OrganizationĎ
UEE 3303 <13> YL Huang Spring ‘14 © NCTU
ARM registersĎ
° There are up to 17 active registers:
• 16 data registers and 2 processor status registers
• data registers are visible to the programmer as R0 to R15
- R0 ~ R7:不分組暫存器,真正的通用暫存器。
- R8 ~ R14:分組暫存器,與處理器模式有關。
° three special registers: R13, R14, and R15
• R13 - stack pointer (sp), stores the head of the stack in the
current processor mode
• R14 - link register (lr), where the core puts the return address
whenever it calls a subroutine
• R15 - program counter (pc), contains the address of the next
instruction to be fetched by the processor
° R13 and R14 can also be used as general-purpose
registers, but DANGEROUS!!
° One more register: PSR Ď
UEE 3303 <14> YL Huang Spring ‘14 © NCTU
ARM registersĎ
° two program status registers (PSR): CPSR and SPSR
• current program status registers烉⃚⬀䚖⇵䉨ン炻⏓㕿㧁ˣᷕ㕟ỵ⃫…
• saved program status registers烉ᾅ䔁ġCPSRġ䘬䉨ン
° The register file contains all the registers available to a
programmer
° Which registers are visible to the programmer depend
upon the current mode of the processor.
UEE 3303 <15> YL Huang Spring ‘14 © NCTU
Example: When FIQ Exception Occurs..Ď
UEE 3303 <16> YL Huang Spring ‘14 © NCTU
- 12. 5
Then, the ARM processorĎ
° When an exception occurs, the ARM core:
• SPSR_fiq ← CPSR
• Set CPSR bits
- T: thumb or arm
- Mode = 10001 (fiq)
- Disable interrupt, if appropriate
• Map registers
• LR_fiq ← PC
• PC ← 0x0000 001c (vector address)
° To return, the exception handler need to:
• CPSR ← SPSR_fiq
• PC ← LR_fiqĎ
UEE 3303 <17> YL Huang Spring ‘14 © NCTU
ARM programming model
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13
R14
R15 (PC)
31 0
CPSR
N Z C V
N: Negative/Less Than
Z: Zero
C: Carry/Borrow/Extend
V: OverflowĎ
T:ġ嬻嗽䎮☐⎗ẍ冒䓙⛘⛐
ARMġġThumbġᷳ攻↯㎃Ď
UEE 3303 <18> YL Huang Spring ‘14 © NCTU
Endianness
° Relationship between bit and byte/word ordering
defines endianness:
bit 31 bit 0 bit 0 bit 31
byte 3 byte 2 byte 1 byte 0 byte 0 byte 1 byte 2 byte 3
little-endian big-endian
UEE 3303 <19> YL Huang Spring ‘14 © NCTU
ARM data types
° Word is 32 bits long
° Word can be divided into four 8-bit bytes
° ARM addresses cam be 32 bits long
° Address refers to byte
• Address 4 starts at byte 4
° Can be configured at power-up as either little- or
big-endian mode
UEE 3303 <20> YL Huang Spring ‘14 © NCTU
- 13. 6
ARM status bits
° Every arithmetic, logical, or shifting operation sets
CPSR bits:
• N (negative), Z (zero), C (carry), V (overflow)
° Examples:
• -1 + 1 = 0: NZCV = 0101
• 231-1+1 = 231: NZCV = 0000
• -2 + -5 = -7: NZCV = 1010
• N is set as bit 31
• Z is set result is 0
• V is set when the register cannot properly represent the result as a
signed value (you overflowed into the sign bit).
• C is set when the register cannot properly represent the result as
an unsigned value (no sign bit required).
Ď
UEE 3303 <21> YL Huang Spring ‘14 © NCTU
Carry vs. Overflow (8-bit examples): generic conceptĎ
° Unsigned operation: 0x70 + 0x68 = 0xD8
• No carry, no oVerflow
° Unsigned operation: 0xC0 + 0xD8 = 0x98
• Carry, but no oVerflow
• Sign of the result is correct
• The "correct" answer is actually 0x198.
° Signed operation: -0x40 + -0x28 = -0x68
• No carry, no "oVerflow"
• Result of the arithmetic is correct
° Signed operation: 0x70 + -0x98 = 0x28
• No carry, but oVerflow
• The answer is obviously wrong
• The V flag reveals that the "correct" answer is -0x28.Ď
UEE 3303 <22> YL Huang Spring ‘14 © NCTU
ARM InstructionsĎ
UEE 3303 <23> YL Huang Spring ‘14 © NCTU
ARM ASM Ď
.text ; Executable code follows
_start: .global _start ; "_start" is required by the linker
.global main ; "main" is our main program
b main ; Start running the main program
main: ; Entry to the function "main"
; Insert your code here
mov pc,lr ; Return to the caller
.endĎ
UEE 3303 <24> YL Huang Spring ‘14 © NCTU
- 14. 7
Types of ARM InstructionsĎ
° Arithmetic operations
° Comparisons (no results - just set condition codes)
° Logical operations
° Data movement between registersĎ
UEE 3303 <25> YL Huang Spring ‘14 © NCTU
Arithmetic OperationsĎ
° Syntax
• <Operation>{<cond>}{S} Rd, Rn, Operand2
° Operations are
• ADD operand1 + operand2
• ADC operand1 + operand2 + carry
• SUB operand1 - operand2
• SBC operand1 - operand2 + carry -1
° Examples
ADD r0, r1, r2
SUBGT r3, r3, #1
UEE 3303 <26> YL Huang Spring ‘14 © NCTU
ComparisonsĎ
° The only effect of the comparisons is to
• UPDATE THE CONDITION FLAGS. (no need to set S bit.)
° Syntax:
• <Operation>{<cond>} Rn, Operand2
° Operations are:
• CMP operand1 - operand2, but result not written
• CMN operand1 + operand2, but result not written
• TST operand1 AND operand2, but result not written
• TEQ operand1 EOR operand2, but result not written
° Examples:
CMP r0, r1
TSTEQ r2, #5Ď
UEE 3303 <27> YL Huang Spring ‘14 © NCTU
Logical OperationsĎ
° Syntax:
• <Operation>{<cond>}{S} Rd, Rn, Operand2
° Operations are:
• AND operand1 AND operand2
• EOR operand1 EOR operand2
• ORR operand1 OR operand2
• BIC operand1 AND NOT operand2 [ie bit clear]
° Examples
AND r0, r1, r2
BICEQ r2, r3, #7
EORS r1,r3,r0Ď
UEE 3303 <28> YL Huang Spring ‘14 © NCTU
- 15. 8
Data MovementĎ
° Syntax:
• <Operation>{<cond>}{S} Rd, Operand2
° Operations are:
• MOV operand2
• Note that it makes no use of operand1.
° Examples:
MOV r0, r1
MOVS r2, #10
UEE 3303 <29> YL Huang Spring ‘14 © NCTU
GCD in CĎ
int gcd(int a, int b){
int c;
while ( a != b) {
if (a > b)
c = a - b;
else
c = b-a; b = a; a = c;
}
return a;
}
UEE 3303 <30> YL Huang Spring ‘14 © NCTU
Convert & Replace variables with registersĎ
UEE 3303 <31> YL Huang Spring ‘14 © NCTU
ARM CodeĎ
gcd
cmp r0, r1 ;reached the end?
beq stop
blt less ;if r0 > r1
sub r0, r0, r1 ;subtract r1 from r0
bal gcd
less
sub r1, r1, r0 ;subtract r0 from r1
bal gcd
stop
UEE 3303 <32> YL Huang Spring ‘14 © NCTU
- 16. 9
ARM Conditional Assembler
Ďgcd
cmp r0, r1 ;if r0 > r1
subgt r0, r0, r1 ;subtract r1 from r0
sublt r1, r1, r0 ;else subtract r0 from r1
bne gcd ;reached the end?Ď
UEE 3303 <33> YL Huang Spring ‘14 © NCTU
QEMU EMULATORĎ
UEE 3303 <34> YL Huang Spring ‘14 © NCTU
ARM EmulatorĎ
° QEMU
• an emulator that emulate real machines
• supported platforms: arm MIPS x86….
° QEMU Tools
• Qemu.exe àemulator
• Qemu-img.exe àdisk image tool
xx.binĎ
Realview-ebĎ
xx.binĎ
Realview-ebĎ
Qemu Ď Qemu Ď
UbuntuĎ
VMPlayer/Virtual
X86Ď
BoxĎ
WindowsĎ
UbuntuĎ
UEE 3303 <35> YL Huang Spring ‘14 © NCTU
So, after launch VMPlayerĎ
° You login to ubuntu
° Launch QEMU
• qemu-system-arm
• qemu-arm
° You need to specify the target to be emulated
° You also need to specify the kernel image for the
targetĎ
UEE 3303 <36> YL Huang Spring ‘14 © NCTU
- 17. 10
Our QEMU supports..Ď
codeĎ targetĎ codeĎ targetĎ
syborgĎ Symbian Virtual
PlatformĎ
borzoiĎ PDA, PXA270Ď
musicpalĎ Marvell 88w8618Ď terrierĎ PDA, PXA270Ď
mainstoneĎ PXA27xĎ connexĎ Gumstix PXA255Ď
N800, n810Ď Nokia N800/N810 tabletĎ verdexĎ Gumstix PXA270Ď
cheetahĎ Palm TungstenĎ lm3s811evbĎ StellarisĎ
sx1Ď Siemens SX1 v2Ď lm3s6965evbĎ StellarisĎ
sx1-v1Ď Siemens SX1 v1Ď realview-ebĎ ARM926Ď
tosaĎ PDA, PXA255Ď realview-eb-mpcore
Ď
ARM11Ď
akitaĎ PDA, PXA270Ď realview-pb-a8Ď Cortex-A8Ď
spitzĎ PDA, PXA270Ď versatilepbĎ …Ď
UEE 3303 <37> YL Huang Spring ‘14 © NCTU
忚ℍġqemu ᷳ⼴Ď
° ⛐➟埴ġQEMU ⼴炻㚫↢䎦ˬ(qemu)˭ġ䘬㍸䣢ˤ⛐忁ᾳ㍸䣢ᶳ⎗ẍ廠ℍ
ᶨṃ㊯ẌἮ㑵ἄġQEMUˤ
° QEMU ㊯Ẍ
• help ㆾġ? [cmd]: 栗䣢婒㖶㔯⫿Ď
• info: 栗䣢䲣䴙䉨ンˤἳ烉Ď
• info network - 栗䣢䵚嶗ṳ朊䉨ンĎ
• info block - 栗䣢⃚⬀墅伖䉨ンĎ
• info registers - 栗䣢ġCPU 䘬㙓⬀☐䉨ンĎ
• info history - 栗䣢㬟⎚㊯ẌĎ
• What else?
UEE 3303 <38> YL Huang Spring ‘14 © NCTU
infoĎ
° info version -- show the version of QEMU
° info network -- show the network state
° info chardev -- show the character
devices
° info block -- show the block devices
° info blockstats -- show block device
statistics
° info registers -- show the cpu registers
° info cpus -- show infos for each CPU
° info history -- show the command line
history
° info irq -- show the interrupts statistics (if
available)
° info pic -- show i8259 (PIC) state
° info pci -- show PCI info
° info jit -- show dynamic compiler info
° info kvm -- show KVM information
° info numa -- show NUMA information
° info usb -- show guest USB devices
° info usbhost -- show host USB devices
° info profile -- show profiling information
° info capture -- show capture information
° info snapshots -- show the currently
saved VM snapshots
° info status -- show the current VM status
(running|paused)
° info pcmcia -- show guest PCMCIA
status
° info mice -- show which guest mouse is
receiving events
° info vnc -- show the vnc server status
° info name -- show the current VM name
° info uuid -- show the current VM UUID
° info usernet -- show user network stack
connection states
° info migrate -- show migration status
° info balloon -- show balloon information
° info qtree -- show device tree
° info qdm -- show qdev device model list
° info roms -- show roms
UEE 3303 <39> YL Huang Spring ‘14 © NCTU
忚ℍġqemu ᷳ⼴Ď
° q ㆾġquit:ġ斄攱㧉㒔☐
° eject [-f] device烉徨↢墅伖ˤġ-f 堐䣢⻟⇞徨↢
° change device filename:ġ㚜㎃㉥⍾⺷⨺橼炻⤪庇䡇䇯ㆾ䡇䇯ˤ
° screendump filename: ㇒⍾坊ⷽ䔓朊炻⃚⬀ㆸġPPM ⼙⁷ˤġlog
item1[,...]: ⮯㊯⭂䘬枭䚖ᷳġLOG ⮓ℍġ/tmp/qemu.log ᷕˤ
° savevm filename: ⮯㔜ᾳ㧉㒔☐䉨ン⃚⬀军㨼㟰ᷕ
° loadvm filename: 䓙㨼㟰ᷕ庱ℍ㧉㒔☐䉨ン
° Stop: 㬊㧉㒔
° c ㆾġcont: 两临㧉㒔
° sendkey keys: ⁛復㝸ᾳkey䴎㧉㒔☐ˤἧ䓐ġ- Ἦ忋䳸墯⎰挝ˤ
• ἳ烉``sendkey ctrl-alt-f1”ġ堐䣢⁛復ġ<Ctrl><Alt><F1> 䴎㧉㒔☐ˤ
° system_reset:ġ慵㕘┇≽䲣䴙ˤĎ
UEE 3303 <40> YL Huang Spring ‘14 © NCTU
- 18. A R M 組合語言與指令集介紹
!
!!!㛔䪈ṳ䳡 BSN ㊯Ẍ普ˣUivnc ㊯Ẍ普炻ẍ⍲⎬栆㊯Ẍ⮵ㅱ䘬⭂⛨㕡⺷炻忂忶⮵
㛔䪈䘬教嬨炻ⶴ㛃嬨侭傥䝕妋 BSN ⽖嗽䎮☐㓗㎜䘬㊯Ẍ普⍲℟橼䘬ἧ䓐㕡㱽ˤ!
!!!!
1 A R M 指令集的分類與格式
BSN ⽖嗽䎮☐䘬㊯Ẍ普㗗Ⱄ㕤!庱ℍ0⬀⚆!✳䘬炻ḇ⌛㊯Ẍ普傥嗽䎮㙓⬀
☐ᷕ䘬屯㕁炻侴ᶼ嗽䎮䳸㝄悥天㓦⚆㙓⬀☐ᷕ炻侴⮵䲣䴙姀ㅞ橼䘬⬀⍾⇯暨天忂
忶⮰攨䘬!庱ℍ0⬀⚆!㊯ẌἮ⬴ㆸˤ!
BSN⽖嗽䎮☐䘬㊯Ẍ普⎗ẍ↮䁢嶛廱㊯Ẍˣ屯㕁嗽䎮㊯Ẍˣ䦳⺷䉨ン㙓⬀☐
炷QTS炸嗽䎮㊯Ẍˣ庱ℍ0⬀⚆㊯Ẍˣ庼≑忳䬿☐㊯Ẍἳ⢾䓊䓇㊯Ẍℕ⣏栆炻℟
橼䘬㊯Ẍ⍲≇傥⤪堐3.2䣢炷堐ᷕ㊯Ẍ䁢➢㛔BSN㊯Ẍ炻ᶵ⊭㊔埵䓇䘬BSN㊯Ẍ炸ˤ!
BSN 䘬㊯Ẍ普⣏农ᶲ⎗ẍ↮䁢ℕ⣏栆烉!
l 嶛廱㊯Ẍ)Csbodi!Jotusvdujpot*烉!
忂ⷠ㗗䓐Ἦ 䦳⺷㳩䦳㍏⇞ˤ!
l 屯㕁嗽䎮㊯Ẍ)Ebub.qspdfttjoh!Jotusvdujpot*烉!
ᶨ凔䘬㙓⬀☐忳䬿㊯Ẍˤ!
l 庱ℍ⬀⚆㊯Ẍ)Mpbe!boe!Tupsf!Jotusvdujpot*烉!
⮵姀ㅞ橼㙓⬀☐ᷳ攻䘬屯㕁㏔䦣㊯Ẍˤ!
l 䉨ン㙓⬀☐⬀⍾㊯Ẍ)Tubuvt!Sfhjtufs!Usbotgfs!Jotusvdujpot*烉!
⬀⍾ DQTS TQTS 㙓⬀☐䘬䚠斄㊯Ẍˤ!
l 庼≑忳䬿☐)⋼⎴嗽䎮☐*㊯Ẍ)Dpqspdfttps!Jotusvdujpot*烉!
⬀⍾⋼⎴嗽䎮☐ㆾ冯⋼⎴嗽䎮☐㹅忂ᷳ㊯Ẍˤ!
l ἳ⢾䓊䓇㊯Ẍ)Fydfqujpo.hfofsbujoh!Jotusvdujpot*烉!
䓊䓇庇橼ᷕ㕟℞Ṿἳ⢾䘬㊯Ẍˤ!
!
㊯Ẍ䫎嘇! ㊯Ẍ≇傥㍷徘!
㔠⬠忳䬿)Bsjuinfujd!jotusvdujpo* !
BED! 䲵ℍ忚ỵ㕿㧁䚠≈㊯Ẍ!
BEE! ≈㱽㊯Ẍ!
DNO! 㭼庫⍵嘇㊯Ẍ!
DNQ! 㭼庫㊯Ẍ!
TVC! 㷃㱽㊯Ẍ!
TVD! 䲵ℍ忚ỵ㕿㧁䚠㷃㊯Ẍ!
NMB! 43 ỵ⃫䚠Ḁ᷎䚠≈㊯Ẍ!
NVM! 43 ỵ⃫Ḁ㱽㊯Ẍ!
STC! ⮵婧䚠㷃㊯Ẍ!
STD! 䲵ℍ忚ỵ㕿㧁⮵婧䚠㷃㊯Ẍ!
怷廗忳䬿)Mphjd!jotusvdujpo* !
BOE! BOE 忳䬿㊯Ẍ!
! 第2 頁!
- 19. CJD! ỵ⃫㶭暞)cju!dmfbs*㊯Ẍ!
FPS! Fydmvtjwf!ㆾ!忳䬿㊯Ẍ!
PSS! PSS 忳䬿㊯Ẍ!
UFR! 䚠䫱㷔娎㊯Ẍ!
UTU! ỵ⃫㷔娎㊯Ẍ!
嶛廱㊯Ẍ)Csbodi!Jotusvdujpo* !
C! 嶛廱㊯Ẍ!
CM! ⷞ彼⚆䘬嶛廱㊯Ẍ!
CMY! ⷞ彼⚆䉨ン↯㎃䘬嶛廱㊯Ẍ!
CY! ⷞ䉨ン↯㎃䘬嶛廱㊯Ẍ!
庱ℍ㊯Ẍ)Mpbe!Jotusvdujpo* !
MEN! 庱ℍ⣂ᾳ㙓㊯Ẍ!
MES! 姀ㅞ橼⇘㙓⬀☐䘬屯㕁⁛廠㊯Ẍ!
㏔䦣㊯Ẍ)Npwf!jotusvdujpo* !
NPW! 屯㕁⁛復)㏔䦣*㊯Ẍ!
NWO! 屯㕁⍾⍵㏔䦣㊯Ẍ!
NST! ⁛復 DQTS ㆾ TQTS 䘬㔠ῤ⇘ᶨ凔㙓⬀☐㊯Ẍ!
NTS! ⁛復ᶨ凔㙓⬀☐⇘ DQTS ㆾ TQTS 䘬㊯Ẍ!
庼≑忳䬿☐)⋼⎴嗽䎮☐*!)Dpqspdfttps!jotusvdujpo* !
NDS! ⽆ BSN 㙓⬀☐䘬㔠ῤ⇘庼≑忳䬿☐)⋼⎴嗽䎮☐*㙓⬀☐䘬屯㕁⁛廠㊯Ẍ!
NSD! ⽆庼≑忳䬿☐)⋼⎴嗽䎮☐*㙓⬀☐䘬㔠ῤ⇘ BSN 㙓⬀☐䘬屯㕁⁛廠㊯Ẍ!
MED! ⽆庼≑忳䬿☐)⋼⎴嗽䎮☐*㙓⬀☐䘬㔠ῤ⇘姀ㅞ橼䘬屯㕁⁛廠㊯Ẍ!
TUD! ⽆姀ㅞ橼ℏ䘬㔠ῤ⇘庼≑忳䬿☐)⋼⎴嗽䎮☐*㙓⬀☐䘬屯㕁⁛廠㊯Ẍ!
DEQ! 庼≑忳䬿☐屯㕁㑵ἄ㊯Ẍ!
庇橼ᷕ㕟)Tpguxbsf!Joufssvqu!jotusvdujpo* !
TXJ! 妠䘤庇橼ᷕ㕟㊯Ẍ!
TCD! ⷞῇỵ㷃㱽㊯Ẍ!
⃚⬀㊯Ẍ)Tupsx!jotusvdujpo* !
TUN! ⣂慵姀ㅞ橼⮓ℍ㊯Ẍ!
TUS! 㙓⬀☐⇘姀ㅞ橼䘬屯㕁⁛廠㊯Ẍ!
℞Ṿ㊯Ẍ)Puifst*!
OPQ! 䃉㊯Ẍ!
TXQ! 㙓⬀☐冯姀ㅞ橼㔠ῤṌ㎃㊯Ẍ!
堐 3 . 2 !!!B S N ㊯Ẍ⍲≇傥㍷徘!
!
1.1 ARM 條件式指令
ᶨ凔 BSN ㊯Ẍ䘬℠✳㊯Ẍ䶐䡤㟤⺷⤪ᶳ䣢烉!
42! 39! 38! 36! 35! 32! 31! 2:! 27! 26! 23! 22! 1!
dpoe! y!y!y! pqdpef! T! So! Se! tijgufs`pqfsboe!
!
℞ᷕ烉!
! dpoe! ! ! ㊯Ẍ➟埴䘬㡅ẞ⺷䶐䡤!
! pqdpef!! ! ㊯Ẍ㑵ἄ䫎嘇!
! T! ! ! ! ㊯⭂㗗⏎⛐忳䬿➟埴㗪枮ὧ㚜㕘 DQST 䘬㕿㧁!
! 第3 頁!
- 20. ! So! ! ! ! ⊭⏓䫔ᶨᾳ忳䬿⃫䘬䚖㧁㙓⬀☐䘬䶐嘇!
! Se! ! ! ! 屯㕁Ἦ㸸㙓⬀☐䘬䶐嘇!
! tijgufs`pqfsboe! 䫔Ḵᾳ屯㕁Ἦ㸸忳䬿⃫!
!
BSN 䘬㊯Ẍ⊭⏓ᶨᾳ⎗怠䘬㡅ẞ䡤ˤ⎒㚱⛐ DQTS ᷕ䘬㡅ẞ䡤㕿㧁㺧嵛㊯⭂䘬
㡅ẞ㗪炻ⷞ㡅ẞ䡤䘬㊯Ẍㇵ⎗ẍ➟埴ˤḇ⎗ẍ㟡㒂ᶨ㡅㊯Ẍ姕伖䘬㕿㧁炻㚱㡅ẞ
⛘➟埴⎎ᶨ㡅㊯Ẍˤ㭷ᶨ㡅 BSN ㊯Ẍ⊭⏓ 5 ỵ⃫䘬㡅ẞ䡤炻ỵ㕤㊯Ẍ䘬㚨檀 5
ỵ⃫42;39^ˤ㭷䧖㡅ẞ䡤⎗䓐ℑᾳ⫿⃫堐䣢炻忁ℑᾳ⫿⃫⎗ẍ㶣≈⛐㊯䫎嘇䘬
⼴朊㊯Ẍ⎴㗪ἧ䓐ˤἳ⤪炻嶛廱㊯Ẍ C ⎗ẍ≈ᶲ⯦䡤 FR 嬲䁢 CFR 堐䣢Ⱦ䚠䫱
⇯嶛廱ȿ炻⌛䔞 DQTS ᷕ䘬 [ 㕿㧁䁢 2 㗪䘤䓇嶛廱ˤ㡅ẞ䶐䡤㚱⤪ᶳ⸦䧖烉!
!
䶐䡤
4 2 ; 3 9 ^ !
㡅ẞ㍷
徘!
䉨ン㕿㧁! 忳䬿⏓佑! ㊯Ẍ䭬ἳ!
1111! FR! [!>!2! 䚠䫱! CFR!
1112! OF! [!>!1! ᶵ䫱ῤ! COF!
1121! DT0IT! D!>2! ⣏㕤䫱㕤! CDT!
1122! DD0MP! D!>!1! ⮷㕤! CDD!
1211! NJ! O!>2! 屈ῤ! CNJ!
1212! QM! O!>1! 㬋㔠ㆾ暞! CQM!
1221! WT! W!>!2! 㹊ỵ! CWT!
1222! WD! W!>!1! 䃉㹊↢! CWD!
2111! IJ! D!>!2!boe![!>!1! ⣏㕤! CIJ!
2112! MT! D!>!1!ps![!w! ⮷㕤䫱㕤! CMT!
2121! HF! O!>W!! ⣏㕤䫱㕤! CHF!
2122! MU! O!ɽ!W!! ⮷㕤! CMU!
2211! HU! [!>!1!boe!O!>!W! ⣏㕤! CHU!
2212! MF! [!>!2炻ps!O!ɽ!W! ⮷㕤ㆾ䫱㕤! CMF!
2221! BM! Boz! 枸姕ῤ! CBM!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!堐 3 . 3 !㡅ẞ⺷⭂佑ˣ䶐䡤冯嶛廱㊯Ẍ䭬ἳ!
!
BSN ㊯Ẍ⎗㟡㒂➟埴䳸㝄Ἦ怠㑯㗗⏎㚜㕘㡅ẞ㕿㧁ỵ⃫ˤ劍天㚜㕘㡅ẞ㕿㧁ỵ
⃫炻枰⛐㊯Ẍᷕ⊭⏓⯦䡤ȾTȿˤ!
ᶨṃ㊯Ẍᶵ暨天⯦䡤ȾTȿ炻⤪ DNQˣDNOˣUTU UFRˤ⬫Ᾱ䘬≇傥㛔Ἦ⯙㗗
㚜㕘㡅ẞ㕿㧁ỵ⃫䘬ˤ!
2 A R M 指令的定址方式
⭂⛨㕡⺷⯙㗗嗽䎮☐㟡㒂㊯Ẍᷕ䴎↢䘬ỵ⛨屯妲Ἦ⮳㈦⮎晃ỵ⛨䘬㕡⺷ˤ䚖
⇵ BSN ㊯Ẍ䘬⭂⛨㕡⺷)⭂⛨㱽*➢㛔ᶲ⎗ẍ↮䁢ẍᶳ⸦䧖烉!
!
2/!䩳⌛⭂⛨!
㊯Ẍᷕ⊭⏓Ḯ忳䬿⃫炻⌛䩳⌛㔠ˤἳ⤪烉!
BEE!S1炻S1炻炲2! ! ! 烊S1ɤS1為2!
! 第4 頁!
- 21. BEE!S1炻S1炻炲1y4g! ! 烊S1ɤS1為1y4g!
!
⛐ẍᶲℑ㡅㊯Ẍᷕ炻䫔Ḵᾳ屯㕁Ἦ㸸忳䬿⃫)㔠ῤ*⌛䁢䩳⌛㔠炻᷎天㯪ẍ
Ⱦ炲ȿ䁢⋨↮炻⮵㕤ẍ⋩ℕ忚ỵ堐䣢䘬䩳⌛㔠炻怬天㯪⛐Ⱦ炲ȿ⼴≈ᶲȾ1yȿㆾ
Ⱦ'ȿˤ! !
!
3/!㙓⬀☐䚜㍍⭂⛨!
㊯Ẍᷕ䘬ỵ⛨䶐䡤悐↮䴎↢㝸ᶨ㙓⬀☐䶐嘇炻忳䬿⃫)㔠ῤ*⛐㙓⬀☐ᷕˤἳ
⤪烉!
BEE!S1-S2-S3! <S2,S3àS1!
娚㊯Ẍ䘬➟埴枮⸷䁢⮯㙓⬀☐S2S3䘬㔠ῤ䚠≈炻⮯℞䳸㝄⬀㓦⛐㙓⬀☐S1
ᷕˤ!
!
4/ 㙓⬀☐攻㍍⭂⛨!
㙓⬀☐攻㍍⭂⛨⯙㗗ẍ㙓⬀☐ᷕ䘬ῤἄ䁢忳䬿⃫䘬ỵ⛨炻侴忳䬿⃫㛔幓⬀㓦
⛐姀ㅞ橼ᷕˤἳ⤪烉!
MES!!S1-!S2^! <S2^àS1!!00⮯ S2 ㊯⎹䘬姀ㅞ橼ᷕ䘬ℏ⭡庱ℍ⇘ S1 ᷕˤ!
TUS!!S1炻S2^! 烊S2^ɤS1!00⮯ S1 䘬ῤ⁛復⇘ẍ S2 䘬ῤ䁢ỵ⛨䘬姀ㅞ橼
ᷕˤ!
!
5/ 㙓⬀☐䦣ỵ⭂⛨!
䫔Ḵᾳ㙓⬀☐ᷕ⬀㓦䘬忳䬿⃫⃰忚埴䦣ỵ㑵ἄ炻䃞⼴冯䫔ᶨᾳ忳䬿⃫䳸⎰ˤ
ἳ⤪烉!
BEE!S1-!S2-!S3!MTM!$4!! <S2,S3+9àS1!!00S3 ᷕ䘬忳䬿⃫ⶎ䦣 4 ỵ⃫!
!
⎗ẍ㍉䓐䘬䦣ỵ㊯Ẍ㚱ẍᶳ⸦䧖烉!
MTM)Mphjdbm!Tijgu!Mfgu*烉怷廗ⶎ䦣ˤ㙓⬀☐ᷕ䘬忳䬿⃫ⶎ䦣ᶨỵ炻MTM
⽆!
cju!1 Ỷỵ墄 1 忚Ἦˤ!
MTS)Mphjdbm! Tijgu! Sjhiu*烉怷廗⎛䦣ˤ㙓⬀☐ᷕ䘬忳䬿⃫⎛䦣ᶨỵ炻
MTS!
⽆ cju!42 檀ỵ墄 1!忚Ἦˤ!
BTS)Bsjuinfujd!Tijgu!Sjhiu*烉䬿埻⎛䦣ˤBsjuinfujd!Tijgu ẋ堐ᾅ
䔁㬋!
屈嘇㪬ỵ℞Ṿ ỵ䦣≽ἄˤ⚈㬌䦣ỵ⃫䘬忶䦳ᷕㅱᾅ㊩忳䬿⃫䘬䫎嘇ᶵ嬲ˤ!
㙓⬀☐ᷕ䘬忳䬿⃫⎛䦣ᶨỵˤ劍忳䬿⃫䁢㬋㔠炻⇯ cju!42 墄 1ˤ劍忳䬿⃫䁢!
屈㔠炻⇯ cju!42!墄忚 2ˤ!
SPS)Spubuf!Sjhiu*烉徜⚰⎛䦣ˤ㙓⬀☐ᷕ䘬忳䬿⃫⎛䦣ᶨỵ炻㚨檀ỵ⃫
䨢!
↢ỵ⃫᷎䦣ℍ㚨Ỷỵ䦣↢䘬ỵ⃫ˤ!
SSY)Spubuf!Sjhiu!fYufoefe*烉⺞Ỡ SPS 䘬徜⚰⎛䦣ˤ㙓⬀☐ᷕ䘬忳䬿
⃫⎛!
䦣ᶨỵ炻㚨檀ỵ⃫䨢↢ỵ⃫⼴䓐⍇Ἦ DQTS 䘬㕿㧁ỵ⃫ᷕ䘬ῤ⠓ℍˤ!
!
! 第5 頁!
- 22. 6/ ⣂㙓⬀☐⭂⛨!
䓐㬌㕡⺷⎗ᶨ㫉⁛怆⸦ᾳ㙓⬀☐ᷕ䘬ῤˤ⃩姙⛐ᶨ㡅㊯Ẍᷕ㚨⣂⁛復 27 ᾳ
ᶨ凔㙓⬀☐䘬ảỽ⫸普ˤἳ⤪烉!
MENJB!!S1-!|S2-!S3-!S4~! <!S1^àS2!
!! ! ! ! ! ! !!!!<!S1,5^àS3!
!! ! ! ! ! ! !!!<!S1,9^àS4!
娚㊯Ẍ䘬⯦䘬 JB 堐䣢㭷㫉➟埴⬴ᶳ庱0⬀⚆㑵ἄ⼴炻S1 ㊱ Xpse 攟⹎⡆≈炻!
⚈㬌㊯Ẍ⎗⮯忋临姀ㅞ橼䘬ῤ⁛復⇘ S2S4ˤ!
!
7/ ➢⛨⭂⛨!
㬌㕡⺷㗗⮯➢⛨㙓⬀☐ᷕ䘬ℏ⭡冯㊯Ẍᷕ䘬ῷ䦣慷䚠≈炻⼿⇘忳䬿⃫䘬⬀㓦
ỵ⛨ˤ➢⛨⭂⛨䓐㕤⬀⍾➢⸽ỵ⛨旬役䘬姀ㅞ橼ˤἳ⤪烉!
MES!S1-!S2-!$9^! ! ! <S2,9^àS1!
MES!S1-!S2,S3^! ! ! <S2,S3^àS1!
!
➢⛨⭂⛨⊭㊔⇵䳊⺽⼴䳊⺽⭂⛨ˤ!
⇵䳊⺽⭂⛨㊯⮯➢⸽ỵ⛨≈ᶲῷ䦣慷ᷳ⼴䓊䓇䘬ỵ⛨ἄ䁢㚱㓰ỵ⛨ˤἳ⤪烉!
MES!S1-!S2-!$9^! ! ! <S2,9^àS1!
!
⼴䳊⺽⭂⛨㊯⮯ᶵⷞ㚱ῷ䦣慷䘬➢⸽ỵ⛨ἄ䁢㚱㓰ỵ⛨ˤ!
MES!S1-!S2^-!$9! ! ! <S2^àS1!
!! ! ! ! ! ! !!!<S2,9àS2!
!
⎎⢾炻䫎嘇Ⱦ炰ȿ⎗ẍ䓐Ἦἧ㊯Ẍ➟埴⬴⼴㚜㕘➢⸽ỵ⛨ˤἳ⤪烉!
MES!S1-!S2-!$9^"!! ! <S2,9^àS1!
!! ! ! ! ! ! !!!!<S2,9àS2!
!
8/ ➮䔲⭂⛨!
➮䔲⭂⛨⌛⇑䓐➮䔲㊯㧁炻㊱䈡⭂枮⸷⬀⍾姀ㅞ橼╖⃫炻ἧ䓐 qvti ㊯Ẍ⎹➮!
䔲⮓屯㕁ˤἧ䓐 qpq ㊯Ẍ⽆➮䔲ᷕ嬨㔠㒂ˤ!
➮䔲⎗↮䁢ℑ䧖烉!
怆⡆➮䔲)btdfoejoh!tubdl*炻⌛➮䔲⎹檀ỵ⛨㕡⎹Ỡ⯽烊!
怆㷃➮䔲)eftdfoejoh!tubdl*炻⌛➮䔲⎹Ỷỵ⛨㕡⎹Ỡ⯽烊!
➮䔲㊯㧁㊯⎹㚨⼴⡻ℍ➮䔲䘬㚱㓰屯㕁炻䧙䁢㺧➮䔲)gvmm!tubdl*ˤ➮䔲㊯!!!!!
㧁㊯⎹ᶳᶨᾳ㚱㓰屯㕁⮯天⬀㓦䘬ỵ伖炻䧙䁢䨢➮䔲)fnquz!tubdl*ˤ!
㊱㬌䳬⎰炻⎗䓊䓇 5 䧖栆✳䘬➮䔲烉!
㺧怆⡆烉!!㺧➮䔲炻怆⡆➮䔲!
䨢怆⡆烉!!䨢➮䔲炻怆⡆➮䔲!
㺧怆㷃烉!!㺧➮䔲炻怆㷃➮䔲!
䨢怆㷃烉!!䨢➮䔲炻怆㷃➮䔲!
!
9/ 䚠⮵⭂⛨!
!!!㈲ QD ㊯㧁ἄ䁢➢⸽ỵ⛨ˤ妰䬿↢䚖䘬⛘⛨䎦埴㊯Ẍỵ⛨ᷳ攻䘬ῷ䦣慷ˤ!!!!!
!!!➢⸽ỵ⛨≈ῷ䦣慷⌛⼿⇘㚨䳪䘬㚱㓰ỵ⛨ˤἳ⤪烉!
! 第6 頁!
- 23. CM!TVCS! ! <嶛廱⇘ TVCS!
Ƀ!
!
!!!TVCS! Ƀ! ! ! ! <∗䦳⺷ℍ⎋!
NPW!QD-!S25! ! <彼⚆!
3 A R M 指令分類介紹
⇵朊䞍 BSN ㊯Ẍ⎗↮䁢ℕ⣏栆烉㍍ᶳἮ䁢忁ℕ⣏栆㊯Ẍ忚埴娛䳘䘬妋婒ˤ!!
3.1 記憶體存取指令
2/!MES TUS烉䓐㕤╖ᶨ xpse 䃉䫎嘇ỵ⃫䳬)Votjhofe!Czuf*㗪ˤ!
庱ℍ㙓⬀☐㊯Ẍ)MES*⮯屯㕁⽆姀ㅞ橼庱ℍ⇘㙓⬀☐ᷕˤ⃚⬀㙓⬀☐㊯Ẍ)TUS*
⮯屯㕁⽆㙓⬀☐⬀㓦⇘姀ㅞ橼ᷕˤ⎗䓐㕤 43 ỵ⃫ xpse ㆾ 9 ỵ⃫䃉䫎嘇ỵ⃫䳬ˤ
ỵ⃫䳬庱ℍ㚫䓐Ⱦ1ȿ⺞Ỡ军 43 ỵ⃫ˤ!
MES TUS 悥㚱⤪ᶳ 5 䧖⼊⺷烉!
l 暞ῷ䦣慷){fsp!pggtfu*!
pq|dpoe~|C~|U~!Se炻So^!
So 䘬ῤἄ䁢⁛復屯㕁䘬ỵ⛨ˤ!
!
l ⇵䳊⺽ῷ䦣)qsf.joefyfe!pggtfu*!
pq|dpoe~|C~!Se炻So炻Gmfypggtfu^|"~!
⛐屯㕁⁛復ᷳ⇵炻⮯ῷ䦣慷≈⇘ So ᷕˤ℞䳸㝄ἄ䁢⁛復屯㕁䘬姀ㅞ橼
ỵ⛨ˤ劍ἧ䓐⯦䡤Ⱦ"ȿ炻⇯䳸㝄⮓⚆⇘ So ᷕ炻ᶼ So ᶵ⃩姙㗗 S26ˤ!
!
l 䦳⺷䚠⮵ῷ䦣)qsphsbn!sfmbujwf*!
pq|dpoe~|C~!Se炻mbcfm!
䦳⺷䚠⮵ῷ䦣㗗⇵䳊⺽⼊⺷䘬⎎ᶨ䧖䇰㛔ˤ⽆ QD 妰䬿ῷ䦣慷炻᷎⮯ QD
ἄ䁢 So 䓊䓇⇵䳊⺽㊯Ẍˤᶵ傥ἧ䓐⯦䡤Ⱦ"ȿˤ!
!
l ⼴䳊⺽ῷ䦣)qptu.joefyfe!pggtfu*!
pq|dpoe~|C~|U~!Se炻So^炻Gmfypggtfu!
So 䘬ῤ䓐 ⁛復屯㕁䘬姀ㅞ橼ỵ⛨ˤ⛐屯㕁⁛復⼴炻⮯ῷ䦣慷≈⇘ So!
ᷕˤ䳸㝄⮓⚆⇘ SoˤSo ᶵ⃩姙㗗 S26ˤ!
!
℞ᷕ烉!
pq! 㑵ἄ䡤炻㊯Ẍ MES ㆾ TUSˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
C! ⎗怠㑯⯦䡤ˤ劍㚱 C炻⇯⁛復 Se 䘬㚨Ỷ㚱㓰ỵ⃫䳬ˤ劍 pq 㗗
MES炻⇯⮯ Se 䘬℞Ṿỵ⃫䳬㶭昌䁢暞ˤ!
U! ⎗怠㑯⯦䡤ˤ劍㚱 U炻恋湤⌛ἧ嗽䎮☐㗗⛐䈡㬲㧉⺷ᶳ炻⃚⬀
䲣䴙ḇ⮯⬀⍾䚳ㆸ嗽䎮☐㗗⛐ἧ䓐侭㧉⺷ᶳˤU ⛐ἧ䓐侭㧉⺷
ᶳ䃉㓰炻ᶵ傥冯⇵䳊⺽ῷ䦣ᶨ崟ἧ䓐 Uˤ!
Se! 䓐㕤庱ℍㆾ⃚⬀䘬 BSN 㙓⬀☐ˤ!
So! 姀ㅞ橼䘬➢⸽㙓⬀☐ˤ劍㊯Ẍ㗗℟㚱⮓⚆)xsjufcbdl*䘬⇵䳊
! 第7 頁!
- 24. ⺽ㆾ⼴䳊⺽)⯦䡤䁢Ⱦ"ȿ*炻ㆾἧ䓐⯦䡤 U炻⇯ᶵ⃩姙 So 冯 Se
䚠⎴ˤ!
Gmfypggtfu! ≈⇘ So ᶲ䘬曰㳣䘬ῷ䦣慷ˤ!
Mbcfm! 䦳⺷䚠⮵ῷ䦣忳䬿⺷ˤmbcfm ⽭枰㗗⛐䚖⇵㊯Ẍ䘬㬋屈 5LC 䭬
⚵ℏˤ!
"! ⎗怠⯦䡤ˤ劍㚱Ⱦ"ȿ炻⇯⮯⊭⏓ῷ䦣慷䘬ỵ⛨⮓⚆⇘ Soˤ劍
So 㗗 S26炻⇯ᶵ傥ἧ䓐⯦䡤Ⱦ"ȿˤ!
!
Gmfypggtfu 䓐㱽烉!
!!!!⇵䳊⺽⼴䳊⺽⎗ẍ㗗ẍᶳℑ䧖⼊⺷ᷳᶨ烉!
!!!!$fyqs!
!!!!|ᶨ~Sn|炻tijgu~!
!!!!℞ᷕ烉!
ᶨ! ⎗怠屈嘇ˤ劍ⷞ䫎嘇Ⱦᶨȿ炻⇯⽆ So ᷕ㷃⍣ῷ䦣慷ˤ⏎⇯炻
⮯ῷ䦣慷≈⇘ So ᷕˤ!
fyqs! 忳䬿⺷炻⍾ῤ䭬⚵㗗.51:6 ⇘,51:6 䘬㔜㔠ˤ!
Sn! ℏ⏓ῷ䦣慷䘬㙓⬀☐ˤSn ᶵ⃩姙㗗 S26ˤ!
tijgu! Sn 䘬⎗怠䦣ỵ㕡㱽ˤ⎗ẍ㗗ᶳ↿⼊⺷䘬ảỽᶨ䧖烉!
BTS!o!!䬿埻⎛䦣 o ỵ)2=>o=>43*!
MTM!o!!怷廗ⶎ䦣 o ỵ⃫)2=>o=>42*!
MTS!o!!怷廗⎛䦣 o ỵ⃫)2=>o=>43*!
SPS!o!!徜⚰⎛䦣 o ỵ)2=>o=>42*!
SSY!!!徜⚰⎛䦣 2 ỵ炻ⷞ㚱⺞Ỡ!
!
ἳ⫸烉!
MES!!S9炻S1^! ! ! ! 烊S1^à!S9!
MESOF!!S3炻S6炻$:71^"!! 烊 ) 㚱 㡅 ẞ ⛘ *! S6,:71^à! S3 烊
S6,:71àS6!
TUS!!S6炻$S8^炻$..9! ! 烊S6àS8^炻S8.9àS8!
!
3/ MES TUS烉䓐㕤╖ᶨ ibmuxpse ⷞ䫎嘇ỵ⃫䳬)Tjhofe!Czuf*㗪ˤ!
庱ℍ㙓⬀☐炻䓐㕤ⷞ䫎嘇䘬 9 ỵ⃫ỵ⃫䳬ˣⷞ䫎嘇䃉䫎嘇䘬 27 ỵ⃫
ibmuxpseˤ!
⃚⬀㙓⬀☐炻䓐㕤 27 ỵ⃫ ibmuxpseˤ!
ⷞ䫎嘇庱ℍ㗗㊯ⷞ䫎嘇⺞Ỡ军 43 ỵ⃫ˤ䃉䫎嘇 ibmuxpse 庱ℍ㗗㊯䓙暞⺞Ỡ
⇘ 43 ỵ⃫ˤ!
忁ṃ㊯Ẍ㚱 5 䧖⎗傥䘬⼊⺷烉暞ῷ䦣ˣ⇵䳊⺽ῷ䦣ˣ䦳⺷䚠⮵ῷ䦣⼴䳊⺽
ῷ䦣ˤẍ⎴㧋䘬枮⸷炻5 䧖⼊⺷䘬⎍㱽䁢烉!
pq|dpoe~uzqf!!Se炻So^!
pq|dpoe~uzqf!!Se炻So炻pggtfu^|"~!
pq|dpoe~uzqf!!Se炻mbcfm!
pq|dpoe~uzqf!!Se炻So^炻pggtfu!
!
℞ᷕ烉!
! 第8 頁!
- 25. pq! 㑵ἄ䡤炻㊯Ẍ MES ㆾ TUSˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
uzqf! ! ⽭枰㗗ẍᶳ↿䘬℞ᷕᷳᶨ烉!
TI! ! ⮵ⷞ䫎嘇 ibmuxpse)⮵ MES*!
I!! ⮵䃉䫎嘇 ibmuxpse!
TC! ! ⮵ⷞ䫎嘇ỵ⃫䳬)⮵ MES*!
2bcfm! 䦳⺷䚠⮵ῷ䦣忳䬿⺷ˤmbcfm ⽭枰㗗⛐䚖⇵㊯Ẍ䘬.366 军,366 ỵ⃫
䳬䭬⚵ℏˤ!
pggtfu!≈⛐ So ᶲ䘬ῷ䦣慷ˤ!
Se! ! 䓐㕤庱ℍㆾ⃚⬀䘬 BSN 㙓⬀☐ˤ!
So! 姀ㅞ橼䘬➢⛨㙓⬀☐ˤ劍㊯Ẍ㗗ⷞ㚱⮓⚆)xsjufcbdl*䘬⇵䳊⺽ㆾ
⼴䳊⺽)⯦䡤䁢Ⱦ"ȿ*炻⇯ᶵ⃩姙 So 冯 Se 䚠⎴ˤ!
ἳ⫸烉!
MESI!!S2炻S1炻$31^! 烊S1,31^àS2炻庱ℍ 27 ỵ ibmuxpse炻䓙暞
⺞Ỡ⇘ 43 ỵ⃫ˤ!
TUSI!!S3炻S1炻S2^"! 烊S1,S2^àS3炻⃚⬀㚨Ỷ䘬㚱㓰 ibmuxpse
⇘ S1,Sm ỵ⛨攳⥳䘬ℑᾳỵ⃫䳬炻ỵ⛨⮓⚆
⇘ S1ˤ!
!
4/ MES TUSȹ䓐㕤暁 xpse 㗪ˤ!
庱ℍℑᾳ䚠惘䘬㙓⬀☐炻75 ỵ⃫暁 xpseˤ!
⃚⬀ℑᾳ䚠惘䘬㙓⬀☐炻75 ỵ暁⃫ xpseˤ!
忁ṃ㊯Ẍ㚱 5 䧖⎗傥䘬⼊⺷烉暞ῷ䦣ˣ⇵䳊⺽ῷ䦣ˣ䦳⺷䚠⮵ῷ䦣⼴䳊⺽
ῷ䦣ˤẍ⎴㧋䘬枮⸷炻5 䧖⼊⺷䘬⎍㱽䁢烉!
pq|dpoe~E!!Se炻So^!
pq|dpoe~E!!Se炻So炻pggtfu^|"~!
pq|dpoe~E!!Se炻mbcfm!
pq|dpoe~E!!Se炻So^炻pggtfu!
!
℞ᷕ烉!
pq! 㑵ἄ䡤炻㊯Ẍ MES ㆾ TUSˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
Se! 庱ℍㆾ⃚⬀䘬㙓⬀☐ᷕ䘬ᶨᾳ炻⎎ᶨᾳ㗗 S)e,2*ˤSe ⽭枰㗗„㔠
㙓⬀☐炻ᶼᶵ㗗 S25ˤ!
So! 昌朆㊯Ẍ䁢暞ῷ䦣炻ㆾᶵⷞ㚱⮓⚆䘬⇵䳊⺽炻⏎⇯ So ᶵ⃩姙冯 Se
S)e,2*䚠⎴ˤ!
Pggtfu! ≈⛐ So ᶲ䘬ῷ䦣慷ˤ!
Mbcfm! 䦳⺷䚠⮵ῷ䦣忳䬿⺷ˤmbcfm ⽭枰㗗⛐䚖⇵㊯Ẍ䘬²363 ỵ⃫䳬䭬⚵
ℏˤ!
"! ⎗怠⯦䡤ˤ劍㚱Ⱦ"ȿ炻⇯⮯⊭⏓ῷ䦣慷䘬㚨⼴䘬ỵ⛨⮓⚆⇘ Soˤ!
!
ἳ⫸烉!
MESE!!S7炻S22^!
TUSE!!S1炻S:炻.S3^"!
! 第9 頁!
- 26. !
5/ MEN TUN!
庱ℍ⣂ᾳ㙓⬀☐)MpbE! Nvmujqmf! sfhjtufst*⃚⬀⣂ᾳ㙓⬀☐)TUpsf!
Nvmujqmf!sfhjtufst*ˤ⎗ẍ⁛復 S1S26 䘬ảỽ䳬⎰ˤ!
!
⎍㱽烉!
pq|dpoe~npef!!So|"~炻sfhmjtu|_~!
!
℞ᷕ烉!
pq! 㑵ἄ䡤炻㊯Ẍ MEN ㆾ TUNˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
npef! 㗗ᶳ↿ね㱩ᷳᶨ烉!
JB! 㭷㫉⁛復⼴ỵ⛨≈ 2!
JC! 㭷㫉⁛復⇵ỵ⛨≈ 2!
EB! 㭷㫉⁛復⼴ỵ⛨㷃 2!
EC! 㭷㫉⁛復⇵ỵ⛨㷃 2!
GE! 㺧怆㷃➮䔲!
FE! 䨢怆㷃➮䔲!
GB! 㺧怆⡆➮䔲!
FB! 䨢怆⡆➮䔲!
So! ➢⸽㙓⬀☐炻墅㚱⁛復屯㕁䘬⇅⥳ỵ⛨ˤSo ᶵ⃩姙㗗 S26ˤ!
"! ⎗怠⯦䡤ˤ劍㚱Ⱦ"ȿ炻⇯㚨⼴䘬ỵ⛨⮓⚆⇘ Soˤ!
Sfhmjtu! 庱ℍㆾ⃚⬀䘬㙓⬀☐↿堐炻⊭⏓⛐㊔⻏ᷕˤ⬫ḇ⎗ẍ⊭⏓㙓⬀☐䘬
䭬⚵ˤ劍⊭⏓⣂㕤 2 ᾳ㙓⬀☐ㆾ⊭⏓㙓⬀☐䭬⚵炻⇯⽭枰䓐徿嘇↮
攳ˤ!
_! ⎗怠⯦䡤炻ᶵ⃩姙⛐ἧ䓐侭㧉⺷ㆾ䲣䴙㧉⺷ᶳἧ䓐ˤ⬫㚱ℑᾳ䚖䘬烉!
2/!劍 pq 㗗 MEN ᶼ sfhmjtu ᷕ⊭⏓ QD)S26*炻恋湤昌Ḯ㬋ⷠ䘬⣂㙓
⬀☐⁛復⢾炻⮯ TQTS ḇ㊟居⇘ DQTS ᷕˤ忁䓐㕤⽆ἳ⢾嗽䎮彼⚆炻
⛐ἳ⢾㧉⺷ᶳἧ䓐ˤ!
3/!屯㕁⁛ℍㆾ⁛↢䘬㗗ἧ䓐侭㧉⺷䘬㙓⬀☐炻侴ᶵ㗗䚖⇵㧉⺷䘬
㙓⬀☐ˤ!
!
ⷞ㚱⮓⚆䘬庱ℍㆾ⃚⬀➢⸽㙓⬀☐烉!
⤪㝄 So ⊭⏓⛐㙓⬀☐↿堐ᷕ炻ᶼ䓐⯦䡤Ⱦ炰ȿ㊯㖶天⮓⚆)xsjufcbdl*炻恋
湤烉!
..!劍 pq 㗗 TUN炻ᶼ So 㗗㙓⬀☐↿堐ᷕ㔠⫿㚨⮷䘬㙓⬀☐炻⇯⮯ So 䘬⇅
ῤᾅ⬀ˤ!
..!So 䘬庱ℍ⃚⬀ῤ⇯ᶵ⎗枸㷔ˤ!
!
ἳ⫸烉!
MENJB!!S9炻|S1炻S3炻S8~!
TUNEC!!S2"炻|S4 ᶨ S7炻S22炻S23~!
!
6/ TXQ!
! 第: 頁!
- 27. ⛐㙓⬀☐姀ㅞ橼ᷳ攻忚埴屯㕁Ṍ㎃ˤ!
⎗ἧ䓐 TXQ)TXbQ*Ἦ⮎䎦ᾉ嘇慷)tfnbqipsf*ˤ!
⎍㱽烉!
TXQ|dpoe~|C~!!Se炻Sn炻So^!
!!!℞ᷕ烉!
dpoe!⎗怠㑯䘬㡅ẞ䡤ˤ!
C! ⎗怠㑯⯦䡤ˤ劍㚱 C炻⇯Ṍ㎃ỵ⃫䳬ˤ⏎⇯Ṍ㎃ 43 ỵ xpseˤ!
Se! 屯㕁⽆姀ㅞ橼庱ℍ⇘ Seˤ!
Sn!!Sn 䘬ℏ⭡⃚⬀⇘姀ㅞ橼ˤSn ⎗ẍ冯 Se 䚠⎴ˤ⛐忁䧖ね㱩ᶳ炻㙓⬀☐䘬
ℏ⭡冯姀ㅞ橼䘬ℏ⭡忚埴Ṍ㎃ˤ!
So!!!So 䘬ℏ⭡㊯⭂天忚埴屯㕁Ṍ㎃䘬姀ㅞ橼䘬ỵ⛨ˤSo ⽭枰冯 Se Sn ᶵ
⎴ˤ!
!
2.3.2 資料處理指令
2/ 曰㳣䘬䫔Ḵ忳䬿⃫!
⣏⣂㔠 BSN 忂䓐屯㕁嗽䎮㊯Ẍ㚱ᶨᾳ曰㳣䘬䫔Ḵ忳䬿⃫ˤ⛐㭷ȹᾳ㊯Ẍ䘬⎍
㱽㍷徘ᷕẍȾPqfsboe3ȿ堐䣢ˤ!
Pqfsboe3 㚱⤪ᶳℑ䧖⎗傥䘬⼊⺷烉!
$jnnfe`9s!
Sn!|炻tijgu~!
!
℞ᷕ烉!
jnnfe`9s! 䩳⌛ῤ䁢㔠⫿ⷠ㔠䘬忳䬿⺷ˤ!
⎰㱽ⷠ㔠烉!
1yGGˣ1y215ˣ1yGG1ˣ1yGG111ˣ1yGG111111ˣ1yG111111Gˤ!
朆㱽ⷠ㔠烉!
1y212 ˣ 1y213 ˣ 1yGGm ˣ 1yGG15 ˣ 1YGG114 ˣ 1yGGGGGGGG ˣ
1yG111112Gˤ!
Sn! ⃚⬀䫔Ḵ忳䬿⃫屯㕁䘬 BSN 㙓⬀☐ˤ!
Tijgu! Sn 䘬⎗怠㑯䦣ỵ㕡㱽ˤ⎗ẍ㗗ẍᶳ㕡㱽䘬ảỽᶨ䧖烉!
BTS!o! 䬿埻⎛䦣 o ỵ)2=>o=>43*!
MTM!o! 怷廗ⶎ䦣 o ỵ⃫)2=>o=>42*!
MTS!o! 怷廗⎛䦣 o ỵ⃫)2=>o=>43*!
SPS!o! 徜⚰⎛䦣 o ỵ)2=>o=>42*!
SSY! ⷞ㚱⺞Ỡ䘬徜⚰⎛䦣 2 ỵ!
uzqf!St! ℞ᷕ烉!
uzqd! BTSˣMTMˣMTS SPS ᷕ䘬ᶨ䧖ˤ!
St! ㍸ὃ䦣ỵ慷䘬 BSN 㙓⬀☐炻ἧ䓐㚨Ỷ㚱㓰
ỵ⃫䳬ˤ!
!
⛐㊯Ẍᷕ䦣ỵ⃫㑵ἄ䘬䳸㝄䓐 pqfsboe3炻Ữ Sn 㛔幓ᶵ嬲ˤ!
!
3/ BEEˣTVCˣSTCˣBEDˣTCD STD!
≈ˣ㷃ˣ⍵㷃炻≈ᶲ!ⷞㆾᶵⷞ忚ỵˤ!
! 第21 頁!
- 28. ⎍㱽烉!
pq!|dpoe~|T~!!Se炻So炻Pqfsboe3!
℞ᷕ烉!
pq! 㑵ἄ䡤ˤBEEˣTVCˣSTCˣBEDˣTCD STD ℞ᷕȹᾳˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
T! ⎗怠㑯䘬⯦䡤ˤ劍㊯⭂ T炻⇯㟡㒂㑵ἄ䳸㝄㚜㕘㡅ẞ䡤㧁娴)Oˣ[ˣ
D W*ˤ!
Se! BSN 䳸㝄㙓⬀☐ˤ!
So! ᾅ⬀䫔ᶨ忳䬿⃫䘬 BSN 㙓⬀☐ˤ!
Pqfsboe3! 䫔Ḵ忳䬿⃫ˤ!
!
䓐㱽烉!
炽BEE)BEE*㊯Ẍ䓐㕤⮯ So Pqfsboe3 䘬ῤ䚠≈ˤ!
炽TVC)TVCusbdu*㊯Ẍ䓐㕤⽆ So 䘬ῤᷕ㷃⍣ Pqfsboe3 䘬ῤˤ!
炽STC)Sfwfstf!TvCusbdu*㊯Ẍ䓐㕤⽆ Pqfsboe3 䘬ῤᷕ㷃⍣ So 䘬ῤˤ䓙㕤
Pqfsboe3 䘬⎗怠䭬⚵⮔炻ẍ忁㡅㊯Ẍ⼰㚱䓐ˤ!
炽BED)BEe!xjui!Dbssz*㊯Ẍ⮯ So Pqfsboe3 ᷕ䘬ῤ䚠≈炻᷎ⷞ㚱忚ỵ⃫
㧁娴ˤ!
炽TCD)TvCusbdu!xjui!Dbssz*㊯Ẍ⽆ So 䘬ῤᷕ㷃⍣ Pqfsboe3 䘬ῤˤ劍忚ỵ
⃫㧁娴㗗㶭昌䁢暞-⇯䳸㝄㷃 mˤ!
炽STD)Sfwfstf!Tvcusbdu!xjui!Dbssz*㊯Ẍ⽆ Pqfsboe3 䘬ῤᷕ㷃⍣ So 䘬ῤˤ
劍忚ỵ⃫㧁娴㗗㶭昌䁢暞炻⇯䳸㝄㷃 2ˤ!
炽BEDˣTCD STD 䓐㕤⣂ᾳ⫿䘬䬿埻忳䬿ˤ!
炽劍㊯⭂ T炻恋湤忁ṃ㊯Ẍ㟡㒂䳸㝄㚜㕘㧁娴 Oˣ[ˣD Wˤ!
!
ἳ⫸烉!
BEE!!S3炻S2炻S4!
TVCT!!S9炻S7炻$351! 烊㟡㒂䳸㝄姕伖㧁娴!
STC!!S5炻S5炻$2391! 烊2391.S5!
BEDIJ!!S22炻S1炻S4! 烊⎒㚱㧁娴 D 伖ỵ⃫ᶼ㧁娴 [ 㶭昌䁢暞
㗪ㇵ➟埴!
STDMFT!!S1炻S6炻S1炻MTM!S5! 烊㚱㡅ẞ➟埴炻姕伖㧁娴!
!
4/ BOEˣPSSˣFPS CJD!
怷廗忳䬿..Ⱦ冯ȿˣȾㆾȿˣȾ䔘ㆾȿȾỵ⃫㶭昌䁢暞ȿˤ!
⎍㱽烉!
pq|dpoe~|T~!!Se炻So炻Pqfsboe3!
!
℞ᷕ!
pq! 㑵ἄ䡤ˤBOEˣPSSˣFPS CJD ℞ᷕȹᾳˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
T! ⎗怠㑯䘬⯦䡤ˤ劍㊯⭂ T炻⇯㟡㒂㑵ἄ䳸㝄㚜㕘㡅ẞ䡤㧁娴)Oˣ[ˣ
D W*ˤ!
Se! BSN 䳸㝄㙓⬀☐ˤ!
! 第22 頁!
- 29. So! ᾅ⬀䫔ᶨ忳䬿⃫䘬 BSN 㙓⬀☐ˤ!
Pqfsboe3! 䫔Ḵ忳䬿⃫ˤ!
!
BOEˣFPS PSS ㊯Ẍ↮⇍⬴ㆸ怷廗忳䬿⫸Ⱦ冯)BOE*ȿˣȾ䔘ㆾ)Fydmvtjwf!
PS*ȿȾㆾ)PS*ȿ㑵ἄ炻忳䬿⃫㗗 So Pqfsboe3 䘬ῤˤ!
CJD)CJu!Dmfbs*㚫⮯ So 冯䫔ᶱ⍫㔠䘬墄㔠ἄ BOE 忳䬿炻䃞⼴⮯䳸㝄⬀ℍ Seˤ
℞㓰㝄⯙⁷㗗⮯ Se ᷕ冯䚠⮵ㅱ䫔ᶱ⍫㔠墉䁢 2 䘬ỵ⃫㶭昌䁢暞ˤ!
劍㊯⭂ T炻⇯忁ṃ㊯Ẍ⮯烉荛㟡㒂䳸㝄㚜㕘㧁娴 O [烊荜⛐妰䬿 Pqfsboe3
㗪㚜㕘㧁娴 D烊荝ᶵ⼙枧㧁娴 Wˤ!
ἳ⫸烉!
BOE!!S:炻S3炻$1yGG11!
PSSFR!!S3炻S1炻S6!
FPST!!S1炻S1炻S4炻SPS!S7!
CJDOFT!!S9炻S21炻S1炻SSY!
!
5/ NPW NWO!
⁛復朆⁛復ˤ!
⎍㱽烉!
pq|dpoe~|T~!!Se炻Pqfsboe3!
℞ᷕ烉!
pq! 㑵ἄ䡤ˤNPW NWO ᷕȹᾳˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
T! ⎗怠㑯䘬⯦䡤ˤ劍㊯⭂ T炻⇯㟡㒂㑵ἄ䳸㝄㚜㕘㡅ẞ䡤㧁娴)Oˣ[ˣ
D W*ˤ!
Se! BSN 䳸㝄㙓⬀☐ˤ!
Pqfsboe3! 䫔Ḵ忳䬿⃫ˤ!
!
NPW)NPWf*㊯Ẍ⮯ Pqfsboe3 䘬ῤ㊟居⇘ SeˤNWO)NpWf!Opu*㊯Ẍ⮵ Pqfsboe3
䘬ῤ忚埴㊱ỵ⃫怷廗朆㑵ἄ炻䃞⼴⮯䳸㝄復⇘ Seˤ!
!!
ἳ⫸烉!
!!NPW!!S3炻S2!
!!NPW!!S2炻$1y234567!
!!NPWT!!S1炻S1炻BTS!S4!
!
6/ DNQ DNO!
㭼庫⍵嘇㭼庫ˤ!
⎍㱽烉!
pq|dpoe~!!So炻Pqfsboe3!
!
℞ᷕ烉!
pq! 㑵ἄ䡤ˤDNQ DNO ᷕȹᾳˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
So! ᾅ⬀䫔ᶨ忳䬿⃫䘬 BSN 㙓⬀☐ˤ!
! 第23 頁!
- 30. Pqfsboe3! 䫔Ḵ忳䬿⃫ˤ!
!
㊯Ẍ⮯㙓⬀☐䘬ῤ冯 Pqfsboe3 忚埴㭼庫ˤ⬫Ᾱ㟡㒂䳸㝄㚜㕘㡅ẞ䡤㧁娴炻
Ữ䳸㝄ᶵ㓦⇘ảỽ㙓⬀☐ᷕˤ!
DNQ)DpNQbsf*㊯Ẍ⽆ So 䘬ῤᷕ㷃⍣ Pqfsboe3 䘬ῤˤ昌⮯䳸㝄᷇㡬⢾炻DNQ
㊯Ẍ⎴ TVCT ㊯Ẍᶨ㧋ˤ!
DNO)DpNqbsf!Ofhbujwf*㊯Ẍ⮯ Pqfsboe3 䘬ῤ≈⇘ So 䘬ῤᷕˤ昌⮯䳸㝄᷇
㡬⢾炻DNO ㊯Ẍ䘬䓐㱽⎴ BEET ᶨ㧋ˤ!
DNQ DNO ㊯Ẍ㟡㒂䳸㝄㚜㕘㧁娴 Oˣ[ˣD Wˤ!
!
ἳ⫸烉!
DNQ!!S3炻S4!
DNO!!S1炻$234!
DNQHU!!S24炻S8炻MTM!$3!
!
7/ UTU UFR!
㷔娎㷔娎䚠䫱ˤ!
⎍㱽烉!
pq|dpoe~!!So炻Pqfsboe3!
!
℞ᷕ烉!
pq! 㑵ἄ䡤ˤUTU UFR ᷕȹᾳˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
So! ᾅ⬀䫔ᶨ忳䬿⃫䘬 BSN 㙓⬀☐ˤ!
Pqfsboe3! 䫔Ḵ忳䬿⃫ˤ!
!
忁ṃ㊯Ẍὅ㒂 Pqfsboe3 㷔娎㙓⬀☐ᷕ䘬ῤˤ⬫Ᾱ㟡㒂䳸㝄㚜㕘㡅ẞ䡤㧁娴炻
Ữ䳸㝄ᶵ㓦⇘ảỽ㙓⬀☐ᷕˤ!
UTU)UfTU*㊯Ẍ⮵ So 䘬ῤ Pqfsboe3 䘬ῤ忚埴ȾBOEȿ㑵ἄˤ昌䳸㝄᷇㡬
⢾炻≇傥⎴ BOET ㊯Ẍᶨ㧋ˤ!
UFR)Uftu!FRvjwbmfodf*㊯Ẍ⮵ So 䘬ῤ Pqfsboe3 䘬ῤ忚埴ȾFPSȿ㑵ἄˤ
昌䳸㝄᷇㡬⢾炻℞≇傥⎴ FPST ㊯Ẍᶨ㧋ˤ!
UTU UFR ㊯Ẍ㟡㒂䳸㝄㚜㕘㧁娴 Oˣ[ˣD Wˤ!
!
ἳ⫸烉!
UTU!!S1炻$1y4G9!
UFRFR!!S21炻S:!
UTUOF!!Sm炻S6炻BTS!Sm!
!
8/ DM[!
⇵⮶暞妰㔠ˤ!
⎍㱽烉!
DM[|dpoe~!!Se炻Sn!
!
! 第24 頁!
- 31. ℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
Se! BSN 䳸㝄㙓⬀☐炻Se ᶵ⃩姙㗗 S26ˤ!
Sn! 忳䬿⃫㙓⬀☐ˤ!
!
DM[)Dpvou!Mfbejoh![fspt*㊯Ẍ⮵ Sn ᷕ㔠ῤ䘬⇵⮶暞)2fbejoh!{fspt*䘬ᾳ
㔠忚埴妰㔠炻䳸㝄㓦⇘ Se ᷕˤ劍⍇⥳㙓⬀☐ℐ䁢 1炻⇯䳸㝄䁢 43ˤ劍 cju42^
䁢 m炻⇯䳸㝄䁢 1ˤ!
忁㡅㊯Ẍᶵ⼙枧㡅ẞ䡤㧁娴ˤ!
!
ἳ⫸烉!
DM[!!S5炻S:!
DM[OF!!S3炻S4!
!
9/ NVM NMB!
Ḁ㱽Ḁ≈ 43 ỵØ43 ỵ炻䳸㝄䁢Ỷ 43 ỵ⃫ˤ!
⎍㱽烉!
NVM|dpoe~|T~!!Se炻Sn炻St!
NMB|dpoe~|T~!!Se炻Sn炻St炻So!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
T! ⎗怠㑯⯦䡤ˤ劍㊯⭂ T炻⇯㟡㒂㑵ἄ䳸㝄㚜㕘㡅ẞ䡤㧁娴)Oˣ
[ˣD W*ˤ!
Se! 䳸㝄㙓⬀☐ˤ!
SnˣStˣSo! 忳䬿⃫㙓⬀☐ˤ!
!
S26 ᶵ傥䓐 SeˣSnˣSt ㆾ SoˤSe ᶵ傥冯 Sn 䚠⎴ˤ!
NVM)NVMujqmz*㊯Ẍ⮯ Sn St ᷕ䘬ῤ䚠Ḁ炻᷎⮯㚨Ỷ㚱㓰䘬 43 ỵ⃫䳸㝄㓦
⇘ Se ᷕˤ!
NMB)NvMujqmz!Bddvnvmbuf*㊯Ẍ⮯ Sn St ᷕ䘬ῤ䚠Ḁ炻ℵ≈ᶲ So 䘬ῤ炻᷎
⮯㚨Ỷ㚱㓰䘬 43 ỵ⃫䳸㝄㓦⇘ Se ᷕˤ!
!劍㊯⭂ T炻⇯忁ṃ㊯Ẍ⮯烉荛㟡㒂䳸㝄㚜㕘㧁娴 O [烊荜ᶵ⼙枧㧁娴 W烊
荝⛐ BSNw5!
!!⍲ẍ⇵䇰㛔ᷕ㧁娴 D ᶵ⎗月烊荞⛐ BSNw6 ⍲ẍ⼴䇰㛔ᷕᶵ⼙枧㧁娴 Dˤ!
!
!!ἳ⫸烉!
!!NVM!!S21炻S3炻S2!
!!NMB!!S21炻S3炻Sm炻S6!
!!NVMT!!S21炻S3炻S2!
!!NMBWDT!!S9炻S7炻S4炻S9!
!
:/ VNVMMˣVNMBMˣTNVMM TNMBM!
䃉䫎嘇ⷞ䫎嘇攟㔜㔠Ḁ㱽Ḁ≈)43 ỵØ43 ỵ炻≈㱽ㆾ䳸㝄䁢 75 ỵ⃫*ˤ!
! 第25 頁!
- 32. ⎍㱽烉!
pq|dpoe~|T~!!SeMp炻SeIj炻Sn炻St!
!
℞ᷕ烉!
pq! 㑵ἄ䡤ˤVNVMMˣVNMBMˣTNVMM TNMBM ᷕȹᾳˤ!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
T! ⎗怠㑯䘬⯦䡤ˤ劍㊯⭂ T炻⇯㟡㒂㑵ἄ䳸㝄㚜㕘㡅ẞ䡤㧁
娴)Oˣ[ˣD W*ˤ!
SeMp炻SeIj! BSN 䳸㝄㙓⬀☐ˤ⮵㕤 VNMBM TNMBM炻忁ℑᾳ㙓⬀☐䓐㕤
ᾅ⬀≈㱽ῤˤ!
Sn炻St! 忳䬿⃫㙓⬀☐ˤ!
!
S26 ᶵ傥䓐㕤 SeMpˣSeIjˣSn ㆾ StˤSeMpˣSeIj Sn ⽭枰㗗ᶵ⎴䘬㙓⬀☐ˤ!
VNVMM)Votjhofe!Mpoh!NVMujqmz*㊯Ẍ⮯ Sn St ᷕ䘬ῤ妋慳䁢䃉䫎嘇㔜㔠ˤ
娚㊯Ẍ⮯忁ℑᾳ㔜㔠䚠Ḁ炻᷎⮯䳸㝄䘬㚨Ỷ㚱㓰 43 ỵ⃫㓦⛐ SeMp ᷕ炻㚨檀㚱㓰
43 ỵ⃫㓦⛐ SeIj ᷕˤ!
VNMBM)Votjhofe!Mpoh!NvMujqmz!Bddvnvmbuf*㊯Ẍ⮯ Sn St ᷕ䘬ῤ妋慳䁢
䃉䫎嘇㔜㔠ˤ娚㊯Ẍ⮯忁ℑᾳ㔜㔠䚠Ḁ炻᷎⮯ 75 ỵ⃫䳸㝄≈⇘ SeIj SeMp ᷕ
䘬 75 ỵ⃫䃉䫎嘇㔜㔠ᶲˤ!
TNVMM)Tjhofe!Mpoh!NVMujqmz*㊯Ẍ⮯ Sn St ᷕ䘬ῤ妋慳䁢ⷞ䫎嘇䘬墄㔠
㔜㔠ˤ娚㊯Ẍ⮯忁ℑᾳ㔜㔠䚠Ḁ炻᷎⮯䳸㝄䘬㚨Ỷ㚱㓰 43 ỵ⃫㓦⛐ SeMp ᷕ炻⮯
㚨檀㚱㓰 43 ⃫ỵ㓦⛐ SeIj ᷕˤ!
TNMBM)Tjhofe!Mpoh!NvMujqmz!Bddvnvmbuf*㊯Ẍ⮯ Sn St ᷕ䘬ῤ妋慳䁢ⷞ
䫎嘇䘬墄㔠㔜㔠ˤ娚㊯Ẍ⮯忁ℑᾳ㔜㔠䚠Ḁ炻᷎⮯ 75 ỵ⃫䳸㝄≈⇘ SeIj SeMp
ᷕ䘬 75 ỵ⃫ⷞ䫎嘇墄㔠㔜㔠ᶲˤ!
劍㊯⭂ T炻⇯忁ṃ㊯Ẍ⮯烉荛㟡㒂䳸㝄㚜㕘㧁娴 O [烊荜⛐ BSNw5 ⍲ẍ⇵
䇰㛔ᷕ㧁娴 D ᶵ⎗月烊荝⛐ BSNw6 ⍲ẍ⼴䇰㛔ᷕᶵ⼙枧㧁娴 D ㆾ Wˤ!
!
ἳ⫸烉!
VNVMM!!S1炻S5炻S6炻S7!
VNMBMT!!S5炻S6炻S4炻S9!
TNMBMMFT!!S9炻S:炻S8炻S7!
TNVMMOF!!S1炻Sm炻S:炻S1!
!
21/ TNVMyz!
ⷞ㚱䫎嘇Ḁ㱽)27 ỵØ27 ỵ炻䳸㝄䁢 43 ỵ⃫*ˤ!
⎍㱽烉!
TNVM烋y烍烋z烍|dpoe~!!Se炻Sn炻St!
℞ᷕ烉!
烋y烍! C ㆾ UˤC シ␛叿ἧ䓐 Sn 䘬Ỷ昶)cju26;1^*炻U シ␛叿ἧ䓐 Sn
䘬檀昶)cju42;27^*ˤ!
烋z烍! C ㆾ UˤC シ␛叿ἧ䓐 St 䘬Ỷ昶)cju26;1^*炻U シ␛叿ἧ䓐 St
䘬檀昶)cju42;27^*ˤ!
Se! 䳸㝄㙓⬀☐ˤ!
! 第26 頁!
- 33. Sn炻St! Ḁ㔠㙓⬀☐ˤ!
!
S26 ᶵ傥䓐㕤 SeˣSn StˤSeˣSn St ⎗䓐䚠⎴䘬㙓⬀☐ˤ!
TNVMyz)Tjhofe!NVMujqmz*㊯Ẍ䓐ẍ⮯ Sn St ᷕ⎬怠㑯ᶨ⋲䘬 27 ỵ⃫ⷞ㚱
䫎嘇㔜㔠䚠Ḁ炻⮯ 43 ỵ⃫䳸㝄㓦⛐ Se ᷕˤ!
忁㡅㊯Ẍᶵ⼙枧ảỽ㡅ẞ䡤㧁娴ˤ!
!
ἳ⫸烉!
TNVMUCFR!!S9炻S8炻S:!
!
22/ TNMByz!
ⷞ䫎嘇Ḁ≈)27 ỵ⃫Ø27 ỵ炻≈㱽䁢 43 ỵ⃫*ˤ!
⎍㱽烉!
TNMB烋y烍烋z烍|dpoe~!!Se炻Sn炻St炻So!
℞ᷕ烉!
烋y烍! C ㆾ UˤC シ␛叿ἧ䓐 Sn 䘬Ỷ昶)cju26;1^*炻U シ␛叿ἧ䓐 Sn
䘬檀昶)cju42;27^*ˤ!
烋z烍! C ㆾ UˤC シ␛叿ἧ䓐 St 䘬Ỷ昶)cju26;1^*炻U シ␛叿ἧ䓐 St
䘬檀昶)cju42;27^*ˤ!
Se! 䳸㝄㙓⬀☐ˤ!
Sn炻St! Ḁ㔠㙓⬀☐ˤ!
So! ≈㔠㙓⬀☐ˤ!
!
S26 ᶵ傥䓐 SeˣSnˣSt ㆾ SoˤSeˣSnˣSt So ⎗䓐䚠⎴䘬㙓⬀☐ˤ!
TNMByz)Tjhofe!NvMujqmz!Bddvnvmbuf*㊯Ẍ䓐ẍ⮯ Sn St ᷕ⎬怠㑯ᶨ⋲䘬
27 ỵ⃫ⷞ䫎嘇㔜㔠䚠Ḁ炻⮯ 43 ỵ⃫䳸㝄≈ᶲ So ᷕ䘬 43 ỵῤ炻㚨䳪䳸㝄㓦⛐ Se
ᷕˤ!
忁㡅㊯Ẍᶵ㚫㶭昌㧁娴 Rˤ天㶭昌㧁娴 R炻枰ἧ䓐 NTS ㊯Ẍˤʉ!
!
ἳ⫸烉!
TNMBUU!!S9炻S22炻S1炻S9!
TNMBCCOF!!S1炻S3炻Sm炻S21!
!
23/ NVMXz!
ⷞ䫎嘇Ḁ)43 ỵ⃫Ø43 ỵ炻䳸㝄䁢檀 43 ỵ*ˤ!
⎍㱽烉!
TNVMX烋z烍|dpoe~!!Se炻Sn炻St!
!
℞ᷕ烉!
烋z烍! C ㆾ UˤC シ␛叿ἧ䓐 St 䘬Ỷ昶)cju26;1^*炻U シ␛叿ἧ䓐 St
䘬檀昶)cju42;27^*ˤ!
Se! 䳸㝄㙓⬀☐ˤ!
Sn炻St! Ḁ㔠㙓⬀☐ˤ!
!
! 第27 頁!
- 34. S26 ᶵ傥䓐 SeˣSnˣㆾ St 䘬ảỽᶨᾳˤảỽ SeˣSn ㆾ St 悥⎗䓐䚠⎴䘬
㙓⬀☐ˤ!
TNVMXz)Tjhofe!NVMujqmz*㊯Ẍ䓐ẍ⮯ St ᷕ怠㑯ᶨ⋲䘬ⷞ㚱䫎嘇㔜㔠冯 Sn
䘬ⷞ㚱䫎嘇㔜㔠䚠Ḁ炻⮯ 59 ỵ⃫䳸㝄䘬檀 43 ỵ⃫㓦⛐ Se ᷕˤ!
!
ἳ⫸烉!
TNVMXC!!S3炻S5炻S8!
TNVMXUWT!!S1炻S1炻S:!
!
24/!TNMBXz!
ⷞ㚱䫎嘇Ḁ≈)43 ỵ⃫Ø27 ỵ炻䓐檀 43 ỵ⃫忚埴≈㱽*ˤ!
⎍㱽烉!
TNMBX烋z烍|dpoe~!!Se炻Sn炻St炻So!
!
℞ᷕ烉!
烋z烍! C ㆾ UˤC シ␛叿ἧ䓐 St 䘬Ỷ昶)cju26;1^*炻U シ␛叿ἧ䓐 St
䘬檀昶)cju42;27^*ˤ!
Se! 䳸㝄㙓⬀☐ˤ!
Sn炻St! Ḁ㔠㙓⬀☐ˤ!
So! ≈㔠㙓⬀☐ˤ!
!
S26 ᶵ傥䓐 SeˣSnˣSt ㆾ So 䘬ảỽᶨᾳˤảỽ SeˣSnˣSt ㆾ So ⎗䓐䚠
⎴䘬㙓⬀☐ˤ!
TNMBXz)Tjhofe!NvMujqmz!Bddvnvmbuf*㊯Ẍ䓐ẍ⮯ St ᷕ怠㑯ᶨ⋲䘬ⷞ㚱䫎
嘇㔜㔠冯 Sn ᷕ䘬ⷞ㚱䫎嘇㔜㔠䚠Ḁ炻ℵ⮯ 43 ỵ䳸㝄≈⇘ So ᷕ䘬 43 ỵῤᶲ炻㚨
䳪䳸㝄㓦⛐ Se ᷕˤ!
忁㡅㊯Ẍᶵ⼙枧㧁娴 Oˣ[ˣD ㆾ Wˤ!
劍≈㱽↢䎦㹊↢炻⇯伖ỵ⃫㧁娴 Rˤἧ䓐 NST ㊯ẌἮ嬨㧁娴 R 䘬䉨ンˤ!
忁㡅㊯Ẍᶵ㚫㶭昌 R 㧁娴ˤ天㶭昌 R 㧁娴炻枰ἧ䓐 NTS ㊯Ẍˤ!
!
ἳ⫸烉!
TNMBXC!!S3炻S5炻S8炻Sm!
TNMBXUWT!!S1炻S1炻S:炻S3!
!
25/ TNMBMyz!
ⷞ㚱䫎嘇Ḁ≈)27 ỵ⃫Ø27 ỵ炻≈㱽䁢 75 ỵ*ˤ!
⎍㱽烉!
TNMBM烋y烍烋z烍|dpoe~!!SeMp炻SeIj炻Sn炻St!
℞ᷕ烉!
烋y烍! C ㆾ UˤC シ␛叿ἧ䓐 Sn 䘬Ỷ昶)cju26;1^*炻U シ␛叿ἧ
䓐 Sn 䘬檀昶)cju42;27^*ˤ!
烋z烍! C ㆾ UˤC シ␛叿ἧ䓐 St 䘬Ỷ昶)cju26;1^*炻U シ␛叿ἧ
䓐 St 䘬檀昶)cju42;27^*ˤ!
SeIj炻SeMp! 䳸㝄㙓⬀☐ˤ⬫Ᾱḇᾅ⬀ bee.jo ῤˤ!
! 第28 頁!
- 35. Sn炻St! Ḁ㔠㙓⬀☐ˤ!
!
TNMBMyz)Tjhofe!NvMujqmz!Bddvnvmbuf*㊯Ẍ䓐ẍ⮯ Sn St ᷕ⎬怠㑯ᶨ⋲
䘬ⷞ㚱䫎嘇㔜㔠䚠Ḁ炻ℵ⮯ 43 ỵ䳸㝄≈⇘ SeIj SeMp ᷕ䘬 75 ỵ⛨ᶲˤ!
忁㡅㊯Ẍᶵ⼙枧ảỽ㧁娴ˤ!
忁㡅㊯Ẍᶵ㚫⺽崟ἳ⢾ˤ劍➟埴忁㡅㊯Ẍ㗪䘤䓇㹊↢炻⇯䳸㝄䑘丆)xsbqt!
spvoe*侴ᶵ䘤↢ảỽ嬎⏲ˤ!
!
ἳ⫸烉!
TNMBMUC!!S3炻S4炻S8炻S2!
TNMBMCUWT!!S1炻Sm炻S:炻S3!
!
26/ RBEEˣRTVCˣREBEE RETVC!
梥≈ˣ梥㷃ˣ梥Ḁ 3 ≈!!梥Ḁ 3 㷃ˤ!
⎍㱽!
pq|dpoe~!!Se炻Sn炻So!
!
℞ᷕ烉!
Se! 䳸㝄㙓⬀☐ˤ!
SnˣSo! 忳䬿⃫㙓⬀☐ˤ!
!!
RBEE)tbuvsbujoh!BEE*㊯Ẍ⮯ Sn So 䘬ῤ䚠≈ˤ!
RTVC)tbuvsbujoh!TVCusbdu*㊯Ẍ⽆ Sn 䘬ῤᷕ㷃⍣ So 䘬ῤˤ!
REBEE)tbuvsbujoh!Epvcmf!boe!BEE*㊯Ẍ妰䬿 TBU)Sn,TBU)So+3**ˤ梥⎗
䘤䓇⛐≈㑵ἄˣ≈㱽ᶲ炻ㆾℑ䧖ね㱩ᶳ⎴㗪䘤䓇ˤ劍梥䘤䓇⛐≈㑵ἄᶲ炻
⇯㧁娴 R 伖ỵ⃫炻Ữ㚨⼴䳸㝄㗗ᶵ梥䘬ˤ!
RETVC)tbuvsbujoh!Epvcmf!boe!TVCusbdu*㊯Ẍ妰䬿 TBU)Sn.TBU)So+3**ˤ梥
⎗䘤䓇⛐≈㑵ἄˣ≈㱽ᶲ炻ㆾℑ䧖ね㱩ᶳ⎴㗪䘤䓇ˤ劍梥䘤䓇⛐≈㑵
ἄᶲ炻⇯㧁娴 R 伖ỵ⃫炻Ữ㚨⼴䳸㝄㗗ᶵ梥䘬ˤ!
忁ṃ㊯Ẍ㈲㚱ῤ䚳 ⷞ㚱䫎嘇䘬墄㔠㔜㔠ˤ!
忁ṃ㊯Ẍᶵ⼙枧㧁娴 Oˣ[ˣD Wˤ劍↢䎦梥炻⇯伖ỵ⃫㧁娴 Rˤἧ䓐 NST
㊯ẌἮ嬨㧁娴 R 䘬䉨ンˤ!
⌛ἧ㗗梥ᶵ↢䎦炻忁ṃ㊯Ẍḇ⽆ᶵ㶭昌 R 㧁娴ˤἧ䓐 NTS ㊯Ẍ㶭昌 R 㧁娴ˤ!
!
ἳ⫸烉!
RBEE!!S1炻Sm炻S:!
RETVCMU!!S:炻S1炻Sm!
!
3.3 跳轉指令
2/ C CM!
嶛廱ⷞ㚱捰䳸嶛廱ˤ!
⎍㱽烉!
C|dpoe~!!mbcfm!
! 第29 頁!
- 36. CM|dpoe~!!mbcfm!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
2bcfm! 䦳⺷䚠⮵ῷ䦣忳䬿⺷ˤ!
!
C)Csbodi*㊯Ẍ⺽崟嗽䎮☐廱䦣⇘ 2bcfmˤ!
CM)Csbodi!xjui!Mjol*㊯Ẍ⮯ᶳᶨ㡅㊯Ẍ䘬ỵ⛨㊟居⇘ S25)捰䳸㙓⬀☐*炻
᷎廱䦣⇘ 2bcfmˤ!
㨇☐䳂䘬 C CM ㊯Ẍ旸⇞⛐䚖⇵㊯Ẍ䘬²43Nc 䭬⚵ℏˤỮ㗗炻⌛ἧ mbcfm 崭
↢Ḯ娚䭬⚵炻ḇ⎗ẍἧ䓐忁ṃ㊯Ẍˤ!
!
ἳ⫸烉!
C!!MppqB!
CMF!!oh,9!
!!
3/ CY!
嶛廱᷎⎗怠㑯⛘Ṍ㎃㊯Ẍ普ˤ!
⎍㱽烉!
CY|dpoe~!!Sn!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
Sn! ⏓㚱廱䦣ỵ⛨䘬㙓⬀☐ˤSn 䘬 cju1^ᶵ䓐Ἦἄ䁢⛘⛨䘬ᶨ悐↮ˤ劍
Sn 䘬 cju1^䁢 m炻⇯㊯Ẍ⮯ DQTS ᷕ䘬㧁娴 U 伖ỵ⃫炻ᶼ⮯䚖㧁ỵ⛨
䘬ẋ䡤妋慳䁢 Uivnc ẋ䡤ˤ劍 Sn 䘬 cju1^䁢 1炻⇯ cju2^⯙ᶵ傥䁢
mˤ!
!
➟埴 CY)Csbodi!boe!pqujpobmmz!fYdibohf*㊯Ẍ⮯⺽崟嗽䎮☐廱䦣⇘ Sn ᷕ
䘬ỵ⛨ˤ劍 Sn 䘬 cju1^䁢 2炻⇯㊯Ẍ普嬲㎃⇘ Uivncˤ!
!
ἳ⫸烉!
CY!!S8!
CYWT!!S1!
!
4/ CMY!
ⷞ㚱捰䳸嶛廱᷎⎗怠⛘Ṍ㎃㊯Ẍ普ˤ忁㡅㊯Ẍ㚱⤪ᶳ 3 䧖⼊⺷烉!
2/!ⷞ㚱捰䳸䃉㡅ẞ廱䦣⇘䦳⺷䚠⮵ῷ䦣ỵ⛨ˤ!
3/!ⷞ㚱捰䳸㚱㡅ẞ廱䦣⇘㙓⬀☐ᷕ䘬䳽⮵ỵ⛨ˤ!
⎍㱽烉!
CMY|dpoe~!!Sn!
CMY!!mbcfm!
!
℞ᷕ烉!
! 第2: 頁!
- 37. dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
Sn! ⏓㚱廱䦣ỵ⛨䘬㙓⬀☐ˤSn 䘬 cju1^ᶵ䓐Ἦἄ䁢⛘⛨䘬ᶨ悐↮ˤ
劍 Sn 䘬 cju1^䁢 2炻⇯㊯Ẍ⮯ DQTS ᷕ䘬㧁娴 U 伖ỵ⃫炻ᶼ⮯䚖㧁
ỵ⛨䘬ẋ䡤妋慳䁢 Uivnc ẋ䡤ˤ劍 Sn 䘬 cju1^䁢 1炻⇯ cju2^⯙
ᶵ傥䁢 2ˤ!
Mbcfm! 䦳⺷䚠⮵ῷ䦣忳䬿⺷ˤ!
!
ȾCMY!mbcfmȿᶵ傥㗗㚱㡅ẞ䘬ˤ⬫⥳䳪⺽崟嗽䎮☐↯㎃⇘ Uivnc 䉨ンˤ!
CMY)Csbodi!xjui!Mjol!boe!pqujpobmmz!fYdibohf*㊯Ẍ㚱⤪ᶳ䓐㱽烉!
2/ ⮯ᶳᶨ㡅㊯Ẍ䘬ỵ⛨㊟居⇘ S25 ᷕ)捰䳸㙓⬀☐*ˤ!
3/ 廱䦣⇘ mbcfm ㆾ Sn ᷕ䘬⛘⛨ˤ!
4/ 劍ᶳ朊ℑ㡅ᷕ䘬ảỽᶨ㡅ㆸ䩳炻⇯⮯㊯Ẍ普↯㎃⇘ Uivnc烉!
..!Sn 䘬 cju1^䁢 2!
!!!!!!!!..!ἧ䓐ȾCMY!mbcfmȿ⼊⺷!
㨇☐䳂䘬ȾCMY!mbcfmȿ㊯Ẍᶵ傥廱䦣⇘䚖⇵㊯Ẍ⛇ 43NC 䭬⚵ᷳ⢾䘬ỵ⛨ˤ!
!!!!!
ἳ⫸烉!
CMY!!S3!
CMYOF!!S1!
CMY!!uivnctvc!
!
3.4 輔助運算器指令
2/ DEQ DEQ3!
庼≑忳䬿☐屯㕁㑵ἄ)DEQ炻Dpqspdfttps!Ebub!pQfsbujpo*ˤ!
⎍㱽烉!
DEQ|dpoe~!!dpqspd炻pqdpef2炻DSe炻DSo炻DSn|炻pqdpef3~!
DEQ3!!dpqspd炻pqdpef2炻DSe炻DSo炻DSn|炻pqdpef3~!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
dpqspd! ㊯Ẍ㑵ἄ䘬庼≑忳䬿☐⎵䧙ˤ㧁㸾⎵䧙䁢 qo炻℞ᷕ o
䁢 1 ᶨ 26 䭬⚵ℏ䘬㔜㔠ˤ!
Pqdpef2! 庼≑忳䬿☐䘬䈡⭂㑵ἄ䡤ˤ!
DSe炻DSo炻DSn! 庼≑忳䬿☐㙓⬀☐ˤ!
pqdpef3! ⎗怠㑯䘬庼≑忳䬿☐䈡⭂㑵ἄ䡤ˤ!
!!
忁ṃ㊯Ẍ䘬ἧ䓐⍾㰢㕤庼≑忳䬿☐ˤ!
DEQ3 ⥳䳪㗗䃉㡅ẞ䘬ˤ!
!
3/ NDSˣNDS3 NDSS!
⮯屯㕁⽆ BSN 㙓⬀☐⁛復⇘庼≑忳䬿☐ˤ⎗㊯⭂⎬䧖旬≈㑵ἄ炻ὅ㒂庼≑忳
䬿☐侴⭂ˤ!
⎍㱽烉!
NDS|dpoe~!!dpqspd炻pqdpef2炻Se炻DSo炻DSn|炻pqdpef3~!
! 第31 頁!
- 38. NDS3!!dpqspd炻pqdpef2炻Se炻DSo炻DSn|炻pqdpef3~!
NDSS|dpoe~!!dpqspd炻pqdpef2炻Se炻So炻DSn!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
dpqspd! ㊯Ẍ㑵ἄ䘬庼≑忳䬿☐⎵䧙ˤ㧁㸾⎵䁢 qo炻℞ᷕ o 䁢 1 ᶨ 26
䭬⚵ℏ䘬㔜㔠ˤ!
Pqdpef2! 庼≑忳䬿☐䘬䈡⭂㑵ἄ䡤ˤ!
Se炻So! ⍇⥳㙓⬀☐炻ᶵ⃩姙㗗 S26ˤ!
DSo炻DSn! 庼≑忳䬿☐㙓⬀☐ˤ!
pqdpef3! ⎗怠㑯䘬庼≑忳䬿☐䈡⭂㑵ἄ䡤ˤ!
!
忁ṃ㊯Ẍ䘬ἧ䓐⍾㰢㕤庼≑忳䬿☐ˤ!
NDS3 ⥳䳪㗗䃉㡅ẞ䘬ˤ!
!
B/ NSDˣNSD3 NSSD!
⮯屯㕁⽆庼≑忳䬿☐⁛復⇘ BSN 㙓⬀☐ˤ⎗㊯⭂⎬䧖旬≈㑵ἄ炻ὅ㒂庼≑忳
䬿☐侴⭂ˤ!
⎍㱽烉!
NSD|dpoe~!!dpqspd炻pqdpef2炻Se炻DSo炻DSn|炻pqdpef3~!
NSD3!!dpqspd炻pqdpef2炻Se炻DSo炻DSn|炻pqdpef3~!
NSSD|dpoe~!!dpqspd炻pqdpef2炻Se炻So炻DSn!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
dpqspd! ㊯Ẍ㑵ἄ䘬庼≑忳䬿☐⎵䧙ˤ㧁㸾⎵䁢 qo炻℞ᷕ o 䁢 1 ᶨ 26
䭬⚵ℏ䘬㔜㔠ˤ!
Pqdpef2! 庼≑忳䬿☐䘬䈡⭂㑵ἄ䡤ˤ!
Se炻So! ⍇⥳㙓⬀☐炻ᶵ⃩姙㗗 S26ˤ!
DSo炻DSn! 庼≑忳䬿☐㙓⬀☐ˤ!
pqdpef3! ⎗怠㑯䘬庼≑忳䬿☐䈡⭂㑵ἄ䡤ˤ!
!
忁ṃ㊯Ẍ䘬ἧ䓐⍾㰢㕤庼≑忳䬿☐ˤ!
NSD3 ⥳䳪㗗䃉㡅ẞ䘬ˤ!
!
C/ MED TUD!
⛐姀ㅞ橼庼≑忳䬿☐ᷳ攻⁛復屯㕁ˤ!
⎍㱽烉!
忁ṃ㊯Ẍ㚱 4 䧖⎗傥⼊⺷烉!
暞ῷ䦣烉pq|dpoe~|M~!!dpqspd炻DSe炻So^!
⇵䳊⺽ῷ䦣烉pq|dpoe~|M~!!dpqspd炻DSe炻So炻$|.~pggtfu^|"~!
⼴䳊⺽ῷ䦣烉pq|dpoe~|M~!!dpqspd炻DSe炻So^炻$|.~pggtfu!
!
℞ᷕ烉!
! 第32 頁!
- 39. dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
M! ⎗怠㑯⯦䡤炻㊯㖶㗗攟㔜㔠⁛復ˤ!
dpqspd! ㊯Ẍ㑵ἄ䘬庼≑忳䬿☐⎵䧙ˤ㧁㸾⎵䧙䁢 qo炻℞ᷕ o 䁢 1ȹ26
䭬⚵ℏ䘬㔜㔠ˤ!
DSe! 䓐㕤庱ℍㆾ⃚⬀䘬庼≑忳䬿☐㙓⬀☐ˤ!
So! 姀ㅞ橼➢⛨㙓⬀☐ˤ劍㊯⭂ S26炻⇯ἧ䓐䘬ῤ㗗䔞⇵㊯Ẍỵ⛨≈
9ˤ!
pggtfu! 忳䬿⺷炻℞ῤ䁢 5 䘬㔜㔠炻䭬⚵⛐ 1ȹ2131 ᷳ攻ˤ!
!!
忁ṃ㊯Ẍ䘬ἧ䓐⍾㰢㕤庼≑忳䬿☐ˤ!
!
D/ MED3 TUD3!
⛐姀ㅞ橼庼≑忳䬿☐ᷳ攻⁛復屯㕁䘬㊯Ẍˤ㟡㒂屯㕁⁛復㕡⎹⎗ẍ怠㑯ℑ
侭℞ᶨˤ!
⎍㱽烉!
忁ṃ㊯Ẍ㚱 4 䧖⎗傥䘬⼊⺷烉!
暞ῷ䦣烉pq!!dpqspd炻DSe炻So^!
⇵䳊⺽ῷ䦣烉pq!!dpqspd炻DSe炻So炻$|.~pggtfu^|"~!
⼴䳊⺽ῷ䦣烉pq!!dpqspd炻DSe炻So^炻$|.~pggtfu!
!
℞ᷕ烉!
dpqspd! ㊯Ẍ㑵ἄ䘬庼≑忳䬿☐⎵䧙ˤ㧁㸾⎵䧙䁢 qo炻℞ᷕ o 䁢 1ȹ26
䭬⚵ℏ䘬㔜㔠ˤ!
DSe! 䓐㕤庱ℍㆾ⃚⬀䘬庼≑忳䬿☐㙓⬀☐ˤ!
So! 姀ㅞ橼➢⛨㙓⬀☐ˤ劍㊯⭂ S26炻⇯ἧ䓐䘬ῤ㗗䔞⇵㊯Ẍỵ⛨≈
9ˤ!
pggtfu! 忳䬿⺷炻℞ῤ䁢 5 䘬㔜㔠炻䭬⚵⛐ 1ȹ2131 ᷳ攻ˤ!
!
忁ṃ㊯Ẍ䘬ἧ䓐⍾㰢㕤庼≑忳䬿☐ˤ!
MED3 TUD3 ⥳䳪㗗䃉㡅ẞ䘬ˤ!
!
3.5 雜項指令
2/ TXJ!
庇橼ᷕ㕟ˤ!
⎍㱽烉!
TXJ|dpoe~!!jnnfe`35!
!
℞ᷕ烉jnnfe`35 䁢忳䬿⺷ˤ℞ῤ䁢 1!ȹ!)335.2*!䭬⚵ℏ䘬㔜㔠)35 ỵ⃫㔜㔠*ˤ!
!
TXJ)TpguXbsf!Joufssvqu*㊯Ẍ⺽崟 TXJ ἳ⢾ˤ忁シ␛叿嗽䎮☐㧉⺷嬲㎃䁢
䭉䎮㧉⺷炻DQTS ᾅ⬀⇘䭉䎮㧉⺷䘬 TQTS ᷕ炻➟埴廱䦣⇘ TXJ ⎹慷ˤ!
忁㡅㊯Ẍᶵ⼙枧㡅ẞ䡤㧁娴ˤ!
!
! 第33 頁!
- 40. ἳ⫸烉!
TXJ!!1y234567!
!
3/ NST!
⮯ DQTS ㆾ TQTS 䘬ℏ⭡⁛復⇘ᶨ凔䓐徼㙓⬀☐ˤ!
⎍㱽烉!
NST|dpoe~!!Se炻qts!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
Se! 䚖㧁㙓⬀☐ˤSe ᶵ⃩姙䁢 S26ˤ!
qts! DQTS ㆾ TQTSˤ!
!
NST 冯 NTS 惵⎰ἧ䓐炻ἄ䁢㚜㕘 QTS 䘬Ⱦ嬨ᶨᾖ㓡ȹ⮓ȿ⸷↿䘬ȹ悐↮ˤἳ
⤪烉㓡嬲嗽䎮☐㧉⺷ㆾ㶭昌㧁娴 Rˤ!
䔞嗽䎮☐⛐ἧ䓐侭㧉⺷ㆾ䲣䴙㧉⺷ᶳ㗪炻ᶨ⭂ᶵ傥娎⚾⬀⍾ TQTSˤ!
忁㡅㊯Ẍᶵ⼙枧㡅ẞ䡤㧁娴ˤ!
ἳ⫸烉!
NTS!!S4炻TQTS!
!
B/ NTS!
䓐䩳⌛㔠ⷠ㔠ㆾᶨ凔䓐徼㙓⬀☐䘬ℏ⭡庱ℍ DQTS ㆾ TQTS 䘬㊯⭂⋨➇ˤ!
⎍㱽烉!
NTS|dpoe~!!=qts?`=gjfmet?炻$jnnfe`9s!
NTS|dpoe~!!=qts?`=gjfmet?炻Sn!
!
℞ᷕ烉!
=qts?! DQTS ㆾ TQTSˤ!
=gjfmet?! ㊯⭂⁛復䘬⋨➇ˤ=gjfmet?⎗ẍ㗗ẍᶳ䘬ȹ䧖ㆾ⣂䧖烉!
d! ㍏⇞➇怖休ỵ⃫䳬)QTS8;1^*!
y! 㒜⯽➇怖休ỵ⃫䳬)QTSm6;9^*!
t! 䉨ン➇怖休ỵ⃫䳬)QTS34;27^*!
g! 㧁娴➇怖休ỵ⃫䳬)QTS42;35^*!
jnnfe`9s! ῤ䁢㔠⫿ⷠ㔠䘬忳䬿⺷ˤⷠ㔠⽭枰⮵ㅱ 9 ỵ溆昋⚾ˤ娚溆昋⚾
⛐ 43 ỵ⃫ᷕ徜⚰䦣ỵ„㔠ỵˤ!
Sn! Ἦ㸸㙓⬀☐ˤ!
!!
NST 冯 NTS 䚠惵⎰ἧ䓐炻ἄ䁢㚜㕘 QTS 䘬Ⱦ嬨ȹᾖ㓡ȹ⮓ȿ⸷↿䘬ȹ悐↮ˤ
ἳ⤪烉㓡嬲嗽䎮☐㧉⺷ㆾ㶭昌㧁娴 Rˤ!
劍㊯⭂ g)gjfme*炻⇯㊯Ẍ栗⺷㚜㕘㧁娴ˤ!
!
ἳ⫸烉!
NTS!!DQTS`g炻S6!
!
! 第34 頁!
- 41. C/ CLQU!
ᷕ㕟溆㊯Ẍˤ!
⎍㱽烉!
CLQU!!jnnfe`27!
!
℞ᷕ烉jnnfe`27 䁢忳䬿⺷ˤ℞ῤ䁢䭬⚵⛐ 1ȹ76647 ℏ䘬㔜㔠)27 ỵ⃫㔜㔠*ˤ!
!
CLQU)CsfbLQpjoU*㊯Ẍ⺽崟嗽䎮☐忚ℍ昌拗㧉⺷ˤ昌拗ⶍ℟⎗ἧ䓐忁ᶨ溆⛐
㊯Ẍ⇘忼䈡⭂䘬ỵ⛨㗪婧㞍䲣䴙䉨ンˤ!
!
ἳ⫸烉!
CLQU!!1yG13D!
CLQU!!751!
!
3.6 虛擬指令
2/ BES!
⮯䦳⺷䚠⮵ῷ䦣ㆾ㙓⬀☐䚠⮵ῷ䦣ỵ⛨庱ℍ⇘㙓⬀☐ᷕˤ!
⎍㱽烉!
BES|dpoe~!!sfhjtufs炻fyqs!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
sfhjtufs! 庱ℍ䘬㙓⬀☐ˤ!
Fyqs! 䦳⺷䚠⮵ῷ䦣ㆾ㙓⬀☐䚠⮵ῷ䦣忳䬿⺷炻⍾ῤ䁢!
..!朆 xpse ⮵㸾ỵ⛨炻⛐.366ȹ,366 ỵ⃫䳬䭬⚵ℏˤ!
..!xpse ⮵㸾ỵ⛨炻⛐.2131ȹ,2131 ỵ⃫䳬䭬⚵ℏˤ!
!
⮵㕤䦳⺷䚠⮵ῷ䦣忳䬿⺷炻䴎⭂䭬⚵㗗䚠⮵䚖⇵㊯Ẍỵ⛨⼴ℑᾳ⫿嗽ˤ!
BES ⥳䳪⼁䶐ㆸ m 㡅㊯Ẍˤ⼁䶐☐娎⚾䓊䓇╖ᾳ BEE ㆾ TVC ㊯ẌἮ庱ℍỵ⛨ˤ
劍ỵ⛨ᶵ傥㓦Ṣ m 㡅㊯Ẍ炻⇯䓊䓇拗婌炻⼁䶐⣙㓿ˤ!
⚈䁢ỵ⛨㗗䦳⺷䚠⮵ῷ䦣ㆾ㙓⬀☐䚠⮵ῷ䦣炻BES 䓊䓇ỵ伖䃉斄䘬ẋ䡤ˤ!
ἧ䓐 BESM 嘃㒔㊯Ẍẍ⼁䶐㚜⮔䘬㚱㓰ỵ⛨䭬⚵ˤ!
劍 fyqs 㗗䦳⺷䚠⮵ῷ䦣炻⇯⬫⽭枰⍾ῤㆸ冯 BES 嘃㒔㊯Ẍ⛐⎴ᶨẋ䡤⋨➇
䘬ỵ⛨ˤ!
!
ἳ⫸烉!
tubsu! NPW!!S1炻$21!
BES!!S5炻tubsu!
!
3/ BESM!
⮯䦳⺷䚠⮵ῷ䦣ㆾ㙓⬀☐䚠⮵ῷ䦣ỵ⛨庱ℍ⇘㙓⬀☐ᷕˤBESM 栆Ụ㕤 BES 嘃
㒔㊯ẌˤBESM ⚈䁢䓊䓇 3 ᾳ屯㕁嗽䎮㊯Ẍ炻㭼 BES ⎗庱ℍ㚜⮔䭬⚵䘬ỵ⛨ˤ!
⛐⼁䶐 Uivnc ㊯Ẍ㗪 BESM 䃉㓰ˤBESM 䓐⛐ BSN ẋ䡤ᷕˤ!
⎍㱽烉!
! 第35 頁!
- 42. BESM|dpoe~!!sfhjtufs炻fyqs!
!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
sfhjtufs! 庱ℍ䘬㙓⬀☐ˤ!
fyqs! 䦳⺷䚠⮵ῷ䦣ㆾ㙓⬀☐䚠⮵ῷ䦣忳䬿⺷炻⍾ῤ䁢!
..!朆 xpse ⮵㸾⛘⛨炻⛐ 75LC 䭬⚵ℏˤ!
..!xpse ⮵㸾⛘⛨炻⛐ 367LC 䭬⚵ℏˤ!
!
⮵㕤䦳⺷䚠⮵ῷ䦣忳䬿⺷炻䴎⭂䭬⚵㗗䚠⮵䚖⇵㊯Ẍỵ⛨⼴ℑᾳ⫿嗽ˤʉ!
BESM ⥳䳪⼁䶐ㆸ 3 㡅㊯Ẍˤ⌛ἧỵ⛨⎗㓦ℍ 2 㡅㊯Ẍ炻ḇ䓊䓇䫔 3 㡅∑检㊯
Ẍˤ劍⼁䶐☐ᶵ傥⮯ỵ⛨㓦ℍ 3 㡅㊯Ẍ炻⇯䓊䓇拗婌炻⼁䶐⣙㓿ˤ!
⚈䁢ỵ⛨㗗䦳⺷䚠⮵ῷ䦣ㆾ㙓⬀☐䚠⮵ῷ䦣炻BESM 䓊䓇ỵ伖䃉斄䘬ẋ䡤ˤ!
劍 fyqs 㗗䦳⺷䚠⮵ῷ䦣炻⇯⽭枰⍾ῤㆸ冯 BESM 嘃㒔㊯Ẍ⛐⎴ᶨẋ䡤⋨➇䘬
ỵ⛨烊⏎⇯捰䳸⼴⎗傥崭↢䭬⚵ˤ!
!
ἳ⫸烉!
tubsu! ! NPW!!S1炻$21!
BESM!!S5炻tubsu,7111!
!
B/ MES!
䓐 43 ỵ⃫ⷠ㔠ㆾᶨᾳỵ⛨庱ℍ㙓⬀☐ˤ!
⎍㱽烉!
MES|dpoe~!!sfhjtufs炻>fyqs!}!mbcfm.fyqs^!
℞ᷕ烉!
dpoe! ⎗怠㑯䘬㡅ẞ䡤ˤ!
!
sfhjtufs! 庱ℍ䘬㙓⬀☐ˤ!
fyqs! 䴎ῤㆸ㔠⫿ⷠ㔠ˤ!
..!劍 fyqs ῤ㗗⛐㊯Ẍ䘬䭬⚵ℏ炻⇯⼁䶐☐䓊䓇ᶨ㡅 NPW ㆾ NWO
㊯Ẍˤ!
..!劍 fyqs ῤᶵ⛐ NPW ㆾ NWO ㊯Ẍ䘬䭬⚵ℏ炻⇯⼁䶐☐⮯ⷠ㔠㓦
ℍ 2jufsbm!qppm炻᷎䓊䓇ᶨ㡅䦳⺷䚠⮵ῷ䦣䘬 MES ㊯Ẍ⽆
2jufsbm!qppm 嬨ⷠ㔠ˤ!
mbcfm.fyqs!䦳⺷䚠⮵ῷ䦣ㆾ⢾悐忳䬿⺷ˤ⼁䶐☐⮯ mbcfm.fyqs 䘬ῤ㓦ℍ
2jufsbm!qppm炻᷎䓊䓇ᶨ㡅䦳⺷䚠⮵ῷ䦣䘬 MES ㊯Ẍ⽆ mjufsbm!
qppm ᷕ庱ℍῤˤ劍 mbcfm.fyqs 㗗⢾悐忳䬿⺷炻ㆾᶵ⊭⏓⛐䚖⇵
⋨➇ℏ炻⇯⼁䶐☐⮯ᶨᾳ捰䳸☐⎗慵⭂ỵ㊯Ẍ㓦ℍ䚖㧁㨼ˤ捰䳸
☐⛐捰䳸㗪䓊䓇ỵ⛨ˤ!
!
MES)MpbE!Sfhjtufs*嘃㒔㊯Ẍ䓐㕤 3 ᾳᷣ天䚖䘬烉!
2/ 䔞䩳⌛㔠ῤ䓙㕤崭↢ NPW NWO ㊯Ẍ䭬⚵侴ᶵ傥庱ℍ⇘㙓⬀☐ᷕ㗪炻䓊
䓇㔯⫿ⷠ㔠ˤ!
3/ ⮯䦳⺷䚠⮵ῷ䦣ㆾ⢾悐ỵ⛨庱ℍ⇘㙓⬀☐ᷕˤỵ⛨ᾅ㊩㚱㓰侴冯捰䳸☐
! 第36 頁!
- 43. ⮯⊭⏓ MES 䘬 FMG ⋨➇㓦⇘ỽ嗽䃉斄ˤ!
忁䧖㕡㱽庱ℍ䘬ỵ⛨⛐䄼㍍㗪㗗⚢⭂䘬炻⚈侴ẋ䡤冯ỵ伖㚱斄ˤ!
⽆ QD ⇘ mjufsbm!qppm ᷕῤ䘬ῷ䦣慷⽭枰⮷㕤 5LCˤ攳䘤侭⽭枰䡢ᾅ⛐㊯Ẍ
䭬⚵ℏ㚱ᶨᾳ mjufsbm!qppmˤ!
ἳ⫸烉!
MES!!S4炻>1ygg1!
MES!!S2炻>qmbdf!
!
C/ OPQ!
OPQ 䓊䓇暨䘬 BSN 䃉㑵ἄẋ䡤ˤ!
⎍㱽烉!
OPQ!
!
OPQ)Op!PQfsbujpo*ᶵ傥㚱㡅ẞἧ䓐ˤ➟埴ᶵ➟埴䃉㑵ἄ㊯Ẍ㗗ᶨ㧋䘬炻
⚈侴ᶵ暨天㚱㡅ẞ➟埴ˤ!
BMV 䉨ン㧁娴ᶵ⍿ OPQ ⼙枧ˤ!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
! 第37 頁!
- 44. 1
UEE3303
Introduction to Embedded Systems
Lecture 4
Cortex Processors
YuLun Huang
http://rtes.cn.nctu.edu.tw
UEE 3303 <1> YL Huang Spring ‘14 © NCTU
Cortex Profiles
° 2004, ARM introduced new Cortex family of
processors
° Three profiles
• Cortex-A: high-end application processor
• Cortex-R: real-time processor
• Cortex-M: microcontroller
UEE 3303 <2> YL Huang Spring ‘14 © NCTU
Cortex-M Profiles
° Cortex-M0, Cortex-M0+
• Smallest processor in the family
• Low-cost, low-power
• Replacement of the existing 8-bit uC (still offering 32-bit
performance)
° Cortex-M1
• Similar to M0, but designed as a soft core (running on FPGA)
° Cortex-M3
• High performance uC
° Cortex-M4
• +DSP
• +FPU
UEE 3303 <3> YL Huang Spring ‘14 © NCTU
8051 vs. Cortex-M0
° M0 is a reduced version of M3, but keeps good
performance model
° The example is a 16 x 16 mult
• multiplies r1 & r0, and put the results in r0
UEE 3303 <4> YL Huang Spring ‘14 © NCTU
- 45. 2
Cortex-M0 vs. Cortex-M0+
° Cortex-M0+ is fully compatible with Cortex-M0
° Cortex-M0+ has more advanced features
• More processing power and lower power consumption
- 11 uW vs. 16 uW
• 2-stage pipeline to reduce number of memory accesses and
runtime energy consumption
UEE 3303 <5> YL Huang Spring ‘14 © NCTU
New peripheral I/O interface
° New I/O interface supports single cycle access to
peripheral registers
° Cortex-M0+ can fetch instruction via AHB while
making a data access to the peripheral registers
UEE 3303 <6> YL Huang Spring ‘14 © NCTU
Cortex-M3
° The mainstay of the Cortex-M family
° High-performance 32-bit uC
° 3-stage pipeline: Fetch, Decode, Execute
° Like the ARM7, it is a RISC processor: most
instructions execute in a single cycle
° Manufactured at a very low cost
UEE 3303 <7> YL Huang Spring ‘14 © NCTU
Cortex-M3 Pipeline
° ARM instructions
° Thumb instructions
° Thumb-2 instructions
• a blend of 16- and 32-bit instructions
UEE 3303 <8> YL Huang Spring ‘14 © NCTU
- 46. 3
Cortex-M4
° M3 + DSP + Floating Point Support: single precision
Support event-driven
microcontroller code
UEE 3303 <9> YL Huang Spring ‘14 © NCTU
In this class, we have
° PTK using Cortex-M3
° K60D using Cortex-M4
UEE 3303 <10> YL Huang Spring ‘14 © NCTU
- 47. 1
UEE3303
Introduction to Embedded Systems
Lecture 5
PTK
YuLun Huang
http://rtes.cn.nctu.edu.tw
UEE 3303 <1> YL Huang Spring’14 © NCTU
PTK
° Contains a PTK-BASE and a PTK-MCU
• NOTE: LED2 & 3 are not workable in our target board
UEE 3303 <2> YL Huang Spring’14 © NCTU
(What we have?) Top side of PTK-BASE
UEE 3303 <3> YL Huang Spring’14 © NCTU
Hardware Installation
° PTK
° DC-12V
° JTAG (debugger)
UEE 3303 <4> YL Huang Spring’14 © NCTU
- 48. 2
GPIO
UEE 3303 <5> YL Huang Spring’14 © NCTU
LEDs (LED0 ~ LED3)
UEE 3303 <6> YL Huang Spring’14 © NCTU
7-Segment (HEX1)
UEE 3303 <7> YL Huang Spring’14 © NCTU
Button (KEY0 ~ KEY3, RESET)
UEE 3303 <8> YL Huang Spring’14 © NCTU
- 49. 3
DIP Switch (SW1)
1 DIP Switch with 4 bits connected to MCU for input
UEE 3303 <9> YL Huang Spring’14 © NCTU
Buzzer (SU1)
• The only audible device in PTK-BASE
• Should be connected to a clock signal for generating beep
• You can change the tone of buzzer by changing the frequency of clock input
UEE 3303 <10> YL Huang Spring’14 © NCTU
Sensors
° Built-in Sensors
• Potentiometer (VR1)
• Light Sensor (U3)
• Temperature Sensor (U5)
• Infrared TX/RX
° Extended Sensor Modules
• Follow the PTK-MEMS module design specification, you
can design your own sensor modules
UEE 3303 <11> YL Huang Spring’14 © NCTU
I/O Map for Light Sensor (U3: ISL29023)
° Full-scale Range: 1000 lux~64000lux
° Human eye response
° 16-bit resolution
° Programmable upper and lower threshold interrupt
° The I2C device address is 0x44
• PTK-MCU uses I2C bus to link ISL29023 for setup and
retrieving ambient light data
UEE 3303 <12> YL Huang Spring’14 © NCTU
- 50. 4
Storage
° EEPROM (U6)
° SD Socket (CN13)
UEE 3303 <13> YL Huang Spring’14 © NCTU
Communication
° Ethernet (CN16)
° USB (CN15)
° RS-485 & CAN (CN12, JP3)
° RS-232 (CN11)
UEE 3303 <14> YL Huang Spring’14 © NCTU
- 51. 1
UEE3303
Introduction to Embedded Systems
Lecture 6
Embedded System Development
YuLun Huang
http://rtes.cn.nctu.edu.tw
UEE 3303 <1> YL Huang Spring‘14 © NCTU
Hardware and Software Co-Design Model
° Hardware and software for an embedded system are
developed in parallel
• Software component can take advantage of special hardware
features to gain performance
• Hardware component can simplify module design if
functionality can be achieved in software
- Reduce overall hardware complexity and cost
• Co-design model emphasized the fundamental characteristics of
embedded systems: APPLICATION-SPECIFIC
UEE 3303 <2> YL Huang Spring‘14 © NCTU
Cross-Platform Development
° Platform:
• Hardware (processor)
• Operating System
• Software Development tools
° Software for an embedded system is developed on one
platform but runs on another.
• Host system: where the software is developed
• Target system: embedded system under development
° Cross-Compiler
• Compiler that runs on one type of processor architecture but
produces object code for a different type of processor
architecture
- Host: Intel (IA-32/IA64)
- Target: ARM/MIPS
UEE 3303 <3> YL Huang Spring‘14 © NCTU
Cross-platform
Host System
Target System
HEWLET
PACKARD
Serial
Host Resident
Software Target Resident
ICE
Ethernet
JTAG
Software
Application
API layer
File system layer
Logical block layer
Device driver
Hardware layer
UEE 3303 <4> YL Huang Spring‘14 © NCTU
- 52. 2
Essential Development Tools
° Host System offers:
• Cross compiler
• Linker
• Source-level debugger
° Target Embedded System offers:
• Linker loader
• Monitor
• Debug agent
° Connections between host and target system:
• Serial Interface
• ICE: JTAG (Xmit debug info b/w host debugger & target debug agent)
° Programs including:
• System software
• Real-time operating system (RTOS): Kernel
• Application code
° Steps:
• Compiled programs into object code
• Linked together into an executable image
UEE 3303 <5> YL Huang Spring‘14 © NCTU
Development
° Native development:
• Writing applications that execute in the same env as used for
development
• Do not need to be concerned with
- How an executable image is loaded into memory and
- How execution control is transferred to the application
° Cross-platform development:
• Need to understand the target system fully:
- How to store the program image on the target system
- How and where to load the image during runtime
- How to develop and debug the system iteratively
- ..
• These aspects impact how the code is developed, compiled and
linked.
UEE 3303 <6> YL Huang Spring‘14 © NCTU
Product design process
UEE 3303 <7> YL Huang Spring‘14 © NCTU
IDE (Integrated Development Environment)
° Integrated
• Editor
• Compiler
• Linker
• Debugger…
° IAR
° CodeWarrior
UEE 3303 <8> YL Huang Spring‘14 © NCTU
- 53. 3
IAR
UEE 3303 <9> YL Huang Spring‘14 © NCTU
IAR Product offering
° IAR Embedded Workbench
• Generic development platform, supports more than 35 different 8, 16 and 32 bit
architectures
• Includes C/Embedded C++ optimizing compiler, assembler, linker, librarian,
editor, project manager and C-SPY debuggers
IAR visualSTATE
• Graphical design tool for embedded applications based on state machine
models
• Designing, testing and implementation real-time applications based on superior
technology
• Automatically generates consistent code for embedded systems
IAR MakeApp
• Device driver wizard. Master the complexity of an modern
microcontroller more quicker and easier than ever before
IAR’s products for Bluetooth
• IAR Embedded Stack for Bluetooth,
» Compact and easy configurable
• PreQual
• Starter kit
UEE 3303 <10> YL Huang Spring‘14 © NCTU
Complete suite of tools from IAR
visualSTATE
Design
Embedded
Workbench
Verify,
Validate,
Implement
IAR J-Link
& IAR
J-Trace
IAR
Development
Kits
Compile Debug Deploy
Target
applicati
on
Idea
IAR
RTOS & Middleware
IAR
PowerPac
UEE 3303 <11> YL Huang Spring‘14 © NCTU
Model
State Chart / UML State Machine Modeling Tool
User-Written Codes
Middleware
TCP/IP
Stack
USB
Stack
GUI
RTOS Kernel
BSP
File
System
Compiler / Assembler
Linker
Debugger
Code
IDE
Auto-
Generated
Code
Project
Manager
Target System
ARM SoC
On-Chip Peripherals
On-Chip
Flash
On-Chip
RAM
ARM Core
Embedded
ICE
ETM
Trace
Port
JTAG
Port
Emulator
Trace
Probe
JTAG
Probe
UEE 3303 12 YL Huang Spring‘14 © NCTU
- 54. 4
ePBB Development
UEE 3303 13 YL Huang Spring‘14 © NCTU
IAR Workspace
° Manage multiple projects for a product
• by right-clicking on the project and choosing ‘Set as Active’ to
select the project
V
V
V
V
V
The
workspace
contains 5
projects: adc,
alarm, lcd, pit,
rtc
UEE 3303 14 YL Huang Spring‘14 © NCTU
IAR Project
° Manage multiple files/libraries for a project
° One example is creating a group to hold source files
that is common between projects, and you only want
one unique copy of these files.
UEE 3303 15 YL Huang Spring‘14 © NCTU
Create Project
° 1. Open IAR. Inside the startup window click the first
button: “Create new project in current workspace.”
UEE 3303 16 YL Huang Spring‘14 © NCTU
- 55. 5
° 2. Select the “Empty project” Template, then click OK.
UEE 3303 17 YL Huang Spring‘14 © NCTU
° 3. name your project and specify the desired directory.
Click “OK.” Then your project should appear in the
upper left-hand side of the screen. Right-click on it
then choose “Options.”
UEE 3303 18 YL Huang Spring‘14 © NCTU
° 4. Inside the options: choose the appropriate XXXXX device
(STM32F207VG in this case).
• If you want to be programming in ASM, also check the “Assembler
-only project” box in the lower-right hand side of the screen.
• If you are programming in C, please leave this box unchecked.
UEE 3303 19 YL Huang Spring‘14 © NCTU
° 5. For C project please verify that the “Library
Configurations” tab has “CLIB” chosen for the library. For
assembly projects this option should be selected as
“none.”
UEE 3303 20 YL Huang Spring‘14 © NCTU
- 56. 6
° 6. Next select the “Debugger” category on the left-side of
the screen.
• Choose “YYYY Debugger” under the “Driver” (J-Link in this case).
• For C projects please make sure “Run to main” is checked.
UEE 3303 21 YL Huang Spring‘14 © NCTU
° 7. Under the “YYYY Debugger” category, make sure the
appropriate hardware programmer is selected under
“Connection” and the appropriate JTAG protocol is
selected under “Debug protocol.”
• Click OK. These should be the only changes necessary to build
a simple code and load it onto your target XXXXX.
• NOTE: The Spy-Bi-Wire mode is not supported by the Parallel
Programmer (e.g. MSP-FET430PIF), when LPTx is selected.
UEE 3303 22 YL Huang Spring‘14 © NCTU
° 8. Now we are ready to load our code file onto your
XXXXX. To do this, right-click on your project and go to
Add - Add files. Browse to your code file with a “.c” C
-file or “.s” assembly file.
UEE 3303 23 YL Huang Spring‘14 © NCTU
° 9. Now your code should be added to your project. If
you double-click on the newly added code file the text
should appear in the main window.
UEE 3303 24 YL Huang Spring‘14 © NCTU
- 57. 7
Configuration of a Project
° By default when creating a new project, you
automatically get two configurations: Release and
Debug
UEE 3303 25 YL Huang Spring‘14 © NCTU
CODE WARRIOR
UEE 3303 26 YL Huang Spring‘14 © NCTU
- 58.
- 59.
- 60.
- 61.