NXP Forums
5
Product Forums
21
General Purpose MicrocontrollersGeneral Purpose Microcontrollers
i.MX Forumsi.MX Forums
QorIQ Processing PlatformsQorIQ Processing Platforms
Identification and SecurityIdentification and Security
Power ManagementPower Management
MCX Microcontrollers
S32G
S32K
S32V
MPC5xxx
Other NXP Products
Wireless Connectivity
S12 / MagniV Microcontrollers
Powertrain and Electrification Analog Drivers
Sensors
Vybrid Processors
Digital Signal Controllers
8-bit Microcontrollers
ColdFire/68K Microcontrollers and Processors
PowerQUICC Processors
OSBDM and TBDML
Solution Forums
3
Smart Home
Power & Energy
Mobile Robotics
Software Forums
16
MCUXpresso Software and ToolsMCUXpresso Software and Tools
CodeWarriorCodeWarrior
MQX Software SolutionsMQX Software Solutions
Model-Based Design Toolbox (MBDT)Model-Based Design Toolbox (MBDT)
FreeMASTER
eIQ Machine Learning Software
Embedded Software and Tools Clinic
S32 SDK
S32 Design Studio
Vigiles
GUI Guider
Zephyr Project
Voice Technology
Application Software Packs
Secure Provisioning SDK (SPSDK)
Processor Expert Software
Topics
8
Mobile Robotics - Drones and RoversMobile Robotics - Drones and Rovers
NXP Training ContentNXP Training Content
University ProgramsUniversity Programs
Rapid IoT
NXP Designs
SafeAssure-Community
OSS Security & Maintenance
Using Our Community
Cloud Lab Forums
2
Hardware
Cloud Lab Knowledge Base
Ideas
Blogs
NXP Forums
Ideas
Blog
NXP.COM
Sign In
FAQs
Language
English (US)
日本語 | Japanese
中文 | Chinese (Simplified)
Home
:
CodeWarrior
:
CodeWarrior for MCU
:
Read Accumulator Register from C
Read Accumulator Register from C
All community
This category
This board
Knowledge base
Users
Products
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show
only
|
Search instead for
Did you mean:
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Mute
Printer Friendly Page
SOLVED
Jump to solution
Read Accumulator Register from C
Jump to solution
02-28-2006
11:10 PM
3,399 Views
jimw
Contributor II
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Is there a simple efficient way to move the contents of Reg A to a variable in C?
Solved!
Go to Solution.
Labels
(1)
Labels
Labels:
General
Tags
(1)
Tags:
cw_for_8_and_16_bit
0
Kudos
Reply
1 Solution
Jump to solution
03-01-2006
03:08 AM
647 Views
jimw
Contributor II
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
I think I found it.
char t;
__asm {
sta t
}
compiles as:
TSX
STA ,X
View solution in original post
0
Kudos
Reply
All forum topics
Previous Topic
Next Topic
2 Replies
Jump to solution
03-01-2006
09:40 AM
647 Views
bigmac
Specialist III
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Hello JimW,
Whenever a function returns a
char
value, the returned value will be in the accumulator. So the following seems to work OK.
char funcA(void) {
asm lda TCNTL; /* Low byte of timer reg */
}
char value;
value = funcA();
Regards,
Mac
1
Kudo
Reply
Jump to solution
03-01-2006
03:08 AM
648 Views
jimw
Contributor II
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
I think I found it.
char t;
__asm {
sta t
}
compiles as:
TSX
STA ,X
0
Kudos
Reply
Post Reply
Preview
Exit Preview
never-displayed
You must be signed in to add attachments
never-displayed
Additional options
Associated Products
You do not have permission to remove this product association.