1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Assembly how to check empty string?

  1. Oct 12, 2012 #1
    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 (Text):

     ; i put the value into eax
     cmp AL,0 ;i compare is al reg is empty
     je exitProgram
     ; some instructions
     Invoke ExitProcess,0
     Public _start
  2. jcsd
  3. Oct 12, 2012 #2


    User Avatar
    Homework Helper

    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: Oct 12, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook