943,753 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 428
  • Assembly RSS
May 7th, 2009
0

Correct me if i'm wrong pls.....

Expand Post »
here is my Caesar cipher code, can u pls have a look at it and correct me if i'm wrong.

Assembly Syntax (Toggle Plain Text)
  1. AREA text, CODE
  2.  
  3. SWI_Exit EQU &11
  4. SWI_WriteC EQU &0
  5.  
  6. ENTRY
  7.  
  8. ADR r4, hello
  9. ADR r3, alpha
  10. ADR r2, key
  11. loop
  12.  
  13. LDRB r0, [r4], #1
  14. STRB r0, [r4], #1
  15. CMP r0, #0
  16. BNE check
  17. SWI_Exit 0x11
  18. check
  19. LDRB r1, [r3], #1
  20. STRB r1, [r3], #1
  21. CMP r0, r1
  22. BNE encrypt
  23. B loop
  24. encrypt
  25. LDRB r5, [r2], #1
  26. STRB r5,[r2], #1
  27. MOV r0, r5
  28. STRB r0,[r4], #1
  29. SWINE SWI_WriteC
  30. BEQ endP
  31. B loop
  32.  
  33. hello DCB "THIS MESSEGE IS GOING TO BE ENCRYPTED ",0
  34. alpha DCB "ABCDEFGHIJKLMNOPQRSTUVWXYZ",0
  35. key DCB "XZYCJBTEKMGHONPEDCBAVWQLRU",0
  36.  
  37.  
  38. endP
  39.  
  40. MOV pc, lr ; return
  41. END
Last edited by j_cart007; May 7th, 2009 at 6:13 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
j_cart007 is offline Offline
17 posts
since May 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: New to Win32 ASM programming
Next Thread in Assembly Forum Timeline: Division in Assembly?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC