ATT question
ATT question
Does anyone know that the equivalent of the nasm code times 510-($-$$) is under as syntax?
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: ATT question
I have no clue what you just asked there. Could you please rephrase?
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: ATT question
i need the code for as that will fill up the end of my bootsector with empty data to make it 512 bytes long
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: ATT question
I'm assuming you're making a boot record or a boot sector and you need the 55AAH signature at the end. Anyway, your code was correct, I'm not sure why you thought there was a different syntax.
Code: Select all
times 510-($-$$) db 00h
dw 0aa55h ; x86-based systems are little-endian so you have 0aa55h instead 0f 55aah
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: ATT question
yea that code works under nasm, but do you know what the equivalent is under gas? I converted my bootsector over and cant get it to work.
Re: ATT question
If you conclude your source code with
it should be working. Btw. do you know
directive? It lets you type assembler in more intel-ish style.
Code: Select all
.org 0x1fe
.word 0xaa55
Code: Select all
.intel_syntax noprefix
Re: ATT question
Code: Select all
.rept 510 - .
.byte 0x00
.endr
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: ATT question
hint : dd , db , times etc are assembler directives .
Regards
Shrek
Regards
Shrek
Re: ATT question
But not for GNU assembler in either Intel or AT&T Syntaxhint : dd , db , times etc are assembler directives .
Re: ATT question
oh wow, do you have a link with more information? i hate att syntax because of all the unnecessary symbols, but i am just using it because i plan to develop under linux with gcc and it will be easier to integrate things.lmn wrote:If you conclude your source code withit should be working. Btw. do you knowCode: Select all
.org 0x1fe .word 0xaa55
directive? It lets you type assembler in more intel-ish style.Code: Select all
.intel_syntax noprefix
Re: ATT question
I dont think that Intel-syntax is widely used with gas, as nasm or yasm support this on unix. Therefore i also have no further documents about it. Basically everything is described in the documentation of GNU as, http://sourceware.org/binutils/docs/as/index.html. Everything else is revealed by google .