Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [assembly]

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

19
votes
11answers
8k views

What is a Good Starter Microprocessor to learn Assembly?

So I'm wanting to learn Assembly first on an MP, then move onto C (since it seems like that's what most of them use). I'm wanting to get into Embedded Programming, I really love low level C stuff (...
19
votes
6answers
2k views

Identify processor type from raw binary code?

Not really related to chips, but hopefully I'll get some directions to follow from here. I got a chunk of code, but I don't know what processor it intended for. Are there tools available that can ...
19
votes
3answers
4k views

Is 0603 vs 0402 assembly mass production cost optimization still relevant?

Historically, choosing a design avoiding 0402 and finer pitch components was advantageous for mass production cost savings. The yields were improved and accuracy requirements for pick and place ...
18
votes
8answers
6k views

Writing DSP algorithms directly in C or assembly? [closed]

I m working on a DSP project(IIR filtering) on an Analog Devices digital signal processor(BF706) with the compiler suite coming with it, CrossCore Studio. It has some examples for simple DSP stuff ...
17
votes
4answers
3k views

What stops an assembly program from crashing the operating system? [closed]

First of all, I am a beginner, so if this question sounds silly, please point out the incorrect assumptions. From what I understand, the job of an operating system is to manage hardware and the ...
16
votes
12answers
6k views

Could you program a microcontroller without a computer?

Let's say you had a rather simple and small microcontroller and had no interfacing, no computer, no debugger, compiler, or assembler. Could you write your code in assembly, convert it (manually) to ...
16
votes
6answers
29k 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 ...
16
votes
3answers
2k views

From C to Assembly

Suppose that we have the following piece of C code for an avr-8bit: int v1=1; int v2=2; v2=v2+v1; I expected the following disassemble ...
16
votes
1answer
528 views

What features distinguishes real-time from other types of os?

I'm experimenting with a small so-called real-time kernel that basically can do nothing but counting to the next prime. It uses interrupt-driven I/O. But why is it a real-time kernel? I read that ...
16
votes
3answers
15k views

Removing rosin flux residue from PCB

I have a nice looking purple PCB from Laen's batch service, which I have assembled using rosin flux. I have cleaned the board as best I can with isopropyl alcohol, which gets rid of the tackiness of ...
14
votes
5answers
2k views

Conductive object to raise 6mm height off PCB

I am designing a PCB where I expect to have a certain part assembled at the edge of each board (blue in the picture below). However, this part needs to be at connected/soldered at a height of about 6 ...
12
votes
8answers
23k views

Arduino With Assembly?

Since for my venture into Microprocessing I decided to go with Atmel AVR due to the vast resources available. And Arduino seems to has alot as well, not to mention their starter kits seem more "at my ...
12
votes
4answers
2k views

AVR SEI instruction

The AVR SEI instruction (http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_SEI.html) waits for the next instruction to finish before enabling interrupts. If I use another instruction to set ...
12
votes
3answers
14k views

What actually is a shadow register?

I noticed the term Shadow Register while going through a datasheet of a TMS320F28335 DSP. What does it actually mean? Does it have a physical location in the CPU as ...
11
votes
2answers
3k views

Silkscreen versus assembly layer

Is there any example, preferably by photos, how does assembly layer on PCB differ from the silkscreen? I understand, that silkscreen reference designators should be left visible after the parts are ...
11
votes
6answers
2k views

What is the reason my PIC16 multitasking RTOS kernel doesn't work?

I am trying to create a semi-pre-emptive (co-operative) RTOS for PIC x16 microcontrollers. In my previous question, I've learnt that accessing hardware stack pointer is not possible in these cores. I ...
10
votes
3answers
8k views

Microprogramming vs. Machine Language programming

I'm a bit confused between the microprogramming level vs machine language level. For example: Where do both types of programs reside while being executed? Do either have a 1:1 mapping to assembly ...
9
votes
6answers
10k views

Programming Differences between a Microcontroller and a Microprocessor?

So I often see books/tutorials and references when programming in assembly to a microprocessor.....then I see some refer to it as a microcontroller. For instance the Atmel ATtiny2313....i saw some ...
9
votes
2answers
1k views

Need some help understanding PIC memory map

Some background. I use MPLABx with a PicKit2 to program different types of pics. At the moment its the 16F887. I try to stick to the Hi-Tech PICC Lite tool chain but I'm growing increasingly unhappy ...
8
votes
5answers
2k views

Why this code wasn't written in a much simpler way?

I have came across a question while working on assembly language. Here is the question: Assume that bit P2.2 is used to control an outdoor light and bit P2.5 a light inside a building. Show how to ...
8
votes
3answers
18k views

Difference between reading PORT and PIN

What is the difference between reading PORTA and PINA? What is the relation between a port and its pins?I'm really confused!!! sample of reading PORT:(reading pin is not useful here) Assembly f=1MHZ ...
8
votes
3answers
1k views

Can a hobbyist ARM setup be as simple as this AVR one?

I like how simple an Atmel AVR setup can be for hobbyist assembly language programming. For example: Put a plain ATmega DIP chip {A} on a breadboard Connect 6 pins to a USB programmer {B} connected ...
8
votes
1answer
378 views

While loop optimized away

I have the following code in my microcontroler program: // Wait for ADC conversion to complete while ( ( ADCSRA && _BS( ADSC ) ) == _BS( ADSC ) ) {} ...
7
votes
5answers
14k views

How can I set the condition code in assembly language?

I want test the variable sign. In other words, I want know answer to the whether a variable is positive or negative. How can I write following if-then-else conditions in assembly language ? ...
7
votes
1answer
573 views

