hi !

i'm very new to assembly and learning bit by bit but unfortunately i'm asked to write a program which encrypts a string using caesar cipher encryption method and then print that encrypted text and save into the address.

i'm very hopeful that somebody will definitely solve my problem out and that will a good source for me to learn from it aswell.

thanking you guy(s) in advance.

Br.

Recommended Answers

All 2 Replies

Which part don't you understand?

commented: The part where asking for free homework on a plate doesn't result in an instant happy meal :) +30

This is my program listing it copies the 1st string into 2nd string.

CODE LISTING
************

AREA	StrCopy1, CODE
SWI_WriteC	EQU	&2
 

	ENTRY			; mark the first instruction
main	
	ADR	r1, srcstr		; pointer to first string	
                ADR	r0, dststr		; pointer to second string
	BL	strcopy		; copy the first into second
	SWI	0x11		; and exit

srcstr	DCB " This is my first (source) string",&0a,&0d,0
dststr	DCB " This is my second (destination) string",&0a,&0d,0

	ALIGN			; realign address to word boundary

strcopy
	LDRB	r2, [r1], #1	; load byte, then update address
	STRB	r2, [r0], #1	; store byte, then update address
	CMP	r2, #0		; check for zero terminator
	BNE	printout		; branch if not equal, to Printout
	

printOut
	SWINE	SWI_WriteC	; Print the content
	B	strcopy		; branch to strcopy
	MOV	pc, lr		; return
	END

*******
Now i want to modify the above code so that it encrypt the dststr using Caesar cipher method and which of course will be printed out on the screen aswell.

Thanks for ur reply and i hope it makes the point clear if not feel free to ask me.

Br.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.