flat assembler
Message board for the users of flat assembler.

Index > DOS > How does db 80h,0 rb 80h work?

Thread Post new topic Reply to topic

Joined: 22 Feb 2004
Posts: 12
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
Post 29 Feb 2004, 16:40
View user's profile Send private message Reply with quote

Joined: 13 Jul 2003
Posts: 46
Location: Poland
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 Smile 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 Smile
Post 01 Mar 2004, 20:10
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.