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
10
votes
3answers
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 ...
0
votes
1answer
46 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 ...
-1
votes
1answer
45 views

Solar tracking using a helicopter blade control [closed]

I've been trying to build a dual-axis solar tracker but the ones I saw needed linear actuators. I'm thinking how about using SG100 servos with the concept of blade control in helicopters to build the ...
2
votes
3answers
2k views

How do I perform division of two numbers in PIC16F877A in assembly language?

I'm currently using MPLABX IDE to develop for a PIC16F877A microcontroller. I want to divide two numbers and find out the quotient (let the two numbers be 10 and 4) and store in a register. I was ...
0
votes
0answers
44 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
45 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
1answer
729 views

beq assembly MIPS

I'm so confused about beq function in assembly MIPS. Lets assume I have beq $t1 $t2 60 , so it would be mapped as I type function. so we could say for example ...
1
vote
3answers
89 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
57 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
38 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
65 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
39 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 ...
2
votes
2answers
83 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
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 ...
-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->...
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

AVR Assembly - Operations with two 8-bit registers in 16-bit

...
1
vote
2answers
46 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
45 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
160 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. ...
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
53 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. ...
6
votes
1answer
112 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 ...
1
vote
1answer
430 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!
-7
votes
1answer
110 views

Where can I learn assembly? [closed]

I am a student and didn’t find any proper video even on YouTube for this. So, Where can I learn Assembly Language Programming for the 8085 Microprocessor? It would be very helpful if someone would ...
-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
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 ...
-8
votes
2answers
130 views

What is DIP (dual inline package)? [closed]

I searched on the net, but couldn't understand what DIP is. Is it RAM?
-1
votes
1answer
270 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
51 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 ...
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 &...
-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 ...
-2
votes
1answer
90 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) ...
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
1
vote
0answers
105 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 ...
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. ...
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 ...
1
vote
1answer
30 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
119 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
63 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
968 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
1answer
286 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 ...
1
vote
2answers
3k views

How to build the simplest assembly file in MPLabX IDE 5.4

I just started learning assembly coding in MPLabX IDE 5.4. Without connecting any hardware, simulator or debugger, I simply want to build an object code file and generate a listing file from an ...
0
votes
2answers
467 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" (...
1
vote
2answers
128 views

ATmega2560 I2C (TWI) assembler configuration problems

I am using ATmega2560 for testing an I2C code. I wrote subrutines in assembler for init, start, write, read and stop the I2C setup. The goal is that master writes 11110000 to a slave with address ...

1
2 3 4 5
9