Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASSEMBLY PROGRAMMING HELP

Status
Not open for further replies.

gnb

Programmer
Sep 8, 2003
1
0
0
AU
Hi everyone,

I'm new to assembly programming and I need help on two separate things.

The first is with a small intel assembly program I'm developing. What I dont know is how to check the integer entered from the keyboard is not between 10 and 20:
What should happen is that the numeric value cannot be between 10 and 20. Can anyone please help what I'm doing wrong?

This is what i have:
MOV AX,num
CMP AX,10
JGE is_greater
CMP AX,20
JLE is_lesser
JMP finish

Is there a function in assembly programming that can test if a char character is uppercase or lowercase, or numeric??
 
Where is this variable num came from? Is it dec or hex?


Is there a function in assembly programming that can test if a char character is uppercase or lowercase, or numeric??

No, Assembly language by itself doesn't have any "Functions" to do any thing, it is the Processor's instruction set with some help from the assembler and the linker to do some tedious jobs, but there are some libraries out there made public by some kind people.
Also, some of Microsoft's C/C++ library functions is assembly and the source code will be available on your computer if you have C/C++ installed with source code option.

Walid Magd
Engwam@Hotmail.com
 
concerning low/uppercase check
in fact most hl functions just check bit 6 for this purpose.
the idea is that uppercase chars are 41h-5Ah and lowercase are 61-7ah, so typical code sequence is like

test al, 20h ;100000 binary
jz uppercase

so indeed there is no need for a special function

numbers are 30-39h, they require 2 comparisons

hope this helps
enjoy assembly!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top