Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 1.25 KB | None | 0 0
  1.                 AREA theRemover, CODE, READONLY
  2.                 ENTRY
  3. pointIncrement  EQU 1
  4. reset           EQU 0
  5. spaceCheck      EQU " "
  6. tCheck          EQU "t"
  7. hCheck          EQU "h"
  8. eCheck          EQU "e"
  9.  
  10.                 ADR r0, EoS
  11.                 ADR r1, STRING1
  12.                 LDRB r2, [r0]
  13. continue        LDRB r3, [r1], #pointIncrement
  14.                 CMP r3, #spaceCheck
  15.                 BEQ checker
  16.                 CMP r3, #tCheck
  17.                 MOVEQ r4, r3
  18.                 BEQ tChecker
  19.                 STRB r3, [r0, #pointIncrement]!
  20.                 CMP r3, r2
  21.                 BNE continue
  22.                 BEQ finish
  23.                
  24. checker         STRB r3, [r0, #pointIncrement]!
  25.                 MOV r4, #reset
  26.                 LDRB r4, [r1], #pointIncrement
  27. tChecker        CMP r4, r2
  28.                 MOV r5, #reset
  29.                 LDRBNE r5, [r1], #pointIncrement
  30.                 CMPNE r5, r2
  31.                 MOV r6, #reset
  32.                 LDRBNE r6, [r1], #pointIncrement
  33.                 CMPNE r6, r2
  34.                 MOV r7, #reset
  35.                 LDRBNE r7, [r1], #pointIncrement
  36.                
  37.                 CMPNE r7, r2
  38.                 CMPNE r7, #spaceCheck
  39.                 CMPEQ r4, #tCheck
  40.                 CMPEQ r5, #hCheck
  41.                 CMPEQ r6, #eCheck
  42.                 STRBNE r4, [r0, #pointIncrement]!
  43.                 STRBNE r5, [r0, #pointIncrement]!
  44.                 STRBNE r6, [r0, #pointIncrement]!
  45.                 STRB r7, [r0, #pointIncrement]!
  46.                 CMP r7, r2
  47.                 BNE continue
  48. finish          B finish
  49.  
  50. STRING1         DCB "4the the 4the The the the1"            ;String1
  51. EoS             DCB 0x00                                    ;end of String1
  52. STRING2         SPACE 0x7F                                  ;just allocating 127 bytes
  53.                 END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement