How to know first instruction in GAS assembler?
Posted: Sat Sep 01, 2012 7:30 am
What I want to achieve is to calculate the length of the code segment.
In Masm Compiler, we can get it just through
But how to get it through GAS assembler?
Here's my code, but when compiling, it returns
" Error: bad or irreducible absolute expression"
In Masm Compiler, we can get it just through
Code: Select all
($-$$)
Here's my code, but when compiling, it returns
" Error: bad or irreducible absolute expression"
Code: Select all
.text
.global _start
#.code16
_start:
jmp over
os_size:
.word 0
.word 0
over:
movw $100, %ax
forever:
jmp forever
foo:
.rept . - _start
.byte 0
.endr