Jump to content

Photo

How to calculate jmps?


  • Please log in to reply
1 reply to this topic

#1 Hatschi Posted 21 November 2013 - 02:47 AM

Hatschi

    Soldier

  • Members
  • Pip
  • 12 posts

Hey

 

how can I calculate jmps in FASM.NET?

Lets say I've got something like:

 

cmp esi,13

jle test

[...]

 

test:

[...]

 

how can I write the jle so it's jumps right to test where test is just a label indicates the address where to jmp.


  • Back to top
  • Report

#2 ZenLulz Posted 21 November 2013 - 11:43 AM

ZenLulz

    Lead Developer

  • Administrators
  • 67 posts
  • LocationSwitzerland

Hello Hatschi and welcome on the board !

 

You can calculate jumps using the At Sign (@). Here is a quick sample:

fasm.AddLine("cmp esi, 13");
fasm.AddLine("je @test");
fasm.AddLine("mov eax, 0");
fasm.AddLine("@test:");
fasm.AddLine("mov eax, 1");

Cheers,

ZenLulz


ZenLulz

  • Back to top
  • Report




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users