Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Assembly (http://www.programmingforums.org/forum20.html)
-   -   Assembly (http://www.programmingforums.org/showthread.php?t=2395)

samurai Feb 22nd, 2005 12:44 AM

Assembly
 
I have a prob here, hope you guys can help me out...i havent used assembly language for 4-5years now so kinda rusty...

just need a little help here...i just want to create a program on which a user will type in a word or words (string max of 80 chars) and my program will check if the user have a terminating char at the end of the word or words, for ex., if the user type in "hello world!", the terminating char is "!", if the program sees the "!", it will display a message, else a error message.


Thanks in advance...hope you guys can help me out!


happy coding!!

Dizzutch Feb 22nd, 2005 10:03 AM

where are you stuck? did you try anything at all? I'm sure once you sit down and start coding/designing it'll come back to ya.
let us know if you have specific coding questions. Unfortunately most of us don't have time to do all of ou coding for you.

samurai Feb 22nd, 2005 10:15 AM

well, i'm just refreshing my memory with regards to assembly..

just started coding some of the scripts but not really sure where to start...

%include "asm_io.inc"

.data
prompt1 db "Enter string (max of 80 characters): ", $
prompt2 db "Do you want to continue (y/n)? ", $
error1 db "Error: Null input, please try again ",$
error2 db "Error: No string terminator, please try again ",$

.code

just that one

thanks

samurai Feb 22nd, 2005 11:50 AM

i made the rountine or the functions in javascript i just dont know how to do it in assembly..

%include "asm_io.inc"

.data
prompt1 db "Enter string (max of 80 characters): ", $
prompt2 db "Do you want to continue (y/n)? ", $
error1 db "Error: Null input, please try again ",$
error2 db "Error: No string terminator, please try again ",$

.code
if (string == ""){
message "Error: Null input, please try again ", $}
else{
if (string.length > 80) {
message "You have exceeded the maximum length, please try again ",$}
else {
for (i = 0; i < string.length; i++)
if ((string.charAt(i)) != "!") {
if ((string.charAt(i)) != "?") {
intCount = intCount + 1;
elseif (string.length == intCount){
message "Error: No string terminator, please try again ", $
}
else
message "string"}
else
message (palindrome)}
}
}

Thanks in advance...hope somebody can help me out... :confused:

Christian_Rosenkreuz_777 Feb 22nd, 2005 7:10 PM

assembler?
 
What assembler are you using? I can help with TASM, DEBUG.EXE, or NASM but I know jack about GNU


All times are GMT -5. The time now is 2:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC