Search Engine www.edaboard.com

# Variables Assembly

21 Threads found on edaboard.com: Variables Assembly

## XC8 and pic18f4520 not handling math problem correctly.

Hi all, I have a pic18f4520 programmed with mplab X and the XC8 compiler. All variables are floats and i'm using it to solve the following polynomial: poly1 = (-3.951941733344756E+04); poly2 = (4.252156952428445E-01*X); poly3 = (6.840575570401091E-08*X *X); poly4 = (6.564136661977851E-15*X *X *X); Y = (poly1+poly2+poly3+poly4);[/C

## Division in MSP430 Assembly

Are you considering such division intended to scale a variable value (numerator), or are both values variables (numerator, denominator) ? There are circumstances on which you can achieve a division just by using 1-multiply followed by few shift instructions.

Depending on the compiler, you can specify the address of functions or variables e.g. using the "address" attribute in Microchip's PIC24 compiler. Keith

## Please explain the calculation in the below assembly language program for pic

r0, r1, r2, r3 are 1 byte variables starting at address 0x20 movlw 0xFF means move literal value 0xFF to W (working register) movwf r1 means move value in W to r1 0xEF is moved to r0 0xFF is moved to r1, r2, r3 value in r2 which is 0xFF is copied to W subtracts W from f and stores the result in f subwf r0,1 subtracts 0xFF from r0 (which is 0

## Timers limitation counts

1. generate a timer tick in hardware using a polling or preferably an interrupt routine. 2. call a routine with the tick, an ISR will do this for you. 3. count 35 variables up or down in software, these are the timers you need. Easy, and if you are writing in assembly language you can increment or decrement a timer variable in just one instruction

## Can somebody expain this assembly code?

This looks like a section of diusassembled code taken from a program written in 'C'. Without knowing at which address variables, contants and other routines are stored and the segment addresses, it isn't possible to explain its operation fully. The best you will manage is to use the processor's data sheet to see what each instruction does. Brian.

## PIC Assembly: operations on variables larger than 1 byte

I am having a delay routine that goes like this: Delay ORG 0x0C _delay RES 3 MOVLW 0x40 MOVWF _delay MOVLW 0x42 MOVWF _delay+1 MOVLW 0x0F MOVWF _delay+2 _delay_loop DECFSZ _delay, f GOTO _delay_loop RETURN The whole value within the 3bytes is 1 million which from calculations it should waste 1 second

## circuit design - ready for manufacturing - tips

Hello, I am a R&D designer and have a done a lot of designs and builds with no problems. However I am brand new to taking a design to manufacturing (100+) products. I realize that there are many variables and pretty clueless in knowing where to start. I would define the product to be the PCB and assembly with components. Topics on circui

## 8051 port mapping to variables

how is it possible to map a port in 8051 to a variable and also its bits to the variables bits?and also i need to store the lower nibble of port bits to the variables higher nibble and vice versa?how to implement this in kiel?can anyone give me the code?for port0 and variable 'var' ,i want to store P0^0-P0^4 in Var^4-Var^7 and vice versa.

## conversion of assembly code in to c language

I have seen a couple applications that can do that (I have never tried any) but the code you will get will not be anything similar to the original code, all the variables and function names will have random names and the structure will be different since the compiled code is optimized and this can' be reversed. It will probably be easier to write

## Serial communication between pic, pc & eeprom

Hi, There is no direct instructions to handle Multi-byte variables (like strings) in MPLAB assembly. There are some other way to tackle it. If you want to store constant-strings in PIC, use ROM. You can use Table read/write method. Check PIC datasheet and see following

## Question on assembly code

Would someone pls let me know the meaning of following code?? Is it just for distribution of values to variables?? Buz obviously 'Estim_a' to 'f' are variables used in main code. Then why the numbers are 0, 2,4,6, etc. ....... .equ Estim_a, 0 ; .equ Estim_b, 2 ; .equ Estim_c, 4 ; .equ Estim_d, 6

## Understanding Assembly and HEX???

He defined 2 variables using the equ directive. The 3rd line, he means that the code should be placed at the address after the org directive. -- Amr

## Which memory segment is allocated for the Register variable?

Hi Vhn, Thanks for your reply. But do we have separate data memory ( to store auto or static variables) other than CPU registers to store variables in a MICROCONTROLLER. Sorry I know only assembly language programming for uCs. I never used register or auto definitions in my program.

## Programming from the Ground Up-assembly language

Programming from the Ground Up - This is an introductory book to programming and computer science using assembly language. It assumes the reader has never programmed before, and introduces the concepts of variables, functions, and flow control. The reason for using assembly language is to get the reader thinking in terms of how the computer (...)

## MPASM Float Variables

I am trying to write a code with macros that is independent of the crystal frequency. I am trying to write delay routines such that by once specifying the crystal frequency like Xtal EQU 8 I get MPASM do conditional assembly to select the right type of subroutine that would give me the desired delay. I would like to get MPASM d

## PIC Assembly: How to declare an Array?

1.) Suppose I have variables like ARG00 ARG01, ARG02, ARG03, ...ARGN, how can I declare them as an array elements say ARG(0 to N)? You can declare and address of ARGARRAY that points to beginning of a bunch of register variables that make up your array, this way: CBLOCK ARGARRAY : 0 ARG00, ARG01, AR

## ARM assembler with and without optimisation

Will the assembler try to optimize the code by "packing" variables into registers?

## How to access C variables from inline assembly in C18?

I'm having trouble finding anything that tells me how to access C variables from inline assembly in C18. Sure, I realise that you just use the C variable name in the assembly - but what about knowing the bank number of the variable? Cheers.