please can anyone help me with this homework i do not know what to do. thank you
Write a program that will count from any user-inputted number to 0. For example, if the user inputs 5, the program should output: 5, 4, 3, 2, 1, 0.
Do you actually need the comma character also?
If not, check this out:
It is fixed to take only a single digit number.
mov SI, 005Dh ; location of command-line parameter
mov cx, [SI] ; put value in CX
cmp cl, 20h ; Is the value empty?
je quit ; if so, quit
mov ch, 24h ; Put a dollar-sign (terminator) (reversed)
mov [si], cx ; Move that value and dollar sign to command-line
mov ah, 09h ; Prepare to print
mov dx, 005dh ; ...from command-line memory
int 21h ; Print it.
dec cl ; decrement value
cmp cl, 2Fh ; Is it still above zero (hex 30)?
jne print_it ; if not, print it.
int 20h ; drop to DOS (the easy way)
I couldn't find my book, so I did this from memory.