Anonymous user
Abbreviations, easy: Difference between revisions
correction program arm assembly raspberry pi
(correction program arm assembly raspberry pi) |
|||
Line 188:
RIGHT REPEAT *error* PUT MOVE RESTORE *error* *error* *error* POWERINPUT<br><br>
Also note that an ''error'' is noted by: *error* }}
<pre> Correction program 15/11/2020 </pre>
{{works with|as|Raspberry Pi}}
<lang ARM Assembly>
Line 230 ⟶ 229:
szMessErreur: .asciz "Error detected.\n"
szMessErrBuffer: .asciz "buffer size too less !!"
szMessErrorAbr: .asciz "*error*"
szMessInput: .asciz "Enter command (or quit to stop) : "
szCmdQuit: .asciz "QUIT"
szValTest1: .asciz "Quit"
szValTest2: .asciz "Rep"
/*********************************/
/* UnInitialized data */
Line 302 ⟶ 303:
mov r8,r0
mov r9,r1
mov r2,#0 @ indice
mov r3,#0 @ find counter
Line 308 ⟶ 311:
ldr r1,[r9,r2,lsl #2] @ load a item
cmp r1,#0 @ end ?
beq
bl comparStringSpe @
cmp r0,#0 @ no found other search
beq
add r3,r3,#1 @ else increment counter
mov
add r2,r2,#1 @ increment indice
b 1b @ and loop
cmp r3,#1 @ no find or multiple find ?
bne 99f @ error
@ one find
mov r0,
▲ mov r4,r0 @ length input
▲ mov r0,r5 @ length command table
bl computeLength
cmp r4,r0 @ length input > command ?
bgt 99f @ error
▲ mov r2,#0
▲ mov r1,#0
▲4: @ loop count capital letters
▲ ldrb r3,[r5,r2]
▲ cmp r3,#0
▲ beq 5f
▲ tst r3,#0x20 @ capital letter ?
▲ addeq r1,r1,#1
▲ add r2,r2,#1
▲ b 4b
▲5:
▲ cmp r4,r1 @ input < command capital letters
▲ blt 99f @ error
mov r4,#0x20 @ 5 bit to 1
mov r2,#0
6:
ldrb r3,[
cmp r3,#0
beq 7f
bic r3,r3,r4 @ convert to capital letter
add r2,r2,#1
b 6b
7:
strb r3,[r8,r2]
mov r0,r8 @ return string input address
b 100f
Line 576 ⟶ 579:
.include "../affichage.inc"
</lang>
<pre>
Enter command (or quit to stop) :
RIGHT
error▼
Enter command (or quit to stop) :
REPEAT
error▼
Enter command (or quit to stop) :
▲*error*
Enter command (or quit to stop) :
PUT
error▼
Enter command (or quit to stop) :
MOVE
Enter command (or quit to stop) : rest
RESTORE
Enter command (or quit to stop) : types
▲*error*
Enter command (or quit to stop) : fup.
▲*error*
Enter command (or quit to stop) : 6
*error*
Enter command (or quit to stop) : poweRin
POWERINPUT
Enter command (or quit to stop) : quit
QUIT
|