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
0
votes
1answer
82 views

assembly timer code [ C8051F340 ] explanation [closed]

Hi my problem is that I cant understand this code when I test it on my microcontroller Si Lab [ C8051F340 ]and let it run step by step My problem is basically is when I test the program on my ...
0
votes
1answer
181 views

How exactly do clock speeds of computers relate to operation speeds?

I was wondering about this the other day when I was explaining binary and hexadecimal to a friend of mine and this came up. The question goes something like this: How exactly do instruction ...
6
votes
2answers
1k 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 ...
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 ...
1
vote
2answers
611 views

Using timers 8051 Assembly Microcontroller

I am testing a basic timer example in keil (8051 ) when I debug this code org 0 MOV TH0,#76 MOV TL0,#01 MOV TMOD,#01 SETB TR0 JNB TF0,$ end I get the error <...
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 ...
-4
votes
1answer
965 views

Turn on a led with ARM in assembly language [closed]

How do I convert this C++ code for turning on one LED into ARM assembly language for the LPC2124? ...
-1
votes
1answer
2k views

Debouncing of a push button in assembly using Timer1 interrupt - PIC16F628A [closed]

I am new at assembly programming and I need to develop a debouncing code to use on a push button, for that I am required to use timer1 interrupt. The push button will be used to increment a counter ...
21
votes
3answers
5k 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 ...
1
vote
3answers
2k views

Counter in assembly, using interrupt to prevent multiple counts with single push?

I am completely new to assembly, and I must develop a counter using PIC16F628A, a push button, and a display. Additionally it there will be an external oscillator (555). I made some progress on this, ...
0
votes
1answer
1k views

Why does the LSR (logical shift right) instruction only require a single clock cycle to execute?

A while ago, I was reading the book Some Assembly Required on programming assembly for the avr family of microcontrollers... Early on, it explained that the LSL ( logical shift left ) instruction was ...
2
votes
1answer
710 views

Writing to a 2 byte register from 1 byte registers

I am an assembly newbie and I am trying to write an assembly routine to write data to EEPROM of a 8051 variant. (Specifically, AT89C51CC03) In the datasheet, it says that I need to write to the ...
0
votes
0answers
137 views

I/O initialisation. Curious for the reason PIC16F18877

For the initialisation of an I/O in the pic the datasheet indicates to clear set the TRIS correctly and clear both PORT and LAT bits. I thought I understood why and the program works. When looking at ...
0
votes
1answer
485 views

Serial communication with microcontrollers AT89S52

I have a problem, I need to connect two microcontrollers and programming one of those as a transmitter and the other as a receiver, I've tried to do this but it's not working, and I don't know why. ...
0
votes
1answer
2k views

Why does DIV AB converts from hex to decimal 8051

I was trying to solve a problem and I read that this code converts a number from hex to decimal I mean why . My idea is that div is just for division can somebody answer my questions that I left as ...
1
vote
6answers
2k views

what exactly is single cycle instruction architectures?

I got the following text from lab work 2 of CMU's computer architecture course. I am actually trying to do this lab myself out of own interests and I am in no way a student of CMU. The machine has ...
-1
votes
2answers
706 views

Difference between MIPS and ARM datapaths [closed]

I have just learnt simplified five stage pipelined MIPS architecture in the class. I am reading other Instruction Set Architectures (ARM currently) and found some differences between ARM and MIPS. ...
1
vote
3answers
3k views

how to end an assembly code

I'm trying to write a code for pic16f877 by translating a simple algorithm into assembly code. The instructions set doesn't have such an instruction. Here is what I wrote: ...
-1
votes
1answer
292 views

Using timer0 in PIC16F877A [closed]

I'm just starting out with timers on microcontrollers and part of my assignment requires me to write a value to timer0 in order for it to increment after a specified time. What confuses me is that I ...
-3
votes
2answers
957 views

Manually storing the stack pointer rather than using push and pop (Assembly)

What will be the instruction sequence that implements PUSH R4? A: SUB SP, SP, #4 STR R4, [SP, #0] B: ...
1
vote
1answer
416 views

Confusion with a simple assembly code for AVR

Im using ATmega328P with Atmel Studio. I have a problem understanding the register manipulation in this code: ...
1
vote
2answers
142 views

use of BTFSC with pic16f627a/628a/648a not clear

Still learning on pic programming. The code has no meaning only for looking at the behaviour of BTFSC When using BTFSC in a loop construction the testing bit is changed the next instruction is not ...
3
votes
1answer
178 views

What does the flag formula symbols mean in AVR assembler documentations

I was reading about something in the assembler documentations of the AVR microcontroller and I usually come across a line used to describe how would an instruction affect specific flag in the status ...
0
votes
1answer
525 views

Confusion on pop for recursive assembly code

I'm confused on what happens during POP. When POP LR happens does that change the PC to the location of ...
1
vote
1answer
4k views

Confusion about ADR in ARM (assembly code)

I'm confused on what's happening with ADR R14,cnt1. Is cnt1 signifying the end of the program? And if so how will ...
0
votes
1answer
110 views

Understanding this AVR ASM routine

This is an abbreviated version of WS2812 LED control routine. I have removed all the no-ops for the sake of readability here. Can someone explain the role of the branch instruction (brne) towards the ...
1
vote
0answers
661 views

make an LED blink on rpi2 in assembly

I am trying to make an LED blink on assembly on my raspberry pi 2 model B to debug some startup code. However I don't see anything blink. Could someone tell me what I am forgetting? ...
1
vote
1answer
2k views

Are AVR multi-cycle instructions pipelined?

Since AVR is a RISC architecture, most instructions only take a single cycle to execute. Still some need two or more cycles, e.g. adiw, which performs 16-bit ...
1
vote
1answer
50 views

Buying Low Volume Populated PCBs and Handling Passive PNs

New to Eagle PCB design. I plan on making a custom Beaglebone Black Wireless PCB, and so have pulled down the Eagle files. I'm a student and have a student license. This project will be too difficult ...
0
votes
1answer
230 views

Creating a delay using TIMER0 module on PIC16F1939

Suppose we are using an external oscilaltor at 8 MHz and needed a voltage high for approximately 1 second at pin RA0. One instruction cycle takes 0.5 \$\mu s\$. I made a subroutine that takes 25 ms,...
0
votes
1answer
1k views

How to simulate a PIC microcontroller using Proteus

I wrote a simple assembly program and the uploaded it to the PIC16F1939 in the laboratory, and everything worked just as as expected (the LEDs blinked as they were supposed to). However, I tried ...
1
vote
1answer
512 views

ARM assembly - Addition of specific bytes from word-size values

I'm trying to code a way to add specific halfwords from word-sized numbers in the ARM assembly language. For example, lets say I want to add the first 4 digits of r0=0x3B029BA1 and r1=0x0B54A361 or ...
3
votes
1answer
2k 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
976 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
120 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
739 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
159 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
164 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
4answers
5k 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
2k 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 j ...
1
vote
1answer
700 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
602 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
167 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
220 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
564 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
389 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,...
5
votes
1answer
5k 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
142 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 ...

1 2 3
4
5
9