assembly

gedit syntax highlighting for assembler files (*.asm)

六月ゝ 毕业季﹏ 提交于 2020-12-28 07:46:38
问题 By default, gedit doesn't syntax highlight .asm files. How can I add this support for this language? 回答1: The following steps should be enough. wget http://www.carminebenedetto.net/_downloads/asm-intel.lang sudo cp asm-intel.lang /usr/share/gtksourceview-3.0/language-specs/ Note that the exact folder to copy the .lang file to depends upon your version. You may have gtksourceview-2.0 instead, or even something else. On my machine I had both 2.0 and 3.0, and copied the file into each one's

64-BIT mode do not support PUSH and POP instructions [duplicate]

主宰稳场 提交于 2020-12-27 17:54:43
问题 This question already has answers here : Push and Pop on AMD64 [duplicate] (1 answer) Does each PUSH instruction push a multiple of 8 bytes on x64? (2 answers) Closed 3 years ago . NASM returns an error like: "instruction not supported in 64-bit mode" and I couldn't figure out what to do. The subject instruction is pop ecx and push ecx instructions. What can I use instead of them or is there an other way to fix this issue? 回答1: The general idea is that you normally push and pop full registers

64-BIT mode do not support PUSH and POP instructions [duplicate]

半世苍凉 提交于 2020-12-27 17:45:59
问题 This question already has answers here : Push and Pop on AMD64 [duplicate] (1 answer) Does each PUSH instruction push a multiple of 8 bytes on x64? (2 answers) Closed 3 years ago . NASM returns an error like: "instruction not supported in 64-bit mode" and I couldn't figure out what to do. The subject instruction is pop ecx and push ecx instructions. What can I use instead of them or is there an other way to fix this issue? 回答1: The general idea is that you normally push and pop full registers

64-BIT mode do not support PUSH and POP instructions [duplicate]

人走茶凉 提交于 2020-12-27 17:41:50
问题 This question already has answers here : Push and Pop on AMD64 [duplicate] (1 answer) Does each PUSH instruction push a multiple of 8 bytes on x64? (2 answers) Closed 3 years ago . NASM returns an error like: "instruction not supported in 64-bit mode" and I couldn't figure out what to do. The subject instruction is pop ecx and push ecx instructions. What can I use instead of them or is there an other way to fix this issue? 回答1: The general idea is that you normally push and pop full registers

x86-64 instruction set, AT&T syntax, confusion regarding lea and brackets

旧街凉风 提交于 2020-12-27 06:35:44
问题 I’ve been told that lea %rax, %rdx is invalid syntax as the source needs to be in brackets, i.e lea (%rax), %rdx I think I’ve clearly misunderstood both lea and the purpose of brackets. I thought that lea %rax, %rdx would move the memory address stored in %rax, to %rdx, but apparently this is what lea (%rax), %rdx does? What confuses me is that I thought brackets signify going to an address in memory, and taking the value at that address. So by using brackets lea would be moving a value from

What is the difference between “4 - 12” and “4 + (-12)”? [duplicate]

可紊 提交于 2020-12-26 12:03:20
问题 This question already has answers here : Incomprehensible behavior of the CF flag (2 answers) Why is the Carry Flag set during a subtraction when zero is the minuend? (2 answers) Assembly x86-64 setting carry flag for sub instruction (1 answer) Why does CMP (compare) sometimes sets a Carry Flag in 8086 assembly? (4 answers) Closed last month . I try to compare the next expressions: 1) mov al, 4 mov bl, 12 sub al, bl ; CF == 1 0000 0100 (4) + 1111 0100 (-12) = 1111 1000 (-8 == 248) 2) mov al,

not able to write make file

被刻印的时光 ゝ 提交于 2020-12-26 11:04:20
问题 I have made a small program in assembly language which is executing fine. I also have the commands to execute it but I don't know how to make a makefile to automate the same. The command I used is: nasm -f bin boot2.asm -o boot2.bin && qemu-system-x86_64 -fda boot2.bin How do I make a makefile for the same? 回答1: Simple version: all: build run build: boot2.bin boot2.bin: boot2.asm nasm -f bin boot2.asm -o boot2.bin run: boot2.bin qemu-system-x86_64 -fda boot2.bin clean: -rm boot2.bin 来源: https

How can i add two numbers with 12 bytes each-one?

有些话、适合烂在心里 提交于 2020-12-26 11:02:10
问题 I want to add two numbers that have 12 bytes and to store the result in a 16 bytes var. How can i do this? section .data big_num1 dd 0x11111111, 0x22222222, 0x33333333 big_num2 dd 0xffffffff, 0x22222222, 0x33333333 section .bss result_4word resd 4 I think i can add the first 4 bytes number from number 1 with the other first 4 bytes from number 2 and so on.. but i don't know how to concatenate results in in my result variable. How should i do the carry,if it's needed? Is this solution the

How can i add two numbers with 12 bytes each-one?

血红的双手。 提交于 2020-12-26 11:00:20
问题 I want to add two numbers that have 12 bytes and to store the result in a 16 bytes var. How can i do this? section .data big_num1 dd 0x11111111, 0x22222222, 0x33333333 big_num2 dd 0xffffffff, 0x22222222, 0x33333333 section .bss result_4word resd 4 I think i can add the first 4 bytes number from number 1 with the other first 4 bytes from number 2 and so on.. but i don't know how to concatenate results in in my result variable. How should i do the carry,if it's needed? Is this solution the

IDIV operation in assembly (understanding)

孤者浪人 提交于 2020-12-26 07:39:47
问题 when I have the the operation IDIV ecx in assembly, then i have read that the that the value in edx:eax is divided by the operand ecx. I also know that the quotient is stored in eax and the remainder in edx. so but what exactly is the value in edx:eax ?? Can someone explain it to me? edit: i also did not understand the reason of "cdq" operation which come always before the IDIV operation although I have read some pages about that. 回答1: i have read that the that the value in edx:eax is divided