Calculating padding length with GAS AT&T directives for a boot sector?
So I want to add padding in the bootsector. Let's say, there is currently just an endless loop in there: jmp . . The sector needs to be 512 bytes long. Also, the magic num 0xaa55 is needed which is added at the end. jmp . .skip 508, 0 .word 0xaa55 But what if I want to print something but don't want to count all the bytes to pad it into the right size? In Intel/NASM syntax would it be: ; print something times 510-($-$$) db 0 dw 0xaa55 But in AT&T syntax? Well a loop ( .rept ) doesn't work here because . doesn't give an absolute value which is needed here. We have the same problem with .skip /