Answer the question
In order to leave comments, you need to log in
How to translate a C or C++ program into a MASM/TASM assembly language program?
How to translate a C or C++ program into a MASM/TASM assembly language program?
I always get GAS syntax.
I was taught a task, I did it, but it is necessary in assembler.
Visual Studio is swinging for a long time, you need something very light (I can’t have a lot of Internet :)).
PS 1 It is not necessary to advise freelancing 2 I'll figure it out with a prog on asma.
Answer the question
In order to leave comments, you need to log in
First, what you call GAS syntax is actually called AT&T syntax. And the syntax used in MASM/TASM is Intel syntax. Secondly, what does the teacher expect from you?
.section .data
hello_str:
.ascii "Hello, world!\n"
.set hello_str_length, . - hello_str
.section .text
.global main
.type main, @function
main:
movq $4, %rax
movq $1, %rbx
movq $hello_str, %rcx
movq $hello_str_length, %rdx
int $0x80
movq $1, %rax
movq $0, %rbx
int $0x80
.size main, . - main
.file "test.c"
.section .rodata
.LC0:
.string "Hello, World!"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
leaq .LC0(%rip), %rdi
call [email protected]
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Debian 6.3.0-18) 6.3.0 20170516"
.section .note.GNU-stack,"",@progbits
I was taught a task, I did it, but it is necessary in assembler.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question