Well I got a class assignment requiring the use of int 21h,0xa(string input).
The problem is the teacher is old, and doesn;t care about how right the things he teaches are and apparenlty he taught us things wrongly again -.- then it;s -15 points in the exam...
He taught us the first number we enter (followed by enter) is the size and it enters in the first byte,then we enter the string and any extra characters are thrown away, he said it automatically places an $ at the end (after I asked him if I need to add that somehow)...
But anyway it simply doesn;t work.
Sorry I just had to say that >.<;
Back to topic:
That's my string declaration:
string db 4,?,dup('$')
I copied it from someplace, I think it places in the first byte 4 which stands for the size ,at the second ?, no idea why '?' but that;s what I copied, and then the rest would b '$'s..
I dunno if I got it right but when I wanna enter something it lets me enter 3 characters...So I dun quite get how it works at all, and am confused what sits in which byte.
All I wanna do is get a string at the size of 18 and print it, that's all...
Actually the assignment asked to print the string backwards (a-z would b printed as z-a)
and print the number of times a appears and number of times 'ab' appears...
These are easy for me (the logic), I just can;t input and output the string o.o;
That';s what I wrote:
xor ax,ax lea dx,string mov ah,0xA int 21h mov ah,9h mov dx,offset string int 21h
Ok so I dun quite get how the input works and I know my output is bad as well, since it doesn;t work....
Any help would b grately appreciated.