Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • Blog
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX

Propeller 1

  • How to pause in PASM
  • How to choose between VAR and DAT
  • WAITPEQ and WAITPNE with PASM
  • IO pin manipulation using PASM
  • Control IO pins from any cog
  • 3D Models for Parallax Products
  • Implementing Abstract Data Structures with Spin Objects
  • Making in USA - The Parallax 8 core microcontroller
  • Simultaneous pin group control
  • Programming the FLiP module over WiFi
  • Keep any value in range
  • Handy Diagnostic Heartbeat
  • Customer Code Deployment in one click

Propeller 2

  • Floating point operators in SPIN2
  • 64/96/128-Bit Unsigned Integer Math
  • 3D Models for Parallax Products
  • DEBUG Plot Layer and Crop
  • Floating point
  • Getting Started Video Tutorials
  • Using the counter for timeouts
  • asmclk and the automatic clock setter
  • Sharing variables between SPIN2 and PASM2
  • Keep any value in range
  • Determine pin state - High, Low or Floating?
View Categories
  • Home
  • Docs
  • Chips Tips
  • 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
Floating point operators in SPIN23D Models for Parallax Products
Table of Contents
  • Introduction
  • Methods
  • Code Snippets
  • Resources

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