All pastes #387218 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-09 05:13 UTC
rendered paste body
INCLUDE Irvine32.inc

.data
Prompt1 BYTE "Input Text:", 0
Prompt2 BYTE "Caesar Cipher Output:", 0
UserInput BYTE 80 DUP (?)

.code
main PROC
	mov edx, OFFSET Prompt1
	call WriteString
	call crlf
	mov ecx, 79
	mov edx, OFFSET UserInput

	call ReadString
	call crlf

	mov edx, OFFSET Prompt2
	call WriteString
	call crlf

 	mov edx, OFFSET UserInput
A0:
	mov al, [edx]
        cmp al, 0
        je  A1

	.IF (al >= 'A') && (al <= 'Z')
		add al, 'a'-'A'
	.ENDIF
	.IF (al >= 'a') && ( al <= 'z')
                add al, 3
                .IF (al > 'z')
			sub al, 'z'-'a'+1
		.ENDIF
	.ENDIF
	call writeChar
	add edx, 1
        jmp A0
 A1:
        call crlf
 	exit
 main ENDP
 END main