Message board for the users of flat assembler.
> DOS > How does db 80h,0 rb 80h work?
Can someone explain to me how this works exactly? I've figured out how to use it for making a buffer to input text . But i don't know exactly what it means.
I know that buffer db 80h,0 means a variable named buffer it's db(bytes) and the next part means 80h length? then the ,0 what does this mean? then the rb must mean reserve byte of 80h lenth right? I've tried making it with just buffer rb 80h but when i go to type in the input it won't let me type anything in. so i take it that just reserving the 80h bytes isn't enough to actually use them. Here is snippets from my source if i lost you
mov ah,0Ah mov dx,buffer int 21h int 20h buffer db 80h,0 rb 80h,0
Thanks for the help
|29 Feb 2004, 16:40||
Let us write it as:
Buffer: db 80h, 0
rb 80h, 0
Buffer is an address in memory where you can find:
number 80h followed by number 0
and then we reserve 80h bytes (some unknown data will be put ther on programs start) and then number 0.
So you have in memory:
80h, 0, some_data, some_data, some_data, ..., some_data, 0
In the function you are using there is need to Buffer will have such structure (chec in the interrupt description).
The last 0 is only for you There is no need to use them (of course only in your part of code).
I wonder, why it is legall to put constant after rb. I don't remember that it was mentioned in manual, but... that's surely nice feature
|01 Mar 2004, 20:10||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.