Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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.

Filter by
Sorted by
Tagged with
3
votes
1answer
1k views

How can I tell Microchip's XC8 compiler that I am using a custom interrupt handler? It tries to place other code at address 4!

I'm developing firmware for the Microchip PIC16F882 microcontroller using their MPLAB X IDE and the free version of their XC8 C compiler. I'm running into a small problem when trying to add a ...
1
vote
2answers
669 views

Assembly language: Ampersand before a register

I'm trying to program the Programmable Realtime Units (PRU) on my Beaglebone Black in assembly language. Here is the instruction set, which comes in two flavors: ...
1
vote
1answer
102 views

Why aren't my 80C51 pins toggling?

I'm working with an 80C51 derivative, the P89C668HFA. At the moment, I'm trying to get some very basic functionality out of it- I just want to 1) disable ALE toggling and 2) get the I/O ports to ...
0
votes
1answer
646 views

PIC18F2550 and DS1307 i2c RTC MPLAB assembly code. Have to loop for seconds,mins,hrs

PIC18F2550 and DS1307 i2c RTC MPLAB assembly code. I am using a PIC18f2550 to get time,date,etc from DS1307. I am able to get the seconds,minutes, hours, etc by repeatly CALLing GET_TIME with a ...
0
votes
1answer
79 views

Electronic insulation paper, home made alternatives?

I need some electric insulation paper similar to Aramid. It's to protect lithium batteries which only operate under 200'C in a worst case scenario, and normally less than 70'C, and Aramid can handle ...
1
vote
2answers
157 views

Why does the accuracy of my camera drop when I start using no-ops as delays?

I'm using an Arduino Mega to run three TSL1401R-LF Linear Scan Cameras in parallel. I got everything working and the camera were giving me different results based on how much light was hitting them (i....
1
vote
0answers
1k views

PCINT0 interrupt on attiny

I'm started working with AVRs few days ago. Started with assembler and simulating in Proteus. My current goal is to enable Pin Change interrupt on PCINT0, which is PB0 on my attiny13. Right now I'm ...
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 ...
0
votes
2answers
1k views

which of the following will take min no of clock cycles?

Which of the following computation will take minimum no of clock cycles, if implemented on 8051 micro controller? following variabe declaration is in c-code: ...
3
votes
2answers
1k views

Why is my assembly code in MIPS wrong?

I've started studying assembly, and I've been tryign to solve this problem: For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables f, g, h, i, and ...
1
vote
1answer
620 views

How does high-level assembly instruction get translated into low-level logical gate behaviors? [closed]

(Pardon me if this is not the best place for such question. I searched a bit but no better place found.) I learned both assembly language and basic digital circuit design back in college. But after ...
-4
votes
3answers
527 views

why don't use microcode? [closed]

Why don't programmers write applications in microcode? Is it because microcode is hard to understand and write or mostly processors ain't microcode compatible? I want the reason
-3
votes
3answers
125 views

How do conditions work in a computer? [closed]

I want to know how a computer knows if a condition is true or false. For example, in assembly the instuctions SUB EAX, EBX JNZ not_equal will check if the ...
0
votes
2answers
168 views

Moving from assembly to C [closed]

About four years ago i stumbled upon some electronics projects on the internet and ever since i fell in love with it. So I started at basic circuits then moved to analog circuits and spent very little ...
-2
votes
2answers
517 views

Using 7-Segment Display on pic18f

I want to show a decimal number between 0-99 on 7-segment display by using 2 push buttons. These buttons will be used for incrementing and decrementing the number on display. I'm using pic18f assembly ...
0
votes
2answers
320 views

Fill ROM with jump instructions

As I have heard it is a common practice to fill the unused flash memory of a microcontroller with an jump instruction to the reset function. This aids in resetting the MCU in case of the PC is corrupt,...
4
votes
1answer
3k views

Proper way to wait N cycles in ARM Cortex-M4

After enabling a clock for a certain port you have to wait 4 cycles for the clock to finish initializing. How can one wait for N cycles the proper way? In my code I used this: ...
0
votes
1answer
119 views

Atmega8 cbi/sbi Timing Issue

I seem to be having a weird issue regarding cbi/sbi instructions on Atmega8-16AU. I have it connected to an external 16Mhz crystal. I am able to verify that it is running at 16Mhz by using ...
0
votes
1answer
507 views

Do I need to use the 'add' function in mips to store into a variable or can I store into a variable with load word?

The following problems deal with translating from C to MIPS. Assume that the variables f,g,h,i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively. Assume that the base address ...
0
votes
2answers
892 views

BGA vs SMD assembly costs

I know that assembly costs for a BGA package can run into about 200-300USD for prototypes. But how important is this cost when planning a production run? Is every BGA package soldered onto the PCB ...
0
votes
1answer
69 views

Values instead of designators on assembly drawing

While creating new Altium component for our company's library I started to wonder: why one would place a designator on an assembly drawing instead of value of a component? Wouldn't it be easier to ...
1
vote
3answers
275 views

How to make a zeros and ones counter?

I'm trying to write a zeros and ones counter in assembly with the AVR ATmega328P. To choose between the ones and zeros, I have a switch in PC5. For the input there are 8 switches connected to PORTB ...
1
vote
1answer
199 views

Resolving interrupt-on-change mismatch conditions in a PIC16F877

I am using pic16f887 to quickly simulate encoder to later use it in a bigger project. reading signals from A and B encoder using interrupt on change for portb and the program was : ...
0
votes
1answer
114 views

using an AduC841 microcontroller. memory read shows pointer not object pointed to

I am using an AduC841 microcontroller programed using assembly language(8051). when using MOVX commands to read/write from internal XRAM to DAC,my oscilloscope shows the value of the DTPR rather than ...
3
votes
1answer
1k views

