This is a programming language that is at a low level that corresponds with the instruction set of the machine being programmed.

learn more… | top users | synonyms (1)

0
votes
0answers
30 views

Interrupt handler problem

I'm trying to programm a ohmmeter with AT8051. It uses communication RS232 and I want to send instructions from PC. Below in code are programmed keys 'A' and 'B'. 'A' runs measurement, which is ...
0
votes
0answers
17 views

What is PGM_MTP

In sample of code for writing in to internal flash memory of microcontroller 8051 in assembly, there is instruction which calls PGM_MTP. ...
1
vote
1answer
28 views

Pic18F2550 Assembly xt_xt

I am trying to set up a Serial Port for a PIC18F2550 Microchip. I am using MPLAB. In the 18F2550TMPO.ASM Template the statement CONFIG FOSC = XT_XT ;XT oscillator, XT used by USB. I need to change ...
9
votes
5answers
762 views

Why use AutoCAD Electrical?

I'm an electronic & electrical engineering student in first year of university. I have had to use a few core programs as part of my course for programming and simulation software. However I came ...
0
votes
1answer
19 views

PIC18 inline asm problem: error (195) expression syntax

I'm building a bootloader firmware, and now I want a simple app (LED blinks) to test calling bootloader from application itself. I'm currently doing: ...
1
vote
1answer
38 views

AVR Attiy45 PWM Servo motor control in Assembly

I'm trying to contol a servo motor with attiny45 writing the code in assembler. I figured out how to set the timer in pwm mode and how to choose a needed prescaler. And with different OCR0A values i'm ...
0
votes
0answers
48 views

“Constant value required” while compiling asm inline with avr-gcc

I am trying to insert some assembler code into my C program for AVR MCU, but every time I compile it, I get an error message from gcc-as: "Error: constant value required". I've tried changing I/O ...
1
vote
1answer
139 views

PIC12F683 or PIC16F688 assembly or C blinking LED example with XC8 compiler, MPASM or gputils

Hello I am new to PIC programming and I finally have got my dev environment working, I downloaded the XC8 compiler from microchip and also as backup I downloaded the gputils assembler. I have not been ...
0
votes
2answers
68 views

Shift value to some point in binary number

I wonder if it is possible to do the following. For instance, I have a number 00001110. I am shifting it left. -> 00011100.... But the question is if it possible to start setting value in carry flag ...
1
vote
1answer
40 views

What is Pipeline Flushing in microprocessors

I am reading the book "Writing Operating System from Scratch" by Nick Blundell. In one of the chapters, it is explained how we make transition from 16bit mode to 32bit mode. It says that before moving ...
0
votes
4answers
74 views

What is the meaning of performing logical operations on two numbers?

If we are to consider two Boolean values, the logical operations on them make perfect sense. But what would it mean to perform AND/OR/XOR operation on two binary numbers? I am learning Assembly ...
2
votes
2answers
87 views

PIC16F690 Consecutive flashing LED's

I am having trouble writing the code for flashing 6 LED's from PORTC on the PIC16F690 microcontroller. The LED's should flash like the lights on a runway. With the code that I currently have the ...
2
votes
1answer
74 views

How does the CPU handle XCHG internally?

While designing my own 16-bit CPU I wonder how the register-register XCHG instruction is executed internally. From computer science I know the DLX which doesn't provide XCHG and therefore doesn't need ...
1
vote
1answer
76 views

PIC16F1933 Output pins not working

I am having problems with getting certain pins on my microcontroller (PIC16F1933) working as outputs. I have been simulating the code in Proteus Design Suite by Labcenter Electronics and it doesn't ...
0
votes
1answer
68 views

What other problems can be caused when using the JMP instruction to navigate through subroutines instead of using the instruction CALL/RETURN?

I've been creating a report on why the JUMP instruction shouldn't be used in the piece of code above and instead CALL/RETURN instructions should be used to navigate through the subroutines. I ...
1
vote
2answers
78 views

How is data allocated in an assembly language using the instruction set?

Consider the following excerpt of assembly code written for the Nios II embedded processor architecture: ...
0
votes
0answers
35 views

Need Some Help Using a GLCD on EasyAVRv7

I am trying to use a GLCD, a WDG0151-TMI-V#N00 on my EasyAVRv7 board and I realized that I might need some help. The MPU I have is an ATmega32. Problem is, nothing works. For example I can't even tell ...
1
vote
1answer
60 views

implementing direct addressing mode for a load instruction on a mips archtitecture

Given a Mips machine with 26 bit addresses and 32 bits data-paths, where the load instruction is as follows |OPT code|rs|rd|immediate| |6 bits |5 bits|5 bits|16 bits| The OPT code is the ...
2
votes
0answers
113 views

How to tell CCS debugger where to start?

I am just starting with MSP430 and Code Composer Studio (CCS). I want to make a pure-assembly project. At the moment, I have a "hello world" program that does nothing but light an LED on the ...
2
votes
3answers
82 views

Curious how does ALU addressing work like in Assembly code?

When writing assembly code, say R1 = R2 + R3, it is pretty easy to understand the addressing procedure because all registers are close to the ALU. But I find it hard to see how does the ALU go to the ...
2
votes
1answer
58 views

AVR Assembler Labels

According to doc1022, p. 17 (AVR Assembler User Guide): User defined labels which are given the value of the location counter at the place they appear. My question is, what goes into the opcode ...
0
votes
1answer
93 views

Use of $at register in MIPS?

Register r1 or $at, is it's sole use in pseudoinstructions? If so, is this the sole solution to enable pseudoinstructions within the architecture?
0
votes
1answer
114 views

8080 assembly comparing which of the numbers is greater etc

In my 8080 assembly project I need to check if user entered digits and if so do some stuff on it, otherwise display some error and close app. Normally i would do it like that ...
0
votes
1answer
193 views

XMega bootloader - How to make use of the functions in assembly source file

Its been two days I'm trying to write a Bootloader for ATXMega32E5. The Atmel studio doesn't have boot.h header file supporting XMega. As a result of searching and ...
2
votes
0answers
94 views

PIC12F ADC conversion has an unwanted offset

The current setup is shown below. PIC12F1822 with a 10-bit ADC. I'm using a 250R 0.05% precision resistor to get a nice 0-5V input to the analogue pin (AN2 if it matters). As far as I can tell I ...
0
votes
1answer
93 views

How to calculate cache size?

A cache with a line size of L 32-bit words, S number of sets, W ways, and addresses are made up of A bits. Assume that the cache is word addressed, i.e., the low two bits of the address are ...
0
votes
1answer
80 views

Direct cache vs. associative cache

Trying to solve this problem where direct cache would outperform associative: Propose you have a cache with a line size of L 32-bit words, S number of sets, W ways, and addresses are made up of A ...
0
votes
1answer
107 views

5-stage pipelined implementation (RISC) of a microprocessor

I'm trying to solve two questions about a RISC 5-staged pipeline that is not exactly like MIPS found here (everything is included in this post). Consider the non-pipelined implementation of a simple ...
0
votes
1answer
82 views

ISA efficiency code compaction and memory traffic

I'm having issues understanding this problem and am new to ISA's. Here's a problem with 3 questions and my biggest question is, what is supposed to happen? Specifically, the HLL Code at the bottom. ...
1
vote
2answers
117 views

MSP430 Stack pointer and frame pointer behavior

While trying to analyze a simple Assembly file generated through the msp430-gcc, I stumbled upon a set of instructions that I don't understand dealing with the frame pointer and the MSP430's stack ...
0
votes
1answer
113 views

Numerical value in decimal of the 32-bit word stored at address 1000H

I'm a little confused how to tackle these three questions. Assuming two's complement arithmetic and operand alignment, give the numerical value in decimal of the 32-bit word stored at address 1000H ...
2
votes
0answers
82 views

What happens to AVR registers during multi-cycle instructions?

This is more of a theoretical question... (Also my first on Stack Overflow) I am wondering what happens to Atmel AVR microcontroller (i.e. ATTINY85) registers during a multi-cycle instruction. i.e. ...
1
vote
1answer
111 views

