LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-28-2012, 05:20 PM   #1
4four
LQ Newbie
 
Registered: Apr 2012
Posts: 22

Rep: Reputation: Disabled
IMPORTANT:plz help ,my code is there


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 enteredk
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

Last edited by 4four; 04-28-2012 at 05:27 PM.
 
Old 04-28-2012, 05:23 PM   #2
4four
LQ Newbie
 
Registered: Apr 2012
Posts: 22

Original Poster
Rep: Reputation: Disabled
when I compile the program ,it is appear some errors

.\Assg90438.asm(42) : error A2155:cannot use 16-bit register with a 32-bit address
1>..\Assg90438.asm(53) : error A2155:cannot use 16-bit register with a 32-bit address
1>..\Assg90438.asm(24) : error A2004:symbol type conflict
1>Project : error PRJ0019: A tool returned an error code from "Assembling..."
1>Build log was saved at "file://d:\Irvine\Examples\ch04\Project\Debug\BuildLog.htm"
1>Project - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========






//////////////////////////////////////

The sumbition is tomorrow...
 
Old 04-29-2012, 11:55 AM   #3
4four
LQ Newbie
 
Registered: Apr 2012
Posts: 22

Original Poster
Rep: Reputation: Disabled
???

no relpys???

i want to know the right soultion
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Chord distribution Hash table Java Source code..Plz Help..!! man s Programming 4 11-15-2010 02:31 AM
plz help in pash code meemoo2007 Programming 3 12-20-2007 05:51 PM
explain me this c code plz alaios Programming 1 06-03-2005 05:32 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration