In need little bit help !
What instruction equivalent in C or Higher level language ?
What
PHP Code
<?php
TEST
|
Assembly
TEST Instruction Equivalent in C ? |
|
You don't need the test instruction in higher level languages because there are better ways to write the code. It's a bitwise and operation, so you can implement that if you wish. Truly, there is no direct equivalent to my knowledge, but there are many easy ways to achieve the same result.
(Feb 24, 2017 08:40 AM)webdev77 Wrote: You don't need the test instruction in higher level languages because there are better ways to write the code. It's a bitwise and operation, so you can implement that if you wish. Truly, there is no direct equivalent to my knowledge, but there are many easy ways to achieve the same result. Thanks. Appreciate it!
Feb 24, 2017 12:25 PM
(This post was last modified: Feb 24, 2017 12:33 PM by Masm4ever.)
Code include \masm32\include\masm32rt.incOutput: Code test 4 succeededNow the same in C: Code #include <stdio.h>Some stupid brackets more but otherwise pretty much the same. P.S.: If you prefer "pure" assembler, you can use test ebx, 4: Code test ebx, 4(Feb 24, 2017 08:32 AM)RobotCrack Wrote: In need little bit help ! You don't need to worry about that, the compiler does. C is modeled as an 'abstract machine'
Feb 25, 2017 02:43 PM
(This post was last modified: Feb 25, 2017 02:43 PM by electricalengineering.)
Test operation:
if ( !(me & you) ) //where me and you == 0 { } equivalence: test eax, eax ; where eax is 0. ;zf = 1 je ... |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [Help] by AirbourneApr 8, 2023 12:02 PM | 1 | 78 |
Apr 8, 2023 12:02 PM Last Post: luctvmgrzfsxn754 |
| [Assembly] by erig.cartmanSep 15, 2022 10:22 AM | 0 | 119 |
Sep 15, 2022 10:22 AM Last Post: erig.cartman |
| by SIM-3081018Dec 23, 2016 02:37 PM | 2 | 154 |
Dec 23, 2016 02:37 PM Last Post: SIM-3081018 |