about summary refs log tree commit diff stats
path: root/themes/batman
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-05 20:58:19 +0000
committerJames Booth <boothj5@gmail.com>2014-01-05 20:58:19 +0000
commitda03617e8becf41242495f7b1ce2ecbd9d1667ca (patch)
tree6afdd2aa8b6fc3929df9af8bd40114222967194e /themes/batman
parent87cdbe015a8dfe20067b2933322a7c9ca17745f2 (diff)
downloadprofani-tty-da03617e8becf41242495f7b1ce2ecbd9d1667ca.tar.gz
Moved handle_login_account_success to server_events
Diffstat (limited to 'themes/batman')
0 files changed, 0 insertions, 0 deletions
32' href='#n32'>32 33 34 35 36 37 38
39

                                  



























                                                        







                               
 
# Some slow but convenient helpers

# slow, iterative shift-left instruction
# preconditions: _nr >= 0, _dr > 0
fn repeated-shift-left nr: int, dr: int -> _/eax: int {
  var result/eax: int <- copy nr
  {
    compare dr, 0
    break-if-<=
    result <- shift-left 1
    decrement dr
    loop
  }
  return result
}

# slow, iterative shift-right instruction
# preconditions: _nr >= 0, _dr > 0
fn repeated-shift-right nr: int, dr: int -> _/eax: int {
  var result/eax: int <- copy nr
  {
    compare dr, 0
    break-if-<=
    result <- shift-right 1
    decrement dr
    loop
  }
  return result
}

fn abs n: int -> _/eax: int {
  var result/eax: int <- copy n
  {
    compare n, 0
    break-if->=
    result <- negate
  }
  return result
}