Pushing floating point numbers onto the stack -- Practical subroutines for MCS-51 microcontrollers

Publisher:开国古泉Latest update time:2015-02-04 Source: laogu Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Label: FPUS Function: Push floating point numbers onto the stack

Entry condition: Operand is in [R0].
Exit information: Operand is pushed to the top of the stack.
Affected resources: A, R2, R3 Stack requirement: 5 bytes
FPUS: POP ACC ; Save the return address in R2R3
MOV R2,A
POP ACC
MOV R3,A
MOV A,@R0 ; Push the operand into the stack
PUSH ACC
INC R0
MOV A,@R0
PUSH ACC
INC R0 MOV
A,@R0
PUSH ACC
DEC R0
DEC R0
MOV A,R3 ; Push the return address into the stack
PUSH ACC
MOV A,R2
PUSH ACC
RET ; Return to main program

Reference address:Pushing floating point numbers onto the stack -- Practical subroutines for MCS-51 microcontrollers

Previous article:Floating point number pop--MCS-51 single chip microcomputer practical subroutine
Next article:Floating point number transmission--MCS-51 single chip microcomputer practical subroutine

Recommended ReadingLatest update time:2024-11-16 13:41

[Assembly Learning Notes] MCS-51 Instruction Symbol Description
Symbol Description #da ta: represents an 8-bit immediate value (da ta) in the instruction . “#” indicates that the following data is an immediate value. #da ta16: represents a 16-bit immediate value in the instruction. direct: Indicates the address of an 8-bit internal data storage unit. It can be the unit addres
[Microcontroller]
Detailed explanation of the internal clock circuit of MCS-51 single chip microcomputer
There is a high-gain inverting amplifier inside the MCS-51 microcontroller chip, whose input is the chip pin XTAL1 and whose output is the pin XTAL2. Outside the chip, a crystal oscillator and a fine-tuning capacitor are connected across XTAL1 and XTAL2 to form a stable self-excited oscillator, which is the clock circ
[Microcontroller]
Detailed explanation of the internal clock circuit of MCS-51 single chip microcomputer
An example of programming for the serial port application of MCS-51 single-chip microcomputer
1. Experimental design  Timing interrupt program, serial port P3.0, P3.1 output, use 74LS164 shift register to drive light emitting diode ; Timer 0 in mode 1, 16 bits, interrupt once every 10ms  ; 40H 10ms timing counting unit ; 41H initial value is 01101101B ; Bit address 00H=1 ; Timing mode 1 is 10MS: THX=0ECH
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号