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

9929

  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

JamesNip
Tue Mar 19 2024, 02:57 pm
EdwardFew
Mon Mar 18 2024, 01:14 pm
EmeryPah
Mon Mar 18 2024, 11:51 am
RobertMax
Sun Mar 17 2024, 10:22 pm
DanielJar
Fri Mar 15 2024, 06:52 pm
Tuzaimecor
Fri Mar 15 2024, 02:32 am
PromotionFoode
Thu Mar 14 2024, 08:11 pm
EdwardGeawn
Sun Mar 10 2024, 12:24 pm