Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • Blog
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX
View Categories
  • Home
  • Docs
  • Propeller 2
  • 64/96/128-Bit Unsigned Integer Math

64/96/128-Bit Unsigned Integer Math

Reading Time: < 1 min read

SPIN2

Introduction #

The Propeller 2 can use these libraries to handle 64/96/128-Bit Unsigned Integer Math!

For the latest version of the full library, visit our OBEX link in resources!

Methods #

These methods are included in 64, 96 and 128 bit versions! To download the methods, visit our OBEX link in resources!

Method nameDescription
FloatingNEGQ()negate
ADDQ()add
SUBQ()subtract
CMPQ()compare
MAGQ()magnitude
SHLQ()shift left
SHRQ()shift right
MULQ()multiply
DIVQ()divide
LOGQ()log2
EXPQ()exp2
LongLSB()extract long via LSB
LongMSB()extract long via MSB
LongSHL()left-shift long to make 64/96/128-bit value-point conversion methods

Code Snippets #

These two snippets demonstrate the add methods for 64-bit and 128-bit

PUB addq(int64 a, int64 b) : int64 r
'' 64-bit add
		org
		mov	r+0,a+0
		mov	r+1,a+1
		add	r+0,b+0	wc
		addx	r+1,b+1
		end
PUB addq(int128 a, int128 b) : int128 r
'' 128-bit add
		org
		mov	r+0,a+0
		mov	r+1,a+1
		mov	r+2,a+2
		mov	r+3,a+3
		add	r+0,b+0	wc
		addx	r+1,b+1	wc
		addx	r+2,b+2	wc
		addx	r+3,b+3
		end


Resources #

Parallax Propeller 2 - Spin2 Language Documentation

64/96/128-Bit Unsigned Integer Math

Was this useful ?
Share This Article :
  • Facebook
  • X
  • LinkedIn
Still stuck? How can we help?

Still stuck? How can we help?

Updated on March 17, 2025
Table of Contents
  • Introduction
  • Methods
  • Code Snippets
  • Resources

Copyright © 2025 - Parallax Inc.
599 Menlo Drive | Rocklin, CA 95765 | USA