View Single Post
Old May 19th, 2006, 1:20 PM   #24
Narue
Professional Programmer
 
Narue's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 Narue is on a distinguished road
jnz relies on test to set the flags properly for the loop. dec also modifies flags, so if you move dec after test, jnz uses the result of dec as the loop condition. The reason it doesn't print anything is because save is initialized to DOS string terminators (the '$' character). When DI is 1, it's decremented to 0 and jnz is false, so the loop ends before filling in the first character of save. Since the first character is still '$', it's technically an empty string.
__________________
Even if the voices aren't real, they have some pretty good ideas.
Narue is offline   Reply With Quote