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
0answers
37 views

Battery made of Li-ion cells assembly

Do you see any issue (feasability, safery, ...) about assembling a battery pack with 10 Li-ion 3.7V 2600mAh cells (put in parallel) having their own individual protection circuits (overcharge and over ...
0
votes
0answers
44 views

Read after Write and Write after write dependencie at the same time

Assuming the following pseudo-code down bellow: 1)r1 = 4 2)r2 = 5 3)r3 = r1 + 5 4)r4 = r2 + r1 5)r4 = r4 + r3 6)r1 = 10 7)r7 = r1 - 1 the r4 on line 5 is both name ...
1
vote
3answers
87 views

4-bit mode of LCD-1602 using 8052 µc

I try writing "NO" in the LCD using 4-bit mode. So, I programmed the AT89S52 to send the upper nibble first to the last 4 data inputs of the LCD. I used AND operation to eliminate the lower ...
0
votes
0answers
56 views

Indirect addressing on an assembly program with RAM locations

Here, I have written a indirect addressing assembly program (with PIC18) to copy following to RAM locations 10H to 16H. (It says MERHABA in turkish (means hello) But, I am not sure that the part of my ...
0
votes
2answers
37 views

AVR “OUT” function. addressing port without constant

I am currently writing some assembly code that needs to address different I/O ports at certain times in my code. For example, at one point I may want to address PORTD4, and at another point I may want ...
1
vote
1answer
64 views

Is the following 8085-based design I/O mapped or memory mapped?

The above picture is an 8085-based system schematic used for undergrad courses at the laboratory. Now at first sight it seems that the 8085 in the circuit is isolated mapped IO since it uses the IO/M' ...
0
votes
1answer
20 views

ST instruction of avr in microchip stuio (avr studio) nor working as expected

I am trying to understand indirect addressing in avr and tried the following code : ldi r31, 0x28 ldi r26, 0x2c ldi r27, 0x00 st X+, r31 when r26 and r27 are ...
0
votes
0answers
38 views

Offset of bnez in RISC-V program

I came across a question about assembly that I was confused on. We are given the following table for addresses and instructions: The question says: replace the labels of PC-relative targets with ...
0
votes
1answer
57 views

Going below the bottom of the stack in ATmega328P

I'm working with an AVR based project and just have one curiosity. The ATmega328P has total 2kB of SRAM. The lowest address of the stack can be 0x8FF. Now suppose the stack pointer is at 0x8FF. What ...
2
votes
2answers
80 views

Microchip's pic-as throws syntax error on macro define

I have a file with a name like xxxx.asm in it I have: InitPORTA MACRO pic-as throws a syntax error on this line. The code ...
0
votes
0answers
25 views

AVR Assembly - Operations with two 8-bit registers in 16-bit two complement negative values

I have this code in which I try to multiply the given number by 4. I have two variants and that is that it is negative and positive, but it doesn't work for negative values, you don't know why? ...
0
votes
1answer
52 views
-5
votes
1answer
96 views

Hi everyone, do somebody have experience with usb on assembly level for stm32? [closed]

Need a help with enumeration process, can't receive set_address from hub (PC). when answering to get device descriptor, getting reset but no set_address request only zero-length PKTSTS_SETUP_COMP->...
1
vote
2answers
42 views

BANKSEL problem with PIC16F18855

I'm working with PIC16F18855 and have some problem with select memory bank via BANKSEL. In listing I see strange message and it's not working properly. ...
0
votes
0answers
40 views

Help in understanding Store Word (SW) instruction in Risc-V

So this is what I understood from what my professor said, but I don't think it's the right answer. What am I doing wrong? I'm sure It's just some small thing that I'm getting mixed up. Given ...
0
votes
1answer
41 views

Help understanding ARM Cortex-M4 SBC instruction

Page 88 of the ARM Cortex-M4 Generic User Guide says "The SBC instruction subtracts the value of Operand2 from the value in Rn. If the carry flag is CLEAR, the result is reduced by one." Why ...
0
votes
0answers
52 views

Why the assembly code does not match the number of cycles of ARM M4?

I ran the following C program on STM32F405 (ARM Cortex-m4). I tried to comprehend its computation period instruction-by-instruction. ...
1
vote
1answer
304 views

What is the difference in RISCV between JAL and JALR?

I'm kinda confused on what the difference is between the two instructions and would love a comparison of the two!
-5
votes
1answer
87 views

Two microprocessors with same machine language and different assembly language [closed]

I need to find two microprocessors that have same machine language but different assembly language.
0
votes
1answer
137 views

PIC10F200 - blinking LED (pic-as) - Assembly

The code below worked for my 10F206, but now I use a 10F200 and for some reason the led does not blink anymore. (compiler: pic-as 2.30, IDE: MPLAB X IDE 5.40) It compiles but the led stays off. ...
-1
votes
1answer
228 views

RISC-V assembly lui?

In RISC-V assembly I wrote: addi s0,x0,0x20000 Is this legal such that the assembler will prove the command and make it work right or I'm forced to change it to: <...
0
votes
0answers
49 views

Why we can't do forward in RiscV?

While studying forwarding in RiscV cpu I saw the following claim: But I can't understand why we can't do forward in this case, why in different conditions we were able to do this and now we can't? It ...
6
votes
1answer
102 views

ARM Cortex-M4 VFMA (fused multiply-add) performance? 3, 2 or 1 clock? Forwarding?

I am working on some performance-critical DSP code destined to run on an ARM Cortex-M4. One particular section of the code (a sinc interpolation function) is dense with multiply-accumulate operations ...
-2
votes
1answer
83 views

RiscV assembly, function arguments

I learnt that in RiscV assembly we save function arguments in registers s0,...,s7 but what if I had more that 8 arguments? Plus what about the case where I have more than 32 arguments (let's say 40) ...
-1
votes
4answers
154 views

Why is bool type typically 1 byte long?

I was reading: https://www.quora.com/Why-is-the-bool-type-typically-8-bits-long And the answer was: Because it’s the smallest type that has an individual memory address so that you can take a pointer ...
0
votes
0answers
56 views

How to assess worst case runtime and correctness of an assembly implementation?

Set off by a question on CodeReview, I revisited "8-bit AVR unsigned division". Trying much the same as for below 8 bit/8 bit → Q, R implementation, I found assessment of cycle counts of an &...
3
votes
1answer
96 views

How can I improve my LED display code so that it reacts in real time

This is a carry on question from my previous one and I was wondering how I can go about improving my code, which currently has an extreme delay in outputting the numbers to the display and also not ...
1
vote
0answers
40 views

How can I exit my lookup table routine with the desired value?

How can I get my code to work correctly when I include ADC conversion in it? I have a working code that displays two digits on 2 LED displays using a p16f1829. However, a problem arises when I try to ...
-3
votes
1answer
66 views

Use 3 buttons on PIC16f877a assembly

...
1
vote
0answers
104 views

How can I improve my buzzer application using a PIC16F1829

I am trying to improve my assembly code (see below) for PIC16F1829 by using a macro to set up the parameters to play an audible sound. My previous attempt had used a macro BEEP, which has now been ...
14
votes
2answers
2k views

Fiducial marks: Do they need to be a pad or is it okay if I use the top silk layer?

I have been advised by a more experienced engineer to integrate fiducial marks on my designs for P&P automatic assembly referencing, but he didn't say how to do it exactly. I googled it, and I see ...
0
votes
2answers
2k views

Assembly code, what does it do?

I'm interested to know what this assembly code do knowing that X1 is full of zeroes. ...
1
vote
1answer
29 views

Will assigning a value to the W-reg in PIC16F84A during an interrupt, save it after the interrupt is disabled?

Okay so, I'm having this part of my program that needs a value to be checked to continue. basically, here is what it is doing: ...
0
votes
1answer
116 views

How to use PIC16F84A TMR0 Interrupt as a substitute to the Sleep instruction in Assembly

I have this circuit: So my problem is that I'm having trouble using the TMR0 interrupt as a delay or substitute to the SLEEP instruction in the PIC16F84A. I can't quite get the concept of using the ...
0
votes
1answer
105 views

What is the fastest (in clock cycles) 16-bit x 16-bit unsigned integer division algorithm that will run on an ATMEGA1284?

What is the fastest (in clock cycles) division algorithm that will run on an ATMEGA1284? The dividend is an unsigned 16-bit number passed into the algorithm in a pair of 8-bit registers. The divisor ...
0
votes
1answer
62 views

Why is OUT0 incorrect?

The input frequency is 2 MHz and the output should be 2 kHz since I used mode 3 and the initial count value N=1000d. The output frequency is 500kHz.
0
votes
1answer
277 views

Ethernet Communication with Microcontroller

I am trying to make Ethernet communication with MCU. To make this happen, I need MCU(in this case AT89C2051), Ethernet Controller ( ENC28J60), and a RJ45. However the microcontroller that I selected ...
0
votes
0answers
38 views

How do you do Electro-mechanical Assembly Documentation?

I realize this isn't specifically EE theory related, but I hope EE documentation advice falls within the scope of this forum! For example, I have an enclosure from a mechanical engineer, and their ...
0
votes
2answers
435 views

What does JB instruction mean in Assembly

I am looking at an ST7066U controller for a 2x16 LCD, and in their datasheet, they have these Assembly instructions that I would like to change to C code. ...
2
votes
0answers
32 views

How to safely set/clear only some bits of SCB->SHCSR on ARM Cortex-M processors?

On p. 265 of the third edition of Joseph Yiu's The Definitive Guide to Arm Cortex-M3 and Cortex-M4 Processors, there is some discussion about the "system handler control and state register" (...
2
votes
1answer
74 views

What is “activity” in solder flux?

I'm trying to select a solder flux and so many references (and one or two SE questions) discuss the types and differences. They mention "activity", such as "Rosin Activated (RA) flux ...
2
votes
1answer
61 views

How to know component's offset when making custom footprint

First of all, I'm using KiCAD, but I guess the same problematic exists in any layout software. When I need to create a custom footprint for an SMD component, I only set the coordinates of whatever ...
0
votes
1answer
69 views

imm8 in ARM data-processing instruction

In ARM, Data-processing instructions have an unusual immediate representation involving an 8-bit unsigned immediate, imm8, and a 4-bit rotation, rot. imm8 is rotated right by 2 × rot to create a 32-...
1
vote
1answer
64 views

Why does the AVR Assembler linker think my data table is at the wrong address?

MCU: ATmega1284 Programmer: JTAGICE3 IDE: Atmel Studio 7.0.2397 Language: AVR Assembler I have a constant data table in flash memory. The linker thinks it is located at address 0x0090, so when I ...
0
votes
1answer
287 views

Why is there no NOR with immediate value in MIPS? AKA NORI

One thing which got me thinking was the lack of NORI in MIPS. Is the argument similar to why there is no SUB for immediate values since it can be simulated with a different instruction? If so, how is ...
1
vote
1answer
78 views

Why does carry flag change from 1 to 0 after ADDS?

While doing my homework on ARM controllers and assembly programming, I stumbled upon a confusing question. So here's the line of code which I don't understand (there are other codes before and after ...
1
vote
1answer
248 views

Expression calculated at assembly time

I don't understand the explanation. Doesn't the assembler have to calculate 3 * 4 + 5 so it takes longer to execute? Also since 3 * 4 +5 has more characters why does it not take more storage? From ...
3
votes
1answer
64 views

AVR: do I have to wait for the internal pullup to stabilize?

speaking of an ATMega2560 (not Arduino!), I connected a simple push-button between PB6 and GND. There is a bootloader and ...
1
vote
0answers
106 views

Linking and the ELF - use of PC-relative addressing, GOT and PLT

So that we're on the same page, I'll try to explain what I think I know about Symbol Relocation and ask questions as they come up. Symbol Relocation: Absolute addresses – replace the reference for ...
0
votes
1answer
77 views

8051 initializing data in external memory

I am trying to understand the use of external memory with an 8051. When you are using external memory with something like C8051F962 where you have to configure the ports to access the memory, how do ...

1
2 3 4 5
9