What does [WEAK] mean in STM32 startup assembly code?

I was reading the STM32F407 startup file in Keil software to gather some information. I faced this problem: What is the [WEAK] symbol used for? A part of the code ...
7
votes
4answers
8k views

Fastest way to toggle a bit in ASM

What's the fastest way to toggle a bit1 in MPASM for the 14-bit enhanced instruction set? (I'm working with a PIC16F1829) The code has to be standalone - I mean that it can be called on any moment, ...
7
votes
4answers
997 views

Assembly Language Program Design

This is a homework assignment problem and I tried to solve this all last night but I am still a newbie in Assembly language. Dont give me the full solution, just give me a hint. Design an ARM ...
7
votes
1answer
1k views

How to produce a middle C on intel 8080?

This is a example problem in my book. Assuming pin 5 of port 4 is connected to an amplifier that drives a loudspeaker, the solution is given as, The frequency of middle C is $$f=261.63\ \text{Hz}$$ ...
7
votes
3answers
7k views

Error when compiling start-up file on STM32

I am attempting to provide custom interrupt handlers for my Cortex M3 (reference manual here). ST kindly provides a standard library, which has various startup files all called "startup_stm32f2xx.s". ...
7
votes
1answer
580 views

On Freescale iMX31, how can I translate SDRAM address to CPU address?

[This is a re-post of https://stackoverflow.com/q/5346225/69172] I'm new to iMX31 and embedded systems, please help me to understand the translation from SDRAM address to ARM CPU address, especially ...
7
votes
1answer
393 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. <...
6
votes
2answers
359 views

How can I instruct my compiler to use 8 bit bytes instead of 16 bit integers?

I have the following code in my microcontroler program: ...
6
votes
4answers
4k views

what is an average CPH speed for hand SMD assembly?

What would be the average speed (an experienced) person would assemble surface mount components on to a PCB? Assuming they have desk that is correctly set up (pick and place station) and the PCB has ...
6
votes
1answer
5k views

MIPS (PIC32): branch vs. branch likely

It's been a while since I've looked at the recent Microchip processors & I've been trying to learn a little bit about the PIC32 MIPS instruction set. I noticed there are two sets of branch ...
6
votes
3answers
3k views

How to decode ARMv7 instructions?

I'm trying to understand ARM instruction encoding. The following image shows C code along with its corresponding assembly instructions: I looked at the ARMv7 reference manual. However, I couldn't ...
6
votes
2answers
662 views

Mysterious hard-fault when I step over

This question was rewritten to remove several updates and improve clarity. I have a Cortex M3 based (and rather obscure) MCU. I have a rather big project, written in C++, in Keil MDK5 with armcc ...
6
votes
1answer
372 views

Soldering a male-female bus connector

'Stackable bus connectors' are common nowadays on Arduino and other boards where a single connector has both the male pins (for the board below) and female sockets (for the board above) In DIY sites ...
5
votes
3answers
4k 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: ...
5
votes
1answer
1k views

Atmel AVR assembly language multiplying by 2

I'm trying to multiply a 32-bit unsigned number by 2 across registers r18, 19, 20 and ...
5
votes
3answers
786 views

Dump Flash Memory through a single GPIO pin

I'm working with Infineon's XMC4500 Relax Kit and I'm trying to extract the firmware through a single GPIO pin. My very naive idea is to dump one bit at a time through the GPIO pin and somehow "sniff"...
5
votes
3answers
5k views

AVR and bootloaders - where to begin?

I have the need to write a bootloader program on an AVR microcontroller (Atmega32) in order to enable self-programming. I have read various resources on the topic of bootloaders and have come to the ...
5
votes
2answers
754 views

What's the most effective way to save/restore a PIC status bit

I want to save/restore the PIC's carry bit. I'm using the 16F628A. ...
5
votes
3answers
3k views

How can the number of clock cycles required to complete an instruction in a pipelined processor less than pipeline latency?

I am not new to computer architecture but I have only academic experience with micro-architecture implementation. I have heard and read this many times but never really bothered to understand the ...
5
votes
1answer
3k views

Converting AVR assembly to machine code - addressing registers?

In AVR Assembly - I want to work out the machine code representation of the following: ANDI r18,$10 I know the opcode for ANDI is ...
5
votes
1answer
4k views

AVR assembly: Most fastest way to increment two combined bytes

What could be the fastest way to increment two combined bytes in assembler (assuming I'm working on a 8-bit CPU)? Currently I'm doing this: ...
5
votes
1answer
7k views

MIPS Assembly Memory Addressing “Pseudo Direct Addressing”

Could anyone explain how does Pseudo Direct Addressing work in MIPS? I don't really get how does using the last 4 bits from the PC (Program Counter) fit into the picture? Suppose I want to goto ...
5
votes
1answer
775 views

Effects of no-clean flux or RMA flux residue on signals

I keep on hearing that no-clean solder paste or flux is bad for analog or digital signals because it makes analog signals "noisy" and promotes cross talk on digital signals. Like this claim: Flux ...
5
votes
1answer
542 views

Why doesn't my VGA implementation using an AVR microcontroller work?

Problem I'm trying to generate the appropriate signal output for interfacing an AVR ATmega328P microcontroller with an LCD monitor, via the VGA specification. The VGA specification I am trying to ...
5
votes
2answers
525 views

AVR: How optimize cycle-counted ISR to portable code, using inline asm

I'm trying to optimize my RX and TX interrupts to meet maximum execution time of 25 cycles while interrupts are disabled. So far, I have found that code is optimized enough, but pushing and popping ...
5
votes
1answer
1k 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 ...