How does the BRGE instruction work in assembly? Why is this code not functioning properly?

.cseg ldi r16, 0x01 ldi r17, 0x01 add r16,r17 cpi r16,0xFF brge greater jmp less greater:inc r1 jmp done less: jmp done done: jmp done I'm writing ...
0
votes
1answer
59 views

How to calculate how much data a Core 2 duo E8 can write to the RAM per second? [closed]

I'd like to know how exactly I could calculate how much data the Core 2 duo E8 can write to the RAM per second, given that it is not overclocked and the RAM is 333MHz-DDR3?
1
vote
1answer
252 views

ATmega328P assembler inline text and assembelr ALIGN

I have a program in assembler like this: ...
-1
votes
1answer
317 views

ATMEGA32 LED BLINKER Assembly code problem

I tried the following code for a simple led blinking problem on ATMega32. ...
0
votes
1answer
89 views

How to store modify and resend 4 bytes of data from an assembly coded dspic to that in a c compiler based pic18f

I'm using Xc8 compiler and pic18f.Im communicating with a dspic30f ;coded in assembly and receiving a 4 byte variable via i2c. Task: I have to receive the 4 byte packet store,modify it and send ...
13
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 ...
-2
votes
1answer
187 views

error with VHDL CODE FOR FFT

I have a VHDL code for implementing FFT using butterfly. Its 4 input and 8 output. There are 2 VHDL files one for fft package and the other for the architechture, inside the fft pachage the butterfly ...
1
vote
1answer
554 views

Programming ARM Option Bytes using Assembly Directives

So, having a look at the datasheet for a specific ARM controller, we find the address space to be mapped out as follows: There are number of ways to accomplish this, one of which is through an auto-...
3
votes
2answers
357 views

What happens if a branch prediction overwrites a value?

We are just learning about branch prediction so I might not totally understand how they work, but as I understand it, the branches are set to predict either taken or not taken. The pipeline will start ...
12
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 ...
0
votes
1answer
211 views

FRDM-KL25z assembly delay loop causes reset

I'm currently working on a project using the FRDM-KL25Z development board and programming using Keil MDK-lite (5.14a). What we're supposed to do is create a simple traffic light using three ...
-2
votes
1answer
833 views

Calculator with MSP430 in Assembly Language

I am programming a calculator in assembly language with the MSP430g2553. I have a 4x4 membrane keypad and an 2x16 LCD. I already can display numbers in the LCD with the keypad. The issue is that the ...
6
votes
1answer
388 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 ...
0
votes
1answer
175 views

NHD-0216HZ-FSW-FBW-33V3C Black Boxes in Line LCD Display

I installed a NHD-0216HZ-FSW-FBW-33V3C with an MSP430g2553. I tried to initialize it for 4-bit mode in assembly language but black boxes still shown and initialization is not completed I think. My ...
1
vote
1answer
710 views

MSP430 Delay Subroutine

I am writing a delay subroutine in assembly language for the MSP430. I want to know how to calculate the number that have to put in Register R10 in order to achieve a 20ms delay. Thanks ...
0
votes
1answer
100 views

Where can I find some basic information about ICT? [closed]

I'm trying to find some information about the basics of ICT (In Circuit Testing) but having trouble finding anything useful. From the few things I managed to find, I gather that an ICT tester is a ...
0
votes
1answer
102 views

Packaging a small electronics project

(first question on this board - n00b alert) I'm on a second iteration of a small autonomous project which logs changes in magnetism. It consists of just: Espruino board Lipo battery HMC5883L ...
0
votes
1answer
3k views

What is difference between Wait state & Bus idle machine cycle in Case of 8085 Microprocessor?

I have Understood that Wait State provides extra time for slow devices by making ready signal low. Bus idle is a machine without performing any Read/Write Signal, I am able to figure out some ...
0
votes
2answers
851 views

Division Assembly in MSP430

I have been trying to implement an assembly routine in MSP430 for division. I already got the code for the division from the Horner Division Algorithm. The problem is that I only got the integer part. ...
0
votes
3answers
1k views

Assembly Jump Question (PC Offsets) - MSP430

So im still trying to understand basic computer architecture, and have been writing a little bit of assembly for the MSP430 (basic LED/Switches stuff). I've been browsing the instruction set, and ...
4
votes
1answer
2k views

ARM startup file attributes vs GCC command line arguments

The startup files for STM32 Cortex-M MCU's, for most GCC toolchains, often bundle the Atollic TrueStudio startup assembly files with HAL libraries, like for example in my case, STM32CubeF4. I'm ...
3
votes
1answer
2k views

AVR asm wait loop explain

Can someone please explain me this code (it is from wait loop calculator), I cannot clearly understand calculation. ; Delay 1 600 000 cycles ; 100ms at 16 MHz ...
2
votes
1answer
227 views

PIC ISR - check every interrupt source or just one?

I'm curious if there are any particular wins for using a call instead of a goto when checking each interrupt source in an ISR. My current code would do something like this: ...
0
votes
2answers
543 views

How to count cycles used by a routine?

I'd like to measure the number of cycles a routine uses on a 8051. I'm guessing that I could toggle a pin on and off and measure the period with a scope and multiply it by the number of cycles the ...
0
votes
2answers
50 views

Most efficient way to switch order in which data is read in assembly

I have an assembly assignment that requires me to be able to store a number and via a lookup table output the number on a 7 seg display in both forward and reverse order depending on the state of an ...
1
vote
1answer
4k views

Simple AVR LED blink in assembly - why does this code not work?

I've been trying to blink an LED with AVR assembly. I'm using an ATMega168 chip and avr-gcc toolchain. Here's my code: ...