41 lines
591 B
NASM
41 lines
591 B
NASM
|
bits 64
|
||
|
|
||
|
SECTION .data
|
||
|
; empty
|
||
|
|
||
|
SECTION .text
|
||
|
global _start
|
||
|
_start:
|
||
|
%include "header.asm.inc"
|
||
|
|
||
|
; indirect jump example #1
|
||
|
mov eax, 10
|
||
|
cmp eax, 10
|
||
|
jge a1
|
||
|
jmp a2
|
||
|
a1:
|
||
|
mov ebx, 1
|
||
|
a2:
|
||
|
nop
|
||
|
|
||
|
; indirect jump example 2
|
||
|
mov rax, -1
|
||
|
mov rcx, 1
|
||
|
shl rcx, 63
|
||
|
test rax, rcx
|
||
|
jz b1
|
||
|
mov rbx, 1
|
||
|
b1:
|
||
|
nop
|
||
|
|
||
|
; indirect jump example 3
|
||
|
; simplified version from above
|
||
|
mov rax, -1
|
||
|
test rax, rax
|
||
|
js b2
|
||
|
mov rbx, 1
|
||
|
b2:
|
||
|
nop
|
||
|
|
||
|
%include "sysexit.asm.inc"
|