Hello
well,as brothers told me that I need to post my code.
Note that i am using assembly language
i want to write a function that converts user's entered string from
lowercase to upper case
example: user entered
k
output:OK
this is my code.it is not work,,,i am search from my book,slides and internet
>>>i change the code 4 or 5 times.
Quote:
TITLE assg4
INCLUDE Irvine32.inc
.data
OLDSTR BYTE 61 DUP(0); assume maximum string size of 60
NEWSTR BYTE 61 DUP(0)
array DWORD ArraySize DUP(?)
MSG DB 0DH,0AH, ' ENTER THE STRING :-----> : $'
MSG2 DB 0DH,0AH, ' YOUR STRING IS :-----> : $'
STR1 DB 255 DUP(?)
ONE DB ?
TWO DB ?
.code
main PROC
MOV AX,@DATA
MOV DS,AX
LEA DX,MSG
MOV AH,09H
INT 21H
LEA SI,STR1
MOV AH,01H
READ:
INT 21H
MOV BL,AL
CMP AL,0DH
JE DISPLAY
XOR AL,20H
MOV [SI],AL
INC SI
;CMP BL,0DH
JMP READ
DISPLAY:
MOV AL,'$'
MOV [SI],AL
LEA DX,MSG2
MOV AH,09H
INT 21H
LEA DX,STR1
MOV AH,09H
INT 21H
; MOV AH,4CH
; INT 21H
main ENDP
Encode PROC USES esi edi ecx
Encode ENDP
END main
|
the other function Encode as i understand it work like this
we have string called :code1 BYTE “JMARTYVWBDLQNCXGZEKIPUFOHS”
and we have other string called:code2 BYTE “abcdefghijklmnopqrstuvwxyz”
it converts the letters between two arrays using indexces.for example
if the letter is M it is in index 1 ,it will converts it to b coz it is also at index 1
if the letter is not found in code1 ,it will stay like it
This function i didn't how to write it .any hits?any helps?
and can u help me a bout the main function
i am waiting for ur reply