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
2 votes
1 answer
63 views

PIC assembler to perform arithmetic on 10-bit number spanning 2 registers

I wondered if there was any 'clever' way of decrementing a 10-bit value which is stored across 2 registers. In this case, its the PWM duty cycle value which has its 8 MSB in PWM1DCH and its 2 LSB in ...
NomadAU's user avatar
  • 183
0 votes
0 answers
27 views

Confusion about the Link Register content during exceptions in ARM

I can't understand how the link register of the exception mode is updated during the exception. Why for the SVC, Prefetch Abort and Undefined Instruction, the LR is having PC + 4 but for the Data ...
Emad Kheyroddin's user avatar
3 votes
3 answers
334 views

Is assembly microarchitecture dependent?

Many microarchitectures can implement a given digital system architecture. For example, and as Weste and Harris explain in their CMOS VLSI Design, Digital VLSI design is often partitioned into five ...
EE18's user avatar
  • 1,033
1 vote
0 answers
116 views

Understanding the 20-Bit Addressing in 8086 Memory Architecture: Why Not 18 Bits for Base and 16 Bits for Offset?

I'm curious about the memory addressing in the 8086 microprocessor. Given that there are four segments and 16 bits for the offset address, the total address space is 20 bits. I'm wondering why there's ...
Emad Kheyroddin's user avatar
2 votes
2 answers
54 views

I2C BME688 Read Request Sent, but no data received

As the title suggests, im interfacing with the BME688 using I2C. The signal I captured using my logic analyzer is shown below. The slave address is 0x76 and register address im trying to read is 0xD0. ...
lrdewaal's user avatar
1 vote
3 answers
291 views

Why use bytes instead of words for offsets in 'lw' and 'sw' instructions?

In assembly language, there are instructions like 'lw' (load word) and 'lb' (load byte). Both of these instructions involve adding an offset to a base address. It seems counterintuitive, however, that ...
Emad Kheyroddin's user avatar
0 votes
1 answer
40 views

Is it possible to force an input port during debugging in MPLAB IDE v8?

I am using MPLAB IDE v8 (not IDE X) to write some PIC programs (PIC18F4321) in assembly. I am using the debugging tool MPLAB SIM to debug the programs, however I am not able to force port bits from ...
bardulia's user avatar
  • 403
0 votes
0 answers
53 views

Why does a PCB with metallic Faceplate on a BLDC motor assembly creates a unit failure?

I am building a new BLDC stirrer unit which has metallic enclosures and a metallic faceplate for thermal dissipation. The unit fails often and would not run. I opened the unit to see if it was a loose ...
Adithi's user avatar
  • 1
1 vote
2 answers
239 views

Assembly: AVR Studio alternatives for Linux [closed]

I had been using using AVR Studio on Windows to write assembly code for my MCUs (mainly for atmega8515) for a couple years. However, recently I transitioned to Linux and turns out there aren't any ...
Heather7283's user avatar
1 vote
0 answers
64 views

6502 Extra Cycles on Page Cross

On the 6502 processor, when using the Absolute,X, Absolute,Y or (Indirect),Y addressing ...
Macmade's user avatar
  • 291
3 votes
1 answer
280 views

Are `call` and `return` usually instructions in a modern ISA?

I've been working through the problems in a game based around building a Turing Complete machine. One of the final problems asks you to implement the call and ...
Connor's user avatar
  • 389
-1 votes
1 answer
157 views

What are the steps an 8-bit processor must perform to read/write an integer variable in memory?

What are the steps an 8-bit processor must perform to read/write an integer variable in memory? Consider I have written C code for ATmega128. What exactly are the steps involved for the compiler to ...
Creator's user avatar
  • 147
1 vote
1 answer
65 views

Seeking clarification on equation used in MIPS assembly problem

I'm currently studying MIPS assembly code, and I'm having trouble understanding the solution for question (b) of a particular problem. I was hoping someone could help me clarify a specific part of the ...
Frank's user avatar
  • 11
4 votes
3 answers
978 views

How can I do immediate addition in the Atmel AVR instruction set?

I've been doing some AVR assembly programming for a university course, and I recently happened upon a situation where I would have wanted an "add immediate" instruction. However, no such ...
Newbyte's user avatar
  • 193
1 vote
2 answers
65 views

VL53L0X Assembly Soldering Problem

We have a product(PCB) in mass production as using VL53L0X. There is a problem with some of our products. We tested before sending customer. There is no problem. But, over time we have received ...
FAFİ's user avatar
  • 51
4 votes
2 answers
787 views

Logic value of a single input pin into a microcontroller

I'm trying to get the logic value from a node in a circuit (it is the output of a comparator that can either be 0V or 5V) into an AT89S51 microcontroller. My program just tries to get the value of pin ...
ludicrous's user avatar
  • 1,103
1 vote
1 answer
105 views

Microcontroller not blinking LED

I want to check if my microcontroller is working. It's the first time I'm working with microcontrollers. I followed this tutorial to blink a LED at the P1.0 pin, but nothing is happening. My ...
ludicrous's user avatar
  • 1,103
1 vote
1 answer
140 views

Why do we shift by three in RISC-V loops?

In this youtube video, the instructor explained some basic code in RISC-V assembly, but i didn't understand why in the first line, he is shifting i by 3. Why do we have to multiply it by 8?? I feel ...
Shinobi San's user avatar
0 votes
0 answers
170 views

Need help with implementing beq instruction control signals

I'm currently working on an Assignment, and I'm unsure if I did everything right, for example implementing the control signals for the beq instruction. I have added the required signals to the Control ...
mrAnonymous's user avatar
1 vote
1 answer
395 views

Understanding assembly code for LED blink with ATmega328P

I wrote the following program to turn an LED on and off at 1-second intervals: ...
kovac's user avatar
  • 473
0 votes
1 answer
49 views

Designing instruction emulating swap on a MIPS ISA with only 2 registers

In a typical MIPS ISA, you have only 2 working registers. But you have a large number of ALU units. How to design an instruction to emulate swap?
Nidhi's user avatar
  • 87
3 votes
5 answers
4k views

How to program the CPU when making a small microcomputer?

I'm trying to make a small microcomputer from individual parts, but I'm having a hard time understanding how to load code onto the processor to be able to run it and do something. Attached is my ...
Jeremys556's user avatar
0 votes
0 answers
306 views

Help needed with solving MIPS jump instruction encoding question

I am currently working on a project that involves understanding the encoding of MIPS assembly instructions and I am struggling with a question that I hope someone here can help me with. The question ...
Bryan C's user avatar
  • 17
1 vote
3 answers
171 views

How to get output from an ATTINY12L microcontroller

So far I have only worked with ATmega32 chips, programming them in C. Now I have to work with an ATTINY12, which can only be programmed in ASM. As a proof of concept, I wrote a simple program that ...
Demento's user avatar
  • 121
4 votes
6 answers
587 views

What address does it save in EEPROM?

I watched Ben eater's video about a building computer based on 6502 microprocessor and I'm stuck at Part-3 ( Assembly language VS Machine code). He was programing a 32k AT28C256 EEPROM and he ...
Heroz's user avatar
  • 431
0 votes
0 answers
114 views

--fixupoverflow=warn is being ignored by the MPLAB X Linker

I have tried several hours worth of variations and I am at my wit's end on this one. The MPLAB-XC8-PIC-Assembler-User-Guide-50002974 clearly states: The --fixupoverflow option customizes the action ...
Scott Savage's user avatar
3 votes
0 answers
229 views

How to using JAL in RISCV in this example?

Write a "replace" function that replaces every character in the source string between the first occurrence of character "(" and the first following ")" with character &...
黑旗Vlland's user avatar
9 votes
4 answers
2k views

Upload ASM code on Intel 8086 chip

I have been struggling to find a method to actually run any assembly code on my 8086 chip. I have an 8086 chip and I am trying to implement it on hardware to power up a LED or anything simple. On ...
Mora's user avatar
  • 179
-5 votes
1 answer
112 views

How to read HLDA pin DMA Controller 8237 with Assembly Codes [closed]

I trying to read HLDA Pin in 8237. But i can not find a literature(s) about it in Internet. In Assembliy codes. The circuits is use for i/o cards in PCI or ISA BUS. addeds DMA Process with all. I use ...
adhitronic's user avatar
0 votes
0 answers
89 views

SPI interfacing a sensor doesn't seem to work

I'm trying to get a feeling for how the SPI protocol works. I built this cirucit using Proteus simulator. simulate this circuit – Schematic created using CircuitLab And then according to the ...
Ait-Gacem Nabil's user avatar
-2 votes
2 answers
111 views

Drivers in C++ produces bigger assembly [closed]

I'm trying to figure out whether C++ is a suitable language for use in device drivers, like peripherals on Cortex-M3/M4. I started writing some drivers for GPIO and I noticed that it produces bigger ...
blinkbetter's user avatar
0 votes
0 answers
64 views

Using SUB with values higher than 128 in an 8 bit system

how does the SUB instruction work in AVR assembly? does it take the twos compliment and add it or does it function differently? If I subtract two 8- bit numbers, say 1 - 2 and the answer is -1, should ...
Tzanker's user avatar
  • 139
1 vote
2 answers
1k views

How is sll implemented in MIPS?

