flat assembler
Message board for the users of flat assembler.
Index
> Main > Why did not using eip for loops? |
Author |
|
revolution 07 Nov 2024, 11:10
A jmp imm instruction is equivalent to add eip, imm. So EIP is already used. Indeed it is used by every instruction.
Similarly for jcc imm --> caddcc eip,imm |
|||
07 Nov 2024, 11:10 |
|
Roman 07 Nov 2024, 12:27
Add eip, imm You must write hands label address.
My profit asm command auto set address for jif. For asm command coold store many addresses (64 loops in cash l0 cpu) for many nxt. Profit not using main registers and not do push/pop In programing cycles very often operation. |
|||
07 Nov 2024, 12:27 |
|
revolution 07 Nov 2024, 12:36
Do you mean EFLAGS to hold the loop counter?
Using EIP for a loop counter seems to be impossible. |
|||
07 Nov 2024, 12:36 |
|
macomics 07 Nov 2024, 12:43
Roman wrote: Add eip, imm You must write hands label address. Roman wrote: My profit asm command auto set address for jif. Last edited by macomics on 07 Nov 2024, 12:46; edited 1 time in total |
|||
07 Nov 2024, 12:43 |
|
Roman 07 Nov 2024, 12:44
For inc owner value. If value = 20 then set if flag =1
Jif 0 jump on for until flag if=0 |
|||
07 Nov 2024, 12:44 |
|
macomics 07 Nov 2024, 12:48
Roman wrote: For inc owner value. If value = 20 then set if flag =1 Where should jif jump to if the address is unknown (the eip/rip value of the command you need) |
|||
07 Nov 2024, 12:48 |
|
macomics 07 Nov 2024, 12:51
In x86, all conditional jumps are relative anyway. You can only jmp to the absolute address
|
|||
07 Nov 2024, 12:51 |
|
Roman 07 Nov 2024, 13:06
Quote:
For get current eip address put to cash something like push eip. Jif get address from cash. if flag if=0 do jmp to for again. jif something like pop address. This work logic code, from first post. When you programing code and write only numbers (op codes and values), hard calculating many labels and offsets. Must be asm commands do this automatically. Last edited by Roman on 07 Nov 2024, 13:13; edited 1 time in total |
|||
07 Nov 2024, 13:06 |
|
macomics 07 Nov 2024, 13:12
Code: call @f @@: sub qword [rsp], 5 Some commands jcс @f retn @@: But why do this when it's easier right away Code: push 0 @@: Some commands inc dword [rsp] cmp dword [rsp], 20 jc @b pop rax Roman wrote: When you programing code and write only numbers (op codes and values), hard calculating many labels and offsets. Last edited by macomics on 07 Nov 2024, 13:18; edited 1 time in total |
|||
07 Nov 2024, 13:12 |
|
Roman 07 Nov 2024, 13:16
Some commands could corrupted flags !
And jcc failed. this write hands: jc @b and @@: Its bad variant. Let's say you created owned cpu. And you hands writing numbers for bios. You not have fasm or visual studio. You only can upload in bios numbers your code. And calculated hands for labels addresses it's not fun . |
|||
07 Nov 2024, 13:16 |
|
Roman 09 Nov 2024, 05:40
Why exist call and repnz.
But we can't do repnz call some proc ? Very usefull command. |
|||
09 Nov 2024, 05:40 |
|
macomics 09 Nov 2024, 06:23
Code: call someProc loopnz $ - 5 |
|||
09 Nov 2024, 06:23 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.