freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

arm匯編語言程序設(shè)計(jì)(編輯修改稿)

2025-02-14 02:22 本頁面
 

【文章內(nèi)容簡介】 R2, [R1] END 已知 32位有符號數(shù) X存放在存儲器的地址 0x90010中,要求實(shí)現(xiàn): Y=1( X〉 0)或 Y=0 ( X=0)或 Y=1( X0) AREA Exam CODE READONLY ENTRY START LDR R1,=0x90010 LDR R2,[R1] CMP R2, 0 BEQ ZERO BGT PLUS MOV R0,1 B FINISH LPUS MOV R0, 1 B FINISH ZERO MOV R0, 0 FINISH STR R0, [R1] END 多分支結(jié)構(gòu): main ( int ) { switch (x) { case 0: return method_0 ()。 case 1: return method_1 ()。 case 2: return method_2 ()。 case 3: return method_3 ()。 default: return method_d 。 } } AREA Exam CODE READONLY ENTRY START CMP R0, 4 ADDLT PC,PC,R0,LSL 2 ;分支表結(jié)構(gòu)其偏 B method_d ;移量由 R0決定 B method_0 B method_1 B method_2 B method_3 method_0 MOV R0,1 B end0 method_1 MOV R0,2 B end0 method_2 MOV R0,3 B end0 method_3 MOV R0,4 B end0 method_d MOV R0,0 end0 B START END ENTRY 。 mark the first instruction to call start MOV r0, 1 。 set up the three parameters MOV r1, 3 MOV r2, 2 BL arithfunc 。 call the function stop MOV r0, 0x18 。 angel_SWIreason_ReportException LDR r1, =0x20226 。 ADP_Stopped_ApplicationExit SWI 0x123456 。 ARM semihosting SWI arithfunc 。 label the function CMP r0, num 。 Treat function code as unsigned integer MOVHS pc, lr 。 If code is = num then simply return ADR r3, JumpTable 。 Load address of jump table LDR pc, [r3,r0,LSL2] 。 Jump to the appropriate routine JumpTable DCD DoAdd DCD DoSub DoAdd ADD r0, r1, r2 。 Operation 0 MOV pc, lr 。 Return DoSub SUB r0, r1, r2 。 Operation 1 MOV pc,lr 。 Return END 。 mark the end of this file 循環(huán)程序設(shè)計(jì): ? 計(jì)數(shù)控制:當(dāng)循環(huán)次數(shù)已知時(shí),通常使用計(jì)數(shù)控制法。 MOV Rn, N 。循環(huán)初值部分 … LOOPA … 。循環(huán)體 … … SUBS Rn, Rn, 1 。修改部分 CMP Rn, 0 BGT LOOPA ??刂撇糠? 直到 Rn=0時(shí),循環(huán)結(jié)束。 另,每循環(huán)一次計(jì)數(shù)其加一,直到與設(shè)定的值相等時(shí)結(jié)束。 MOV Rn, 0 。循環(huán)初值部分 … LOOPA … 。循環(huán)體 … … ADDS Rn, Rn, 1 。修改部分 CMP Rn, N BNE LOOPA ??刂撇糠? 直到 Rn=N時(shí),循環(huán)結(jié)束。 例如:編制程序使 S=1+2*3+3*4+4*5+…+N(N+1) ,直到 N等于10為止。 AREA Exam, CODE, READONLY ENTRY START MOV R0, 1 ; R0累加,置初值 1, S MOV R1, 2 ; R1第一個(gè)乘數(shù)置為 2, N REPEAT ADD R2, R1, 1 ; R2第二個(gè)乘數(shù), N+1 MUL R3, R2, R1 ; N( N+1)存于 R3 ADD R0, R0, R3 ;將部分積累加到 R0 ADD R1, R1, 1 ;修改循環(huán)次數(shù) CMP R1, 10 BLE REPEAT B START END ? 條件控制:有些情況下,循環(huán)次數(shù)事先無法確定,但它與某些條件有關(guān)。 例如:求兩個(gè)數(shù)組 DATA DATA2對應(yīng)的數(shù)據(jù)之和,并將和存入新數(shù)組 SUM中,計(jì)算一直到兩數(shù)之和為零時(shí)結(jié)束,并把新數(shù)組的長度存于 R0中。 AREA BlockData, DATA, READWRITE DATA1 DCD 2, 5, 0, 3, 4, 5, 0, 10, 9 DATA2 DCD 3, 5, 4, 2, 0, 8, 3, 10, 5 SUM DCD 0, 0, 0, 0, 0, 0, 0, 0, 0 AREA, Exam, CODE, READONLY ENTRY START LDR R1, =DATA1 LDR R2, =DATA2 LDR R3, =SUM MOV R0, 0 LOOP LDR R4, [R1], 4 LDR R5, [R2], 4 ADDS R4
點(diǎn)擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1