relative-addressing

NASM x86_64 assembly in 32-bit mode: Why does this instruction produce RIP-Relative Addressing code?

孤街浪徒 提交于 2020-07-29 06:59:12
问题 [bits 32] global _start section .data str_hello db "HelloWorld", 0xa str_hello_length db $-str_hello section .text _start: mov ebx, 1 ; stdout file descriptor mov ecx, str_hello ; pointer to string of characters that will be displayed mov edx, [str_hello_length] ; count outputs Relative addressing mov eax, 4 ; sys_write int 0x80 ; linux kernel system call mov ebx, 0 ; exit status zero mov eax, 1 ; sys_exit int 0x80 ; linux kernel system call The fundamental thing here is that I need to have

How can I jump relative to the PC using the gnu assembler for AVR?

烂漫一生 提交于 2019-12-19 10:21:07
问题 I have a binary file that I've disassembled using avr-objcopy. The interrupt vector table looks like: 00000000 : ; VECTOR TABLE 0: 13 c0 rjmp .+38 ; 0x28, RESET 2: b8 c1 rjmp .+880 ; 0x374, INT0 4: fd cf rjmp .-6 ; 0x0 6: fc cf rjmp .-8 ; 0x0 8: fb cf rjmp .-10 ; 0x0 a: fa cf rjmp .-12 ; 0x0 c: f9 cf rjmp .-14 ; 0x0 e: f8 cf rjmp .-16 ; 0x0 10: f7 cf rjmp .-18 ; 0x0 12: c7 c1 rjmp .+910 ; 0x3a2, TIMER1 OVF 14: f5 cf rjmp .-22 ; 0x0 16: f4 cf rjmp .-24 ; 0x0 18: f3 cf rjmp .-26 ; 0x0 1a: f2 cf

How can I jump relative to the PC using the gnu assembler for AVR?

偶尔善良 提交于 2019-12-01 11:29:15
I have a binary file that I've disassembled using avr-objcopy. The interrupt vector table looks like: 00000000 : ; VECTOR TABLE 0: 13 c0 rjmp .+38 ; 0x28, RESET 2: b8 c1 rjmp .+880 ; 0x374, INT0 4: fd cf rjmp .-6 ; 0x0 6: fc cf rjmp .-8 ; 0x0 8: fb cf rjmp .-10 ; 0x0 a: fa cf rjmp .-12 ; 0x0 c: f9 cf rjmp .-14 ; 0x0 e: f8 cf rjmp .-16 ; 0x0 10: f7 cf rjmp .-18 ; 0x0 12: c7 c1 rjmp .+910 ; 0x3a2, TIMER1 OVF 14: f5 cf rjmp .-22 ; 0x0 16: f4 cf rjmp .-24 ; 0x0 18: f3 cf rjmp .-26 ; 0x0 1a: f2 cf rjmp .-28 ; 0x0 1c: 2b c2 rjmp .+1110 ; 0x474, ADC conversion complete 1e: f0 cf rjmp .-32 ; 0x0 20: