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

Reply

Join Date: May 2009
Posts: 7
Reputation: j_cart007 is an unknown quantity at this point 
Solved Threads: 0
j_cart007 j_cart007 is offline Offline
Newbie Poster

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

 
0
  #1
May 7th, 2009
here is my Caesar cipher code, can u pls have a look at it and correct me if i'm wrong.

  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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Assembly Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC