Created
March 13, 2014 16:55
-
-
Save PhiBabin/9532290 to your computer and use it in GitHub Desktop.
dsda
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;Philippe Babin PHBAB1 - Mathieu Cloutier MACLO245 | |
| NAME main | |
| PUBLIC __iar_program_start | |
| SECTION .intvec : CODE (2) | |
| CODE32 | |
| __iar_program_start | |
| B main ; | |
| Mapile DS32 64 | |
| MaChaine DC8 "[allojdkasjldk" , 0x00 | |
| SECTION .text : CODE (2) | |
| CODE32 | |
| main | |
| ;MOV SP, #1 | |
| ;MOV SP, SP, LSL#21 | |
| LDR R0, =MaChaine | |
| LDR SP, =Mapile | |
| ADD SP, SP, #256 | |
| PUSH {R0} ;Passage de paramètre par la pile | |
| BL VerifieParentheses | |
| POP {R0} ; Récupération du résultat | |
| ;--------------------------------------- | |
| VerifieParentheses | |
| MOV R2, #0 | |
| Boucle | |
| LDRB R1, [R0, R2] | |
| CMP R1, #0x28 ; ( 28 | |
| PUSHEQ {R1} | |
| CMP R1, #0x7B ; { 7B | |
| PUSHEQ {R1} | |
| CMP R1, #0x5B ; [ 5B | |
| PUSHEQ {R1} | |
| CMP R1, #0x29 ; ) 29 | |
| POPEQ {R1} | |
| CMPEQ R1, #0x28 | |
| BEQ | |
| CMP R1, #0x7B ; } 7D | |
| PUSHEQ {R1} | |
| CMP R1, #0x5B ; ] 5D | |
| PUSHEQ {R1} | |
| ADD R2, R2, #1 | |
| CMP R1, #0 | |
| BNE Boucle | |
| BX LR | |
| ;-------------------------------------- | |
| ;SECTION `.noinit`:DATA(2) | |
| END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment