Lost Password?


Go Back   CodeCall Programming Forum > Software Development > General Programming

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-06-2008, 12:52 AM
Treymac Treymac is offline
Newbie
 
Join Date: Dec 2007
Posts: 3
Rep Power: 0
Treymac is on a distinguished road
Default Help - Assembly: counting lower/upper case chars from string

Hey guys. This is my first post here.

I'm learning assembly and I'm trying to develop is one program that counts the number of lower and upper case characters that are located in STRING1, and store the result in memory. The string, STRING1, consists of lower and upper case characters. I have to read 20 bytes of the the character date stored in STRING1, and count the number of lower and upper case characters, then store them in UPPER and LOWER.

Can anybody help me out here? I have a faint idea of how to go about creating the loop, but I have no idea of how to determine if the character is lower case or upper case.
I'm programming for 80x86 Intel.

Thanks a lot.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 03-06-2008, 08:38 AM
v0id's Avatar   
v0id v0id is offline
Retired
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,635
Last Blog:
CherryPy(thon)
Rep Power: 28
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default

You can compare two values using the cmp-instruction, and then use the different jump-instructions.
Code:
# AT&T syntax

cmp $0x41, character
jl  not_uppercase
cmp $0x5A, character
jg  not_uppercase

# 'character' is lowercase...
Code:
; Intel syntax

cmp character, 0x41
jl  not_uppercase
cmp character, 0x5A
jg  not_uppercase

; 'character' is lowercase...
41 and 5A are the hexadecimal-values for 'A' and 'Z' respectively.
__________________
05-03-2007 - 11-13-2008
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Assembly Tutorials Jordan General Programming 39 10-05-2008 05:40 PM
Tutorial - Smarterchild copy travy92 VB Tutorials 19 09-25-2008 07:05 PM
SecurityAudit vinay Visual Basic Programming 27 01-07-2008 01:14 PM
need help in counting a specify character in a string. lichy Perl 2 06-27-2007 11:03 PM


All times are GMT -5. The time now is 07:01 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads