-
Speed Optimization
چهارشنبه 10 دیماه سال 1404 02:31
Speed Optimization (Michael Kunstelj / Lorenzo Micheletto) PIPELINING IN INTEL PROCESSORS The 386 is a ''partially pipelined'' processor with some optimizations. It checks for jumps ( A check) in a quite slow way and most of times can execute every stage in one cycle. It cannot perform the address generation check (B...
-
Speed Optimization -Introduction
چهارشنبه 10 دیماه سال 1404 02:30
Speed Optimization -Introduction- (Michael Kunstelj / Lorenzo Micheletto) (Note from Betov: I include this paper without the Authors agreement, because I have not been able to get in touch with them. Betov@free.fr) Brief intro about how a CPU works Now a brief intro on the innards Intel CPUs. Most processors these...
-
Low Level Assembly vs High Level Assembly
چهارشنبه 10 دیماه سال 1404 02:29
Low Level Assembly vs High Level Assembly .. For many older programmers, like me, 'true' assembly is Low Level Assembly, this is to say Assembly written in a style that does not make any use of advanced organizations like Procedures, If and friends, While, and so on. You can see bright examples of this style with all...
-
The Code scope
چهارشنبه 10 دیماه سال 1404 02:29
The Code scope ... Code scope is what I call the distance evaluation between two different locations of Code. Not only the physical distance, at a Code Octets quantity point of view, but also at a human logical point of view. This concept is of major importance for Source organization, but it is never discussed,...
-
The Spaghetti Style
چهارشنبه 10 دیماه سال 1404 02:27
The Spaghetti Style .. This nomenclature refers to Sources performing wild jmps, backward and forward, every now and then, by authors who want to promote the structured programming style. It is always introduced as something you should never do. Completely avoiding this style may be a good recommendation to beginners,...
-
Readability
چهارشنبه 10 دیماه سال 1404 02:27
Readability .. Let us first look at two different versions of the same Routine: Version 1: ShowEquate: mov ebx, eax mov edi ShwEquHexa L0: cmp esi edx jb L1> movsb jmp L0< L1: mov eax ' =' stosd mov eax ' ' mov ecx 3 rep stosd push edi std mov ecx, 9 L1: If ecx e 5 cmp ecx 5 jne L2> mov al '_' stosb L2: cmp...
-
Forcing the Disassembler Flags
چهارشنبه 10 دیماه سال 1404 02:26
Forcing the Disassembler Flags . After the Disassembler has produced a Source, you may find some wrong Interpretations, that are, most often, failure cases of the Automatic Recognitions of what is Code and of what is Data. The RosAsm Disassembler offers a bit of interactivity, through the Forced Map File, that is...
-
Code_Viewer
چهارشنبه 10 دیماه سال 1404 02:26
Code_Viewer .... With the Disassembler implementation, I have added a little tool from the [Tools] Menu option, for viewing at once the results of the Assembler Encoder and of the Disassembly Job. This has revealved itself to be a useful tool for myself in order to verify both coding and decoding integrity. As the...
-
Forcing the Disassembler Flags
چهارشنبه 10 دیماه سال 1404 02:25
RosAsm Disassembler Disassembling Code_Viewer Disassembler_Flags
-
Code_Viewer
چهارشنبه 10 دیماه سال 1404 02:25
Code_Viewer .... With the Disassembler implementation, I have added a little tool from the [Tools] Menu option, for viewing at once the results of the Assembler Encoder and of the Disassembly Job. This has revealved itself to be a useful tool for myself in order to verify both coding and decoding integrity. As the...
-
Using the Disassembler
چهارشنبه 10 دیماه سال 1404 02:23
Using the Disassembler ... When you [Open] a PE without a Source Code inside or not written with RosAsm, RosAsm offers to Disassemble it. The proposed options are: Normal Disassembly. This is the default, for the Source building, that is a simple Assembly Source. All Data and Code Labels are in the form of, for...
-
Debugger
چهارشنبه 10 دیماه سال 1404 02:23
Debugger (Ludwig Hähne) . Introduction RosAsm comes with an integrated debugger which is built on top of the Win32 Debug API. When you Run / F5 your application (the debuggee) from inside RosAsm, it is automatically debugged. If you try to run a DLL, the debugger asks for a host process, which is expected to load the...
-
EntryPoint
چهارشنبه 10 دیماه سال 1404 02:22
EntryPoint . The default EntryPoint of any RosAsm Source is: Main: In case there would be some incompatibility (we have seen the occurency of a DLL that had to have to export a 'Main' Function...), you can redefine the EntryPoint with: PREPARSE EntryPoint TheNewName See Pre_Parser_concept, for PREPARSE rigid syntax,...
-
IncIncluder_Parser
چهارشنبه 10 دیماه سال 1404 02:22
IncIncluder_Parser . To enable it, you have to write: PREPARSE IncIncluder See Pre_Parser_concept, for PREPARSE rigid syntax. In most other Assemblers, when modifying a .inc Source File, that is ''include''ed in several Applications Sources, you may update all of these Applications at once. The ''IncIncluder''...
-
Includer_Parser
چهارشنبه 10 دیماه سال 1404 02:21
Includer_Parser (Author: Kenny) .. To enable it, you have to write: PREPARSE BinIncluder See Pre_Parser_concept, for PREPARSE rigid syntax. The ''Includer'' Pre-Parser's purpose is to include directly a File (any kind of File) directly into the .Data section of your PE. Syntax. PREPARSE BinIncluder [BinInclude...
-
Equal_Parser
چهارشنبه 10 دیماه سال 1404 02:21
Equal_Parser (Author: Scarmatil) .. To enable it, you have to write: PREPARSE Equal See Pre_Parser_concept, for PREPARSE rigid syntax. The ''Equal'' Pre-Parser's purpose is to imitate the HLL writing Style (non-Assembly syntax). ''Equal'' is, in fact, not one, but two different Pre-Parsers: The Statements Equal...
-
Alternates_Syntaxes
چهارشنبه 10 دیماه سال 1404 02:20
Alternates_Syntaxes ... Beginners, DO NOT READ THIS. The RosAsm syntax is clean, clear and simple. There is absolutely no reason for wishing to use another one. But older programmers are inclined by human natures habit to do things in some ways and they hate to have to change, even from bad to good. So, I have...
-
Pre-Parsers concept
چهارشنبه 10 دیماه سال 1404 02:19
Pre-Parsers concept ... RosAsm being a 'True Assembler', means that it does not include any internal hidden Macros that would enhance the basics of Assembly Syntax, and that all HLL features are to be implemented via user defined Macros. You are not constrained in any way, other than the microprocessor's instruction...
-
XMM
چهارشنبه 10 دیماه سال 1404 02:19
XMM .. Most XMM instructions apply on Packed Data which are 128 bits long. This is to say, in practice, packets of 2 qWords, or 4 dWords, or 8 Words, or 16 Bytes. For Memory pointing to this kind of Data, the standard keyword is 'OctoWord'. What is implemented, in RosAsm as, for example: addpd XMM0 O§MyOctoWord As 'O'...
-
MMX instructions
چهارشنبه 10 دیماه سال 1404 02:18
MMX instructions .... MMX registers are noted: MM0, MM1, ..., MM7 MMX registers and memory operands are always 64 bits long (8 bytes) but can operate on 1 Qword, 2 Dwords, 4 Words or 8 bytes. When you find in the documentation: PADD (Add with wrap-around) for example, this instruction has actually 3 forms, one for...
-
MMX and XMM
چهارشنبه 10 دیماه سال 1404 02:17
MMX and XMM ... All throughout its history, the x86 Processor family has been featured with new Instructions. Nowadays, the set is more than 300 instructions long (not counting the variants and forms), but, if you take a look at any real Application, whatever Language, whatever size, you will see that it makes real...
-
FPU instructions
چهارشنبه 10 دیماه سال 1404 02:17
FPU instructions ... Real numbers declarations examples: [Real1: R§ 65478 Real2: 0.628 Real3: 0.11123E-12] 'R$' size definition is nothing but Qword. It allows you to declare '55478' as an integer stored real (instead of more procedural syntax like: '65478.0' or 'Q$ r65478', for example)....
-
ParaMacros
چهارشنبه 10 دیماه سال 1404 02:16
ParaMacros .. Macros used as Parameters Normal Macros can not be used as Instructions' Parameters, but an extended feature is available when you want more evoluted formulations of your Instructions' Parameters: With the use of the '{' and '}' Characters, you may write things like:...
-
Macros Examples
چهارشنبه 10 دیماه سال 1404 02:15
Macros Examples . Mutli Mov [mov | mov #1 #2] mov eax 1, ebx 2, ecx 3 Unfolded: mov eax 1 | mov ebx 2 | mov ecx 3 MemToMem Move [move | push #2 | pop #1 | #+1] move D§Variable1 D§Variable2 Unfolded: push D§Variable2 | pop D§Variable1 Mem Exchange [push #1 | push #2 | pop #1 | pop #2 | #+1] Exchange D§Variable1...
-
Conditional Macros
چهارشنبه 10 دیماه سال 1404 02:15
Conditional Macros . The #If Keywords All Conditional Statements begin with a '#' Char: #If.... ; Do this #Else_If.... ; Do that #Else ; Do in other cases #End_If These '#If' Statements can be nested, and the cases of unpairings raise an error Message. The Conditions You can test the Macros Evocations Parameters, on...
-
Internal Counters
چهارشنبه 10 دیماه سال 1404 02:14
Internal Counters . The Macro Parser manages 100 internal dWords Counters, that have been implemented at the same time as the Conditional Macros parser. Like the Internal Strings (&0 and &1 to &99), the Internal Counters are from &&0 to &&99. Storing ... | &&1=25 |... Notice that,...
-
Internal Strings
چهارشنبه 10 دیماه سال 1404 02:13
Internal Strings . The Macro Parser manages 100 internal Data storages (128 bytes each) where you can store what you want, under a text form, with, for example: [MacroName1 | ... | &3=Some#1 | ...] If MacroName1 is invoked with: MacroName1 Where ... The Macro parser will store 'SomeWhere' in 'internal_Data_3. If...
-
Inside Macros
چهارشنبه 10 دیماه سال 1404 02:13
Inside Macros . Local Labels inside Macros In many cases, you will find the need of declaring Local Labels inside your Macros Declarations. This may be a problem if you do not take care of choosing non-conflicting Local Labels Characters. I recommend that you reserve 'L' (L1,.... L9) for usual code Local locations...
-
The Macros Basics
چهارشنبه 10 دیماه سال 1404 02:12
The Macros Basics . Redefining the Mnemonics As there is no concept of ''Reversed Words'', in RosAsm, one great feature of RosAsm is that you can redefine mnemonics just like any common macro symbolic: [push | push #1 | #+1] ; macro declaration push eax, ebx, ecx ; macro evocation >>> push eax | push ebx |...
-
Macros Keys
چهارشنبه 10 دیماه سال 1404 02:12
Macros Keys .. The macro keys are: (# stands for 'parameter number') #1 means 'moveable first parameter' (1 to 9, but 9 is not true last limit). #F means 'fixed first parameter'. #L means 'fixed last parameter'. #N means 'parameters Number'. #+1 means 'loop from start and add 1 to all parameters numbers' (not to F nor...