flat assembler
Message board for the users of flat assembler.
Index
> Main > Anonymous labels not enough, need anonymous OPCODES Goto page Previous 1, 2, 3, 4 |
Author |
|
macomics 13 Nov 2022, 03:03
You're 15 years late with the answer!
|
|||
13 Nov 2022, 03:03 |
|
revolution 13 Nov 2022, 05:43
xRagDiscretePulsar wrote:
|
|||
13 Nov 2022, 05:43 |
|
xRagDiscretePulsar 14 Nov 2022, 13:38
revolution wrote: Just to be clear, they aren't needed, there are alternative methods with named labels. You can choose to use them if you want to, but you don't need to use them if you don't want to. I wanted to say, but didn't say the most important thing in all of this, that anonymous labels allow you to reserve the names for more significant labels. |
|||
14 Nov 2022, 13:38 |
|
revolution 14 Nov 2022, 13:45
xRagDiscretePulsar wrote: I wanted to say, but didn't say the most important thing in all of this, that anonymous labels allow you to reserve the names for more significant labels. Code: jmp .string_skip_1 someStr db "Hello World!",0h .string_skip_1: |
|||
14 Nov 2022, 13:45 |
|
xRagDiscretePulsar 14 Nov 2022, 17:44
revolution wrote: Label names are not limited. There really isn't any need to be frugal with them. You can use any random name without restriction. The problem with labels is that I would like to always call them by the same name: lpostr, lpistr, lpon, lpin, lphandle, lpostruct, lpistruct. It's just a magazine for a call. If you name them that by increment, then after removing the previous label, it will no longer be: label1, label2, label3, but: label1, label3. And I'm lazy after that to reorder their numbers. Here is what i use: Code: ;... c0 equ db 0E8h, 0, 0, 0, 0 j equ db 0EBh, ;... c0 ; push the address of the instruction jmp j 36-5 ; the columns indexed by notepad.exe db "C:\Windows\sysWOW64\ws2_32.dll",0h pop edx add edx,2 ; skip the instruction jmp p edx ; address of the string m ebx, LoadLibraryA c ebx Optimization is the second thing edit 02 Jun 2023: Hello, it's me again: Code: db 0E8h, 0h, 0h, 0h, 0h pop ebx ; save this memory position at ebx. Instruction size = 1 byte db 0EBh, 08h ; skip 8 bytes. Instruction size = 2 bytes. dd 61h ; data of 4 bytes dd 62h ; data of 4 bytes ; after skip push dword ptr ds:[ebx+3] ; 61h push dword ptr ds:[ebx+3+4] ; 62h call func Last edited by xRagDiscretePulsar on 02 Jun 2023, 06:41; edited 23 times in total |
|||
14 Nov 2022, 17:44 |
|
Overclick 14 Nov 2022, 19:11
No problem to do all that things by macros.
Numerated shifting for example Code: macro @@@ t& { local anonymous @F1=$ @B5 equ @B4 @B4 equ @B3 @B3 equ @B2 @B2 equ @B1 @B1 equ @F1 @F1 equ @F2 @F2 equ @F3 @F3 equ @F4 @F4 equ @F5 @F5 equ anonymous match =: arg,t \{ arg \} } |
|||
14 Nov 2022, 19:11 |
|
revolution 14 Nov 2022, 22:28
xRagDiscretePulsar wrote: And I'm lazy after that to reorder their numbers. The point was you can choose to do labelling in any way you please. But there is no need or requirement to use anonymous labels. It is purely your choice. It also works the other way. There is no need or requirement to use named labels. You could probably write an entire program using anonymous labels. I've never tried, but I would guess it is possible. That might be a good challenge to see just how much can be done. |
|||
14 Nov 2022, 22:28 |
|
DimonSoft 21 Nov 2022, 14:32
Since anonymous labels are only first-before and first-after, the first if-then-else with both branches non-empty will be a headache and will probably require changing the instructions to accomodate.
|
|||
21 Nov 2022, 14:32 |
|
Goto page Previous 1, 2, 3, 4 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.