Assembly XMEGA program creating a longer than expected pin toggle?

I'm trying to do the fastest pin toggle possible on an XMEGA32E5 running at 32MHz. My code is as follows: ...
0
votes
2answers
81 views

Average Cycles Per Instruction

We have two different computers with the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. Computer M1 has a clock rate of 80 MHz and Computer M2 has ...
5
votes
3answers
998 views

Is this a correct way to have a 1 second delay?

If I have a PIC24 with a 4 MHz frequency. Is it accurate to have a 1 second delay by having 4 million clock cycles? I made a 1 second delay like this on my PIC24FJ128GA010: ...
1
vote
1answer
133 views

The PIC24F RETURN instruction

The PIC model I have is PIC24FJ128GA010. My question how many clock cycles does the RETURN instruction consume? The datasheet says 3(2), what does that mean?
2
votes
2answers
386 views

AVR microcontrollers, who initilizes assembly `data` segment and what is the purpose to have this directive?

I am new to assembly and microcontrollers and am trying to figure out how they work. Now, I have read a lot how in assembly text and ...
2
votes
0answers
301 views

32-bit unsigned binary integer to 8-bit BCD in AVR ASM for ATtiny. How to make it more efficient?

I wrote a program in AVR ASM for converting 32-bit unsigned binary numbers to 8 digit ...
1
vote
2answers
180 views

ATtiny2313 vs ATtiny84 software compatibility

I make and sell a variant of the USBtiny AVR programmer. It uses an ATtiny2313 clocked at 12 MHz and does bit-banged USB using hand-tuned assembly language (that someone else wrote - it's an open ...
3
votes
3answers
153 views

Frequently used functions, performance improvements using static variables?

Does defining variables (large arrays) as static inside a function have any performance improvements if the function is to be called repeatedly say in the order of seconds?
1
vote
0answers
104 views

Weird bug in MPLAB X IDE

When using the RTCC module in the PIC24F, we need to use the secondary oscillator (by setting bit #2 of OSCCONL register) and disable the write lock on the RTCC registers. Now the write lock can be ...
2
votes
1answer
219 views

Problem with the explorer 16 dev board

I have the explorer 16 dev board equipped with the PIC24FJ128GA010. I wrote a C code to write something on the LCD and a LED blinking after that. I wrote the same code in assembly and both codes work. ...
0
votes
1answer
126 views

pic18f instruction reference for XC8 Assembler

I found lots of tutorials online on PIC18 assembly programming, but i did not found any official document from microchip on PIC18 architecture and assembly programming. Can anybody share the link ?
1
vote
1answer
155 views

mpasm - overlapping variables in a udata directive

In MPASM it appears I can do this to make paylen_lo and bytesleft have the same memory location: ...
0
votes
0answers
204 views

Debug Assembly Code in Atmel Studio

I am using latest Atmel Studio to generate *.hex file from *.asm file. When I start to ...
1
vote
1answer
153 views

RSBMI instruction in ARM

as an exercise problem in ARM assembly program, I had to convert a number x to its absolute value. now seeing the problem as a simple problem of removing the sign of the respective number, I used BIC ...
0
votes
2answers
71 views

Avoiding multiple defines by using side effect of PIC banking

This is more a question of style than anything else and might strike some as a bad thing to do. If I have a serial port pin on RC4, say, I can make some defines to help out: ...
2
votes
1answer
258 views

PIC12 TRIS Register not setting, No GP0 GP2 output

I originally asked the this question on Stack Overflow. I think here would have been a better audience. I'm trying to program a PIC12C508A to do a simple LED learning circuit. I've read some ...
3
votes
2answers
386 views

Changing to relocatable code for PIC microcontrollers

I've come back to PIC programming after 10 years and I've been relearning everything. I'm looking at the section in the MPASM manual where it discusses relocatable code. And I've come to the ...
3
votes
2answers
268 views

avr-gcc timer overflow interrupt handler in inline assembly

My current project involves producing 200KHz PWM waveforms using timer 1 in fast PWM mode. I would like to increment a 16-bit counter every time the timer overflows (every 5μS) ...