;The semicolon is used to lead an inline documentation
;When you write your program, you could have your info at the top document block
;For Example: Your Name, Student Number, what the program is for, and what it does 

;
; See if you can figure out what this program does
;
;;; Directives
	PRESERVE8
	THUMB 
; Vector Table Mapped to Address 0 at Reset
; Linker requires __Vectors to be exported
	AREA RESET, DATA, READONLY
	EXPORT __Vectors
__Vectors 
	DCD 0x20001000 ; stack pointer value when stack is empty
	DCD Reset_Handler ; reset vector
 
	ALIGN
 
;Your Data section
;AREA DATA
	AREA MYRAM, DATA, READWRITE

	

cap
	DCB ""
sml
	DCB ""
; The program
; Linker requires Reset_Handler
	AREA MYCODE, CODE, READONLY
string1
	DCB "ARM assembly!",0
	 ENTRY
	 EXPORT Reset_Handler
Reset_Handler
;;;;;;;;;;User Code Start from the next line;;;;;;;;;;;;
 
	LDR R1, =string1
	LDR R3, =cap
	LDR R4, =sml
	MOV R0, #0
	MOV R10,#0x41 ;A
	MOV R11,#0x7A ;z
	
LOOP	
	LDRB R2, [R1] 
	CMP R2, R0
	BEQ STOP
	
	
	CMP R2, R10
	BLT SKIP
	CMP R2, R11
	BGT SKIP
	
	AND R8, R2, #0xFFFFFFDF ; CAPITAL
	ORR R9, R2, #0x00000020 ;SMALL 
	
	STRB R9 ,[R4] ;STORE THE SMALL     ... I COULDEN'T CHANGE THE ADDRESS OF THE CAPETAL STRING AND THE SECOND STRING
	STRB R8 ,[R3] ;STORE THE CAPITAL   ... SO THE CAPETAL OVERWRITE ON THE SMALL ONES, TO CHECK IF IT WORKS JUST SWITCH THE 2 STATMENTS
	
	
	ADD R3, R3,#1
	ADD R4, R4,#1
	ADD R1, R1, #1
	B LOOP

SKIP
	STRB R2 ,[R3] ;STORE THE CAPITAL
	STRB R2 ,[R4] ;STORE THE SMALL
	
	ADD R3, R3,#1
	ADD R4, R4,#1
	ADD R1, R1, #1
	B LOOP
	
	
	
	
	;LOOP1
	;LDR R6, =sml
	;ldrb R7, [R6] 
	;add R6, R6,#1
	;B LOOP1
 

STOP

	B STOP
	END