I don't understand how MIPS would implement the sll (shift left logical) instruction using the hardware present in its ALU as shown in the diagrams below. Would ...
kene02's user avatar
  • 538
1 vote
2 answers
102 views

How do I exit (Microchip Pic18fxxxx rs232 BTFSS PIR1,RCIF) Loop when no data is present (Assembly Mplab Mpasm)

...
user66377's user avatar
  • 570
1 vote
0 answers
61 views

Is 35g/in^2 a good "rule" to use for upside down reflow surface tension?

I have one assembler that gave me their "rule" of 35g/in^2 for reflow parts falling off upside down or successfully hanging on. Are there any sources that point to this being any more than ...
mint branch conditioner's user avatar
2 votes
1 answer
134 views

Strange ATmega32 behavior with assembly code

I posted a kind of similar question recently, but it was not that organized, so here I am trying again :) I wrote this short assembly code to blink an LED at different intervals depending on the state ...
Seif_1999's user avatar
-1 votes
1 answer
323 views

12 bit vs 10 bit ADC PIC18f [closed]

Convert 12 bits adc to 10 bit adc. We know that the resolution of the step size for a 12 bit is 1.22, different than the step size of 4.88 of the 10 bit. We need to take into account the extra 2 bits. ...
Citi's user avatar
  • 161
0 votes
2 answers
144 views

Problem interfacing stepper motor with Atmega 32

I have been trying to interface a bipolar stepper motor with an ATmega32 controller using AVR assembly, but it just keeps clicking without movement or just move back and forth in the same step. Here ...
Seif_1999's user avatar
-1 votes
3 answers
332 views

8051 seven segment 1-9, and reset to 0

This is a university assignment, last part of 3. I cannot find any useful notes describing looping in the 8051 assembly language in the course resources, and the lecturer isn't replying to questions. ...
EmptyAtoms's user avatar
0 votes
1 answer
227 views

Programming an old school microcontroller (MSM80C49 from OKI semiconductor)

I've read the whole datasheet, there's no typical guidance on programming procedure/setup/circuitry. It just mentions a few steps on how to order pre-programmed chips. (I guess) on page 18. On a ...
Elementronics's user avatar
2 votes
2 answers
166 views

How to draw detailed assembly outline

How do you draw this detailed mechanical/assembly outline? I saw this at this pdf from Altium https://resources.altium.com/sites/default/files/uberflip_docs/file_1195.pdf
maaaaple7's user avatar
  • 103
0 votes
1 answer
191 views

How do we specify the signal frequency while interfacing DAC 0800 with 8086?

I am relatively new to Microprocessors and just started with my uni course on the same. My faculty while discussing the question: gave us the following solution: What I don't understand here is how ...
Sarthak Srivastava's user avatar
4 votes
1 answer
289 views

How to minimize microcode complexity in 8-bit home-brew CPU

tldr; I built and later extended Ben Eaters 8-bit breadboard computer. After the initial build I integrated 16-bit program counter and memory address registers, redesigned the instruction set and ...
Scott vanVoss's user avatar
1 vote
2 answers
185 views

An Assembler for STM32 and compatible with Ubuntu [closed]

I'm new to STM32. I want to learn the architecture of STM32 using assembly language. but Keil microVision MDK-ARM is not Linux compatible. What is the alternative of Keil to write an assembly code for ...
Kiroloes Amir's user avatar
0 votes
2 answers
891 views

ARM asssembler: rotation of bits in immediate value

Consider MVN r3,#0xFFFF807F Is this an invalid instruction from ARM? Since MVN is simply the complement, it equates to ...
Meep's user avatar
  • 375
0 votes
3 answers
665 views

ARM How to invoke branching?

Was looking through a code with regards to loop. ...
Meep's user avatar
  • 375
3 votes
1 answer
350 views

ARM Assembly Code

Here's an assembly program given to me, and I'm not sure how the program goes through. ...
Meep's user avatar
  • 375
1 vote
1 answer
318 views

Frequency counting program - Timers in 8051

...
Sayan's user avatar
  • 729
10 votes
3 answers
2k views

How does an operating system or program detect the CPU model name? [closed]

What kind of binary compatibility is present for 2 processors sharing an Instruction Set?. I had asked a question on Computer Science Stack Exchange, to which I got an answer which said: As a trivial ...
Shashank V M's user avatar
  • 2,311
1 vote
1 answer
4k views

Store byte instruction in RISC-V assembly

I have a short snippet of RISC-V assembly that I'm having trouble understanding. I'm not sure if I'm interpreting the instructions wrong, from my interpretation it seems as if the branch (BNE) will be ...
jhe4x's user avatar
  • 13

1
2 3 4 5
10