somebody good in assemble please help
-
- Member
- Posts: 50
- Joined: Sat Mar 21, 2009 9:42 pm
somebody good in assemble please help
first this is not homework.
I need help writing a program in nasm assemble that opens a file with fopen not open
and reads the entire contents into a buffer then closes the file.
i know its not directly related to os dev but i am only moderate in ASM and no good with pointers and buffers.
I need help writing a program in nasm assemble that opens a file with fopen not open
and reads the entire contents into a buffer then closes the file.
i know its not directly related to os dev but i am only moderate in ASM and no good with pointers and buffers.
Re: somebody good in assemble please help
Why don't you just write it in C and look at the compiler output?
-
- Member
- Posts: 50
- Joined: Sat Mar 21, 2009 9:42 pm
Re: somebody good in assemble please help
because turbo C++ outputs tasm code
but my operating system only works properly on nasm code
but my operating system only works properly on nasm code
Re: somebody good in assemble please help
But if you just want to see how it goes, what difference does it make? You could just as easily use your native GCC (read the docs for the Intel output format for AS, I don't remember it off the top of my head).
-
- Member
- Posts: 50
- Joined: Sat Mar 21, 2009 9:42 pm
Re: somebody good in assemble please help
GCC outputed code is a 32bit mess,Hangin10 wrote:But if you just want to see how it goes, what difference does it make? You could just as easily use your native GCC (read the docs for the Intel output format for AS, I don't remember it off the top of my head).
it needs to be real mode code and cleanly written too.
my OS is VERY unstable if it doesnt like your code it freezes
-
- Member
- Posts: 50
- Joined: Sat Mar 21, 2009 9:42 pm
Re: somebody good in assemble please help
the main problem is the strings
-
- Member
- Posts: 153
- Joined: Sun Jan 07, 2007 9:40 am
- Contact:
Re: somebody good in assemble please help
so convert it to nasm. Whats the problem? TASM is easy enough to convert to nasm. theyre both intel syntax. bcc(32) -s myfile.cppsmeezekitty wrote:because turbo C++ outputs tasm code
but my operating system only works properly on nasm code
-
- Member
- Posts: 50
- Joined: Sat Mar 21, 2009 9:42 pm
Re: somebody good in assemble please help
i now got it my self but got assemble errors
and BTW it only took 85 instructions]
the error is Invalid effective address on this line:
and BTW it only took 85 instructions]
the error is Invalid effective address on this line:
Code: Select all
mov di,42
data:
mov ah,0x0E
mov al,[bp-di] ;Error
mov bl,0x0F
int 0x10
dec di
cmp di,0
jle stoploop
cmp 0,[bp-di]
jne data
stoploop:
-
- Member
- Posts: 153
- Joined: Sun Jan 07, 2007 9:40 am
- Contact:
Re: somebody good in assemble please help
this is a compilation problem, not a run time problem, which means you dont have a basic understanding of your tools and this is not the place to learn it (unless some other members are more gracious that I am...if they are more gracious and answer your question then theyre wasting my time as much as you are.)
-
- Member
- Posts: 50
- Joined: Sat Mar 21, 2009 9:42 pm
Re: somebody good in assemble please help
i am used to TASM syntax and this is NASM syntax,tantrikwizard wrote:this is a compilation problem, not a run time problem, which means you dont have a basic understanding of your tools and this is not the place to learn it (unless some other members are more gracious that I am...if they are more gracious and answer your question then theyre wasting my time as much as you are.)
if this were tasm that line would assemble.
but only nasm can make kernel calls.
Re: somebody good in assemble please help
Hi,
I am locking this thread because from the last 2 posts (that I have deleted), it was going to become a flame war.
@smeezekitty: You will find that on specific points you will often get very good help on these forums. However, if it looks like you do not know how to use a toolchain, you'll get the kind of response you saw. OSDev is pretty complicated and a good understanding of the toolchain is essential.
Before continuing, please do some good background reading on your toolchain, along with NASM and TASM differences. You may find some help on our wiki, it may be worth Googling for some manuals / tutorials.
After doing this, if you are stuck on a specific point, please come back and ask and I think you should get some helpful answers.
Cheers,
Adam
I am locking this thread because from the last 2 posts (that I have deleted), it was going to become a flame war.
@smeezekitty: You will find that on specific points you will often get very good help on these forums. However, if it looks like you do not know how to use a toolchain, you'll get the kind of response you saw. OSDev is pretty complicated and a good understanding of the toolchain is essential.
Before continuing, please do some good background reading on your toolchain, along with NASM and TASM differences. You may find some help on our wiki, it may be worth Googling for some manuals / tutorials.
After doing this, if you are stuck on a specific point, please come back and ask and I think you should get some helpful answers.
Cheers,
Adam