Hi all. I have a question about a project I am doing. I have tried countless things but all my program does is Capitalize the first word and nothing else. Yes this is an assignment and I do not want you all doing my homework. I just need a hint of what to do if any of you could. I forgot to say in my MakeTitle procedure I can only use one parameter. Here is the code:
INCLUDE Irvine32.inc
MakeTitle PROTO, ;MakeTitle Prototype
str_01:PTR BYTE
PrintString PROTO, ;Prototype of setting for spli
String1:PTR BYTE
.data
str_array BYTE 50 DUP(?)
prompt BYTE "Please enter a text, no longer than 50 characters. ", 0ah, 0dh, 0 ;Display message to user
msg BYTE "Your text has been changed successfully to ", 0ah, 0dh, 0;Display Message to User
.code
main PROC
mov edx, OFFSET prompt
call WriteString
mov edx, OFFSET str_array
mov ecx, SIZEOF str_array
call ReadString
INVOKE MakeTitle, ADDR str_array
INVOKE PrintString, ADDR str_array
main ENDP
;---------------------------------------------------------------
MakeTitle PROC uses eax ecx esi,
str_01:PTR byte
;
; finds next small capp
;
; Recieves: needs to take the string from the user and find
; the small capp and make it Large Capp
;
; Returns: the string in TitleCase
;
;---------------------------------------------------------------
mov eax, 0
mov esi, str_01
mov ecx, 50
mov al, [esi]
cmp al, 97
jl Testloop
mov al, [esi]
sub al, 32
mov [esi], al
Testloop:
mov al, [esi]
cmp al, 32
je CharTest
add esi, TYPE str_01
loop Testloop
jmp done
CharTest:
add esi, TYPE str_01
dec ecx
mov al, [esi]
cmp al, 91
jl Testloop
mov al, [esi]
mov dl, al
sub dl, 33
mov al, dl
Call writedec
call CRLF
mov [esi], eax
jmp Testloop
done:
ret
MakeTitle ENDP
;-----------------------------------------------------------
PrintString PROC USES edx, String1:PTR BYTE
; Display 2 lines for the string
;
; Recives: The String from the user
;
; Returns: nothing
;-----------------------------------------------------------
mov edx, String1
call WriteString
call Crlf
ret
PrintString ENDP
END main