ASSEMBLY TASM, STRING OUTPUT PROB using procedure

时间:2015-05-12 22:50:32

标签: assembly

ASSEMbLY MAStER PLEASE HELP.. IM HAVING TROUBLE IN OUTPUT, assembly masters, please help. im having trouble in output. the output should be:

eg.

DEstroit♥Me

but the output in my code is messed up>

where did i go wrong?? Please help Thanks in advance;

HERE IS MY CODE:

onClick="foo"

2 个答案:

答案 0 :(得分:0)

You need a one. b = false two. b = false instruction at the the end of each ret, for example

proc

答案 1 :(得分:0)

Adding RET is necessary, but something else is needed too. Strings captured from keyboard with Oah are ended by char 13 (enter). To display these strings you have to change the char 13 by '$', like next image:

enter image description here

After we capture the word STACK, string is finished by char(13). To know where the char(13) is, we get the length in second byte (5), increase it by 1 and use it as offset. There is char(13) and we change it by '$'. Next is your code with a new procedure "finish_strings", that does the job:

>>> def p(num):
...     for power in xrange(6):
...         for root in xrange(num/2+1):
...             if root**power==num:
...                 return root, power
...
>>> r, pwr = p(8)
>>> print 'The root is', r, 'and the power is', pwr
The root is 2 and the power is 3