assembly language does not make sence, i know many high level languages for software programing, but this is crazy. But im just getting started with this stuff, so oh well ! =D
Hey youhakim, very good tutorial. One thing, I would like to know which version of the MASM assembler you are using because I only found masm32 and cannot get it to assemble the code you provided to a BIN image. Thanks in advance.
Hello youhakim, I have another question because I programming in C++/Pascal and don't know good assembler can I develope .bin file in another language(not Assembler)? I want to program luncher in .bin programm what load all drivers cdrom/etc and ram drive/copy some files and run my own 16bit C++ .exe program after it. Thanks for reply
If you add 512 null characters after the rest of your text, doesn't the program become larger than 512 bytes? I would think that your code that prints "Hello World", plus your 512 character loop, would extend past the 512 byte boundary. Is that correct, or am I missing something. Great video! Thanks!
I didn't add 512 null characters after the rest of my text!
If you are talking about "time 512 - (dollar - double dollars ) db 0" instruction then you should know that this particular instruction adds as many null characters as needed so the program will be exactly 512 characteres.
(the program that displays "Hello world!") + (time 512 - (dollar - double dollars ) db 0) = 512 bytes.
Thanks for explaining that! It makes sense now. If you made your program 512 bytes, where would your partition table be stored? The master boot record contains the boot code and it is 512 bytes in size. But it also must contain the partition table for the drive which takes up 64 bytes of that master boot record, so if you made your boot code 512 bytes long, it would over-write your partition table, wouldn't it? The boot code should only be no more than 446 bytes in size.
Yes you are right, the structure of a real MBR program must hold the table of primary partitions, but again I wasn't programming a real MBR program as I wrote on one of the comments above.
A real MBR program total size is 512 = 446 + 64 + 2.
Youhakim I have one question for you. Why you didn`t use a magic number in your boot sector program. I mean the the "aa55h" numbers. Some time ago i made my own boot sector and I had to add this numbers at the end of file.
Well, a real master boot record program must have a signature wich happens to be the value often represented as "0xAA55". This value must be in the last two bytes of the 512 bytes -the size of a MBR -(the two bytes than are 511,512). Now I didn't use the signature otherwise called the magic number because I don't need someone to recognize the simple program I created above as a real valid master boot record! do I?
OK, now I understand. But I have to be completly sure that I understand, so I`m going to read some documentations in Internet about bootsectors and magic numbers. Thank you for help :)
OK, now I understand. But I have to be completly sure that I understand, so I`m going to read some documentations in Internet about bootsectors and magic numbers. Thank you for help :)
is 01011 = 5 in machine code?
Tutorializer100 6 months ago
@Tutorializer100 11
emptyy2 6 months ago
I am curious, do ints 0x21, 0x16, and 0x29 work under these conditions?
Goalatio 1 year ago
@Goalatio just int 0x16
int 0x21 is a dos interupt
int 0x29 i dont know this interupt
TheComputaNerd 10 months ago
@TheComputaNerd Yep, I figured it out for myself not long after I wrote that comment. Thanks for the reply though.
Goalatio 10 months ago
@Goalatio no problem XD
TheComputaNerd 10 months ago
Instead of an infinite loop you could do:
cli
hlt
That'd halt the CPU, too, but doesn't use up resources.
123asas123 2 years ago
can this program copy itself to a floppy?
erikals2 2 years ago
assembly language does not make sence, i know many high level languages for software programing, but this is crazy. But im just getting started with this stuff, so oh well ! =D
casandramar 2 years ago
FINALLY A NASM TUTORIAL!!! THANKS!!!
wasitrealy 2 years ago
No need to XOR BL because that only applies in graphics modes.
You only need to set AH and AL.
Louix94 2 years ago
Hey youhakim, very good tutorial. One thing, I would like to know which version of the MASM assembler you are using because I only found masm32 and cannot get it to assemble the code you provided to a BIN image. Thanks in advance.
carlosalbuquerque89 3 years ago
It is NASM not MASM! and the NASM 16 bits and 32 bits compilers are available on sourceforge or just use google.
youhakim 3 years ago
Oh... No wonder why it didn't work. Thanks for your help youhakim.
carlosalbuquerque89 3 years ago
Good working,
regards
Xtremcs 3 years ago
Hello youhakim, I have another question because I programming in C++/Pascal and don't know good assembler can I develope .bin file in another language(not Assembler)? I want to program luncher in .bin programm what load all drivers cdrom/etc and ram drive/copy some files and run my own 16bit C++ .exe program after it. Thanks for reply
XF0x88 3 years ago
If you add 512 null characters after the rest of your text, doesn't the program become larger than 512 bytes? I would think that your code that prints "Hello World", plus your 512 character loop, would extend past the 512 byte boundary. Is that correct, or am I missing something. Great video! Thanks!
jamie1974 3 years ago
I didn't add 512 null characters after the rest of my text!
If you are talking about "time 512 - (dollar - double dollars ) db 0" instruction then you should know that this particular instruction adds as many null characters as needed so the program will be exactly 512 characteres.
(the program that displays "Hello world!") + (time 512 - (dollar - double dollars ) db 0) = 512 bytes.
Thanks for your comment.
youhakim 3 years ago
Thanks for explaining that! It makes sense now. If you made your program 512 bytes, where would your partition table be stored? The master boot record contains the boot code and it is 512 bytes in size. But it also must contain the partition table for the drive which takes up 64 bytes of that master boot record, so if you made your boot code 512 bytes long, it would over-write your partition table, wouldn't it? The boot code should only be no more than 446 bytes in size.
jamie1974 3 years ago
Yes you are right, the structure of a real MBR program must hold the table of primary partitions, but again I wasn't programming a real MBR program as I wrote on one of the comments above.
A real MBR program total size is 512 = 446 + 64 + 2.
446 bytes for the program itself.
64 bytes for the partition table.
2 bytes for the signature.
Thank you again jamie1974 for your comment :)
youhakim 3 years ago
OK. Thanks for your help and for a very interesting and educational video!
jamie1974 3 years ago
where the fuck is ///023323abcqw//youwillneverfindit// on your system ??!!
GhostXoP 3 years ago
Give him a break you douche. He's trying the best he can.
fanboyhater 3 years ago 2
well this is a slow response, what ever it is i dont give a shit
GhostXoP 3 years ago
I like FASM's syntax better
dav231988 3 years ago
how can i get this language translated into fasm?
GhostXoP 3 years ago
I love your tutorials, but could you help teach Assembly using the NASM syntax instead of the TASM?
MichaelWoody3 3 years ago
Youhakim I have one question for you. Why you didn`t use a magic number in your boot sector program. I mean the the "aa55h" numbers. Some time ago i made my own boot sector and I had to add this numbers at the end of file.
doles2222 3 years ago 2
Well, a real master boot record program must have a signature wich happens to be the value often represented as "0xAA55". This value must be in the last two bytes of the 512 bytes -the size of a MBR -(the two bytes than are 511,512). Now I didn't use the signature otherwise called the magic number because I don't need someone to recognize the simple program I created above as a real valid master boot record! do I?
Thanks.
youhakim 3 years ago
OK, now I understand. But I have to be completly sure that I understand, so I`m going to read some documentations in Internet about bootsectors and magic numbers. Thank you for help :)
doles2222 3 years ago 2
OK, now I understand. But I have to be completly sure that I understand, so I`m going to read some documentations in Internet about bootsectors and magic numbers. Thank you for help :)
doles2222 3 years ago
thank you youhakim intresting stuff :)
rlaffi 4 years ago 2
nice...now build you own OS :)
darijo203 4 years ago
please ive been lookin for a vid like it!
GhostXoP 3 years ago
Nice video, thanks
amitig 4 years ago
This comment has received too many negative votes show
LOL. NICE ACCENT.
t0ss4h 4 years ago
Nice, I followed the entire thing and got it to work. Thank you.
SessSubs 4 years ago
Very interesting video :) Can't wait to see more!
dre361224 4 years ago