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.

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
949 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
575 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
487 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
123 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
161 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
509 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
301 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
115 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
367 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
832 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
67 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
271 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
184 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
113 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
233 views

ATmega328P assembler inline text and assembelr ALIGN

I have a program in assembler like this: ...
-1
votes
1answer
303 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 ...
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 ...
-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
511 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
331 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 ...
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 ...
0
votes
1answer
204 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
819 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
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 ...
0
votes
1answer
174 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
653 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
94 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
101 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
818 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 ...
2
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
222 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
509 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: ...
0
votes
1answer
247 views

USB data cable that doubles up as a USB storage device

Is it possible to create an USB to micro USB (or lightning) cable that has storage built into it? So if it's plugged into a computer with no phone, the computer recognizes it as a regular USB ...
1
vote
1answer
697 views

MPLABX syntax cheker errors in ASM mixed with C

I'm using XC8 for a project in MPALBX using a PIC18F26K80 and I'm getting lots of Unable to resolve Identifier errors in the editor: The code works compiles an ...
2
votes
2answers
1k views

Initialize ARM registers to specific value via Inline assembly

I have a need to initialize the ARM registers of my ARM7TDMI development board to a specific values using inline assembly. For example currently I do something like the following : ...
0
votes
1answer
223 views

Interrupt doesn't seem to reenable on PIC16F887

I'm building a timer using the PIC16F887, some push buttons, and seven-segment displays. I'm writing the code in assembly, and everything works great except the start/stop button which is handled as ...
0
votes
1answer
270 views

How do ALU flags communicate with the rest of the computer?

How are ALU flags connected to various parts of a computer? I've just finished building an 8 bit computer in Logisim that can add subtract and compare... and am wondering how I can make it multiply (...
5
votes
2answers
529 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 ...
1
vote
1answer
2k views

Is there a way to Divide two 8 bit number in PIC 18fXXX assembly language not C?

I Can easily do the division in C of PIC micro controller. But is there a way to divide two number stored in two 8 bit registers. For example look at this code. I have to do it in PIC assembly for 8 ...