can we use db tags for file name and details
can we use db tags for file name and details
I was wondering if their is anyone who has done or any source code that use db tags in nasm. I want to konw if we can put a search on sector range and if it finds it will load the allocated sector say each file can be 512 bytes for example. I was planing of creating my filing methods. Can you guys help me out
Re: can we use db tags for file name and details
Hello again, Patrick.
What you have to remember is that NASM is an ASSEMBLER. There are no higher-level abstractions, and each line corresponds to a string of bytes that the CPU interprets directly.
db isn't a processor instruction - it allows the programmer to insert a byte of data at the exact place. Next time, please make sure to search for information thoroughly instead of immediately asking us. Here is the NASM Manual - http://nasm.sourceforge.net/doc/nasmdoc0.html. Make sure to look at Chapter 3 which deals with how to declare data and access memory locations.
If you want to load a sector in real mode, you might want to look at int 13h here - http://www.ctyme.com/intr/int-13.htm, specifically AH=02h.
So,
What you have to remember is that NASM is an ASSEMBLER. There are no higher-level abstractions, and each line corresponds to a string of bytes that the CPU interprets directly.
db isn't a processor instruction - it allows the programmer to insert a byte of data at the exact place. Next time, please make sure to search for information thoroughly instead of immediately asking us. Here is the NASM Manual - http://nasm.sourceforge.net/doc/nasmdoc0.html. Make sure to look at Chapter 3 which deals with how to declare data and access memory locations.
If you want to load a sector in real mode, you might want to look at int 13h here - http://www.ctyme.com/intr/int-13.htm, specifically AH=02h.
So,
Code: Select all
db 0x24 ;Puts a byte with the value 0x24 at this place
dw 0xAA55 ;Puts a bootloader signature at this place (w = 2 bytes)
"Sufficiently advanced stupidity is indistinguishable from malice."