flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > variant on jif from manual

Author
Thread Post new topic Reply to topic
aq83326



Joined: 25 Jun 2011
Posts: 21
aq83326 13 Jan 2012, 08:47
from the manual:
Code:
macro jif op1,cond,op2,thelabel
{
        cmp op1,op2
        j#cond thelabel
}    

I made something, call-if, rather than jump-if
Code:
macro cif op1,cond,op2,thelabel
{
        push thelabel#return
        cmp op1,op2
        j#cond thelabel
        add rsp,8
        thelabel#return:
}    
Post 13 Jan 2012, 08:47
View user's profile Send private message Visit poster's website Reply with quote
aq83326



Joined: 25 Jun 2011
Posts: 21
aq83326 19 Jan 2012, 11:19
new version, only writes to memory if needed
Code:
macro cif2 op1,cond,op2,thelabel
{
        local lab2,lab3
        cmp op1,op2
        j#cond lab2
        jmp lab3
        lab2:
                push lab3
                jmp thelabel
        lab3:
}    
Post 19 Jan 2012, 11:19
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.