Assembly how to check empty string?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 replies · 5K views
naja
Messages
3
Reaction score
0
I am asking user to enter a number if user hits enter key instead of entering a value then i need to exit the program. see code below

Code:
 ; i put the value into eax
 cmp AL,0 ;i compare is al reg is empty
 je exitProgram
 ; some instructions
 exitProgram:
 Invoke ExitProcess,0
 Public _start
 END
 
on Phys.org
You need to show what function you are reading a string of characters or if reading one character at at time. The function may depend on what operating system you are running on. For example for MSDOS, to get a line of input from the user, you could use

mov ah,00ah
mov dx,offset buffer
int 021h
...
 
Last edited: