User Tools

Site Tools


useful_programs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
useful_programs [2019/07/31 13:22] – [Debug printing] emozolyakuseful_programs [2019/09/16 15:10] – [Bit functions] emozolyak
Line 47: Line 47:
 end  end 
    
-function outbit(condition, x, b) -- output bool conditoin as 0 /1 into a bit +function outbit(condition, x, b) -- output bool condition as 0 /1 into a bit 
      if condition then           if condition then     
          return hasbit(x, b) and x or x + bw(b)           return hasbit(x, b) and x or x + bw(b) 
Line 53: Line 53:
          return hasbit(x, b) and x - bw(b) or x           return hasbit(x, b) and x - bw(b) or x 
      end       end 
 +end 
 +
 +function outBit(condition, alias, b) -- output bool condition as 0 /1 into a bit of a internal register 
 +     local new_value = outbit(condition, R(alias), b)
 +     return new_value
 end  end 
    
useful_programs.txt · Last modified: 2024/03/19 09:39 by emozolyak

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki