Friday, 15 May 2015

assembly - Read input in NASM, and store it whole into a variable -



assembly - Read input in NASM, and store it whole into a variable -

what method can read input of user, input "500" store number in variable?

the method know store them character character perchance need of register offsets.

is there other way, preferably storing number directly?

i.e. like:

mov var1, inbuffer

details on environment: 32 bit assembly w/ dgjpp

thank you.

ahhh... djgpp, that'd dos guess. int 21h/0ah (0ah in ah). or might improve off readfile subfunction (3fh ???) on stdin. in ralf brown's interrupt list.

in case, you're going characters '5', '0', , '0' - 35h, 30h, 30h. take processing number 500 out of this. if you're reading numbers left right, 0 register utilize "result far". read character input buffer. if it's valid decimal digit, subtract '0' convert character number, multiply "result far" ten, , add together in new number. repeat until run out of characters.

variables assembly input store

No comments:

Post a Comment