Advanced Level     Skills: 8051, Assembly, Maths    
Author

Description

These assembler files contain various math functions for 8051 and compatible microcontrollers:

The file MATH32.A51 contains code for the following 32-bit math
functions:
  • Add a 16-bit value to the 32-bit 'accumulator'.
  • Add a 32-bit value to the 32-bit 'accumulator'.
  • Subtract a 16-bit value from the 32-bit 'accumulator'.
  • Subtract a 32-bit value from the 32-bit 'accumulator'.
  • Multiply the 32-bit 'accumulator' by a 16-bit value.
  • Divide the 32-bit 'accumulator' by a 16-bit value.


The file DIV16BY8.A51 contains code to divide a 16-bit dividend by an 8-bit divisor and produce a 16-bit quotient and an 8-bit remainder.

The file LONGDIV.A51 contains code to divide an N-byte dividend by an N-byte divisor and produce an M-byte quotient.

Tags 32bit math assemblymath div assembly32-bit div assembly16-bit multiply assembly32-bit multiply assemblymath routine assembly
  Filesize

96.92 kB

  Downloads

9937

  Rating
 

Comments

samarnath dev
19 Jun 2015: 20:11 pm
how can subtract 23hex from 78hex for 8051 by asm51 code please help me.
  
samarnath dev
19 Jun 2015: 20:13 pm
how can subtract 24hex value from 78hex value for 8051 by asm51 , so please help me.
  
ajay_bhargav
23 Jun 2015: 19:04 pm
@samarnath dev, both 0x23 and 0x78 are 8-bit values, use simple "SUBB" instruction to subtract them. Move one value in A and other in R0 or you can give direct data. Post in forum for help.
  
(Required; Min length 5)
(Required; will not be displayed)

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am