NASM -> GNU ASM
NASM -> GNU ASM
I need translate this code from nasm to gnu asm :
_isr0:
cli
push byte 0
push byte 0
jmp isr_common_stub
SECTION .bss
resb 8192 ; This reserves 8KBytes of memory here
_sys_stack:
_isr0:
cli
push byte 0
push byte 0
jmp isr_common_stub
SECTION .bss
resb 8192 ; This reserves 8KBytes of memory here
_sys_stack:
Re:NASM -> GNU ASM
Try googling for it -> first two hits...
Re:NASM -> GNU ASM
Lesson number 1:
Posted reams of code and saying "What's wrong?" with no description of why you think it's wrong will get no help.
Posted reams of code and saying "What's wrong?" with no description of why you think it's wrong will get no help.
Re:NASM -> GNU ASM
For this particular piece of code:yanix wrote: I need translate this code from nasm to gnu asm :
_isr0:
cli
push byte 0
push byte 0
jmp isr_common_stub
SECTION .bss
resb 8192 ; This reserves 8KBytes of memory here
_sys_stack:
Code: Select all
.global _isr0
_isr0:
cli
push $0
push $0
jmp isr_common_stub
.lcomm Stack, 8192
Code: Select all
mov $(Stack + 8192), %esp
Re:NASM -> GNU ASM
Meta-hint: assemble with NASM, disassemble with objdump.yanix wrote: I need translate this code from nasm to gnu asm...
Every good solution is obvious once you've found it.
Re:NASM -> GNU ASM
intel2gas has proven to be a useful tool. However hardcore nerders do it Solar's way
Re:NASM -> GNU ASM
>> Meta-hint: assemble with NASM, disassemble with objdump.
It is a real Meta-hint
>> intel2gas has proven to be a useful tool.
Yes , of course . But you must correct generated code .
I compiled bkerndev project under Fedora 3 (gcc 3.4.2 + gnu asm 2.15 + nasm 0.98)
This is NASM zip-version bkerndev source project
This is GNU ASM zip-version bkerndev source project
Both kernels works under GRUB
It is a real Meta-hint
>> intel2gas has proven to be a useful tool.
Yes , of course . But you must correct generated code .
I compiled bkerndev project under Fedora 3 (gcc 3.4.2 + gnu asm 2.15 + nasm 0.98)
This is NASM zip-version bkerndev source project
This is GNU ASM zip-version bkerndev source project
Both kernels works under GRUB
Re:NASM -> GNU ASM
GNU AS uses the AT&T syntax, which is very different from the Intel syntax. However, converting is pretty simple.
!Off-topic: I wonder who invented the AT&T syntax? Although I much prefer Intel syntax since that's the one I learned originally, I think if I had started with AT&T syntax I probably would have learned a lot more easier. To me,
makes more sense than
as it is closer to the English syntax, like "Move FROM to TO."
!Off-topic: I wonder who invented the AT&T syntax? Although I much prefer Intel syntax since that's the one I learned originally, I think if I had started with AT&T syntax I probably would have learned a lot more easier. To me,
Code: Select all
MOV FROM, TO
Code: Select all
MOV TO, FROM
Re:NASM -> GNU ASM
AT&T of course.NotTheCHEAT wrote: !Off-topic: I wonder who invented the AT&T syntax?
at least, quite probable
Re:NASM -> GNU ASM
Hi,
you can use intel synatx in Gnu assembler by using this directive
.intel_syntax
this switch to intel mode, while
.att_syntax
switches back to the AT&T
you can use intel synatx in Gnu assembler by using this directive
.intel_syntax
this switch to intel mode, while
.att_syntax
switches back to the AT&T
Re:NASM -> GNU ASM
AT&T is "native", or "near-native" syntax for many CPU families, including the 680x0 which was the CPU in many SUN Unix workstations. Quite naturally, that is how AT&T wrote its Unix - the Intel CPUs didn't play big in the Unix sector for a long time.
Since the GCC toolchain comes from the Unix world, it's quite natural they stuck to one general syntax to keep interfacing of GCC and GAS simple.
The question is, who the f*** came up with that brain-dead Intel syntax, and what have they been smoking?
Since the GCC toolchain comes from the Unix world, it's quite natural they stuck to one general syntax to keep interfacing of GCC and GAS simple.
The question is, who the f*** came up with that brain-dead Intel syntax, and what have they been smoking?
Every good solution is obvious once you've found it.
Re:NASM -> GNU ASM
As far as I'm concerned, they've just been breathing fresh, pure, 21% oxygen 79% nitrogen air. What those guys at AT&T have been breathing is my question.Solar wrote: The question is, who the f*** came up with that brain-dead Intel syntax, and what have they been smoking?
Re:NASM -> GNU ASM
Just in case anyone takes you seriously, I'll adjust your quote slightly
Intel is "native", or "near-native" syntax for many Intel CPU families, including the x86 which was the CPU family in many home PCs
Intel is "native", or "near-native" syntax for many Intel CPU families, including the x86 which was the CPU family in many home PCs