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.

2
votes
2answers
46 views

Problem in Clock Gating Control with ARM Tiva C

When I access a peripheral register (such as a GPIO port) just after enabling the clock gating of the peripheral, a hard fault happens. For example: This code doesn't work (generates a hard fault): <...
1
vote
1answer
28 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
vote
3answers
72 views

How to look at the emitted assembly code of MPLAB X IDE

I'm using MPLAB X IDE V5.05 to generate the code to program a PIC32MX470F512L. It happens that i'm having some problems in the code and i would want to take a look ...
1
vote
1answer
77 views

Assembly language, accessing bytes of memory

I have some memory address 0x00000100 that I want to read from. The lower 4 bits read from this address indicates the states of 4 buttons - So bit 0 shows the state of button 0, bit 1 shows the state ...
-3
votes
0answers
44 views

What is the corresponding MIPS code? [duplicate]

Assume that variables f, g, h, i and j are assigned to registers $s0, $s1, $s2, $s3 and $s4, respectively. Also, assume that the base address of the arrays A and B are in registers $s6 and $s7. ...
0
votes
0answers
42 views

Is my assembly code in MIPS correct?

I've started studying assembly, and I'm trying 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 are ...
0
votes
1answer
30 views

Logisim input and terminal issue

I had this final gate that I made. but when I run it in terminal. it says my output is E instead of 0/1. I wanna know why my output is E instead of 0/1. The circuit should have four inputs: A, B, C, ...
0
votes
1answer
33 views

Is Pull-up present by default?

I'm using the MC9S12DP512, Motorola's microcontroller. I was executing a service and ,at the end, I put low logic level at the pins PS4, PS5 and PS6, then after that, I configured these pins as inputs....
3
votes
1answer
124 views

As a computer science engineering graduate, do I need to learn Assembly language in today's day and age? [closed]

Given that there are simple and easy to learn/use MCU devices such as those offered by Arduino, Particle, TI (MSP430 series), Microchip (PIC16 series) does it make sense to teach ALP to computer ...
0
votes
0answers
47 views

Assembler program showing ACK even with the wrong slave address, I2C code problem!

I have this project communicating MPR121 capacitive touch sensing keyboard with 8051 microcontroller, with some references I've implemented some I2C code for serial communication between master and ...
1
vote
1answer
46 views

How to check the flow of assembler instructions execution?

I'm creating a project that uses I2C serial communication in assembler and I'm having some issues transmitting data and receiving back so I thought I should somehow debug the whole program, besides ...
1
vote
2answers
144 views

How to check whether a byte of 8 bits contains 1, assembler 8051?

I need to know how to check whether a byte contains a 1 for touch status in a MPR121 project, so if: 00000010 then pin 2 is touched 00000100 then pin 3 is touched How can I detect it? A ...
0
votes
1answer
58 views

[Updated]How to select the values to move in assembler?

I'm trying to make the led blinks on the tm4c1294ncpdt, so the basic idea its to make 2 routines , one to select the GPIO port (in this case the F) and other to keep up on and off. the setup routine ...
17
votes
4answers
3k views

What stops an assembly program from crashing the operating system? [closed]

First of all, I am a beginner, so if this question sounds silly, please point out the incorrect assumptions. From what I understand, the job of an operating system is to manage hardware and the ...
0
votes
0answers
101 views

Branch offset out of range ARM assembly

So I tried compiling this code below but keep getting the 1176E error message of Branch offset out of range 0xFFFFFFE8 out of range permitted values are up to 0x00007E on the 5th code line. I ...
0
votes
1answer
100 views

TMOD value for timer 1 in mode 0 in 8051 microcontroller

What will be result of this statement: MOV TMOD,#00H Will it set it to timer 0 in mode 0 or to timer 1 in mode 0? Other statements like: ...
0
votes
1answer
85 views

What is the XTAL clock used for in an 8051 microntroller?

I'm trying to design an 8051 microcontroller circuit which uses timers/counters, and the circuit I'm using for inspiration uses a clock generated using the XTAL1 and XTAL2 pins of the IC, shown in the ...
0
votes
1answer
38 views

Built-in Timer Module HCS12

Why is it preferable to use the built-in timer module rather than using assembly language coding to create delay loops? I've gone through the entire "HCS12 Microcontroller and Embedded Systems" book,...
0
votes
1answer
44 views

Can you speed up debugging in Renesas High Performance Embedded Workshop by not flashing after breakpoint

I am debugging an H8S MCU in Renesas High Performance Embedded Workshop 4 with the attached E10A emulator, and find it's very slow when stepping through code because it keeps reflashing the chip ...
2
votes
2answers
167 views

Cortex M7 goes to HardFault immediately after reset

I am using the ATSAME70Q21 processor with a Cortex-M7 CPU. My development environment is Atmel Studio 7. I am using the SAME70 XPlained demo board. I am creating some code in assembly language. As ...
0
votes
1answer
62 views

.dw directive in AVR assembler

the piece of code below is mentioned in 8-bit AVR's instruction set as an example to explain the LPM instruction. ...
7
votes
1answer
576 views

What does [WEAK] mean in STM32 startup assembly code?

I was reading the STM32F407 startup file in Keil software to gather some information. I faced this problem: What is the [WEAK] symbol used for? A part of the code ...
7
votes
1answer
1k views

How to produce a middle C on intel 8080?

This is a example problem in my book. Assuming pin 5 of port 4 is connected to an amplifier that drives a loudspeaker, the solution is given as, The frequency of middle C is $$f=261.63\ \text{Hz}$$ ...
-1
votes
2answers
125 views

How do we find the bandwidth of a bus?

The data width and cycle rate are used to determine the bandwidth, or the total amount of data that the bus can transmit. An 8-bit bus (1-byte data width) that operates at a cycle rate of 1,000 MHz (1,...
-9
votes
2answers
97 views

DIP (dual inline package) [closed]

searching on the net, but couldnt understand for what is used DIP? Is it RAM? Will be glad for your answers.
1
vote
1answer
1k views

store word assembly instruction in risc-v

I'm really confused about the store instruction in risc-v. When I store word from register to memory, after the word is copied into the mem, does it sign-extended or zero-extended or perhaps something ...
0
votes
2answers
473 views

How to load immediate negative value in a register?

For example on 8-bit AVR given a register r16 I do something like ldi r16, 44 and this way I can give it positive values from 0 ...
3
votes
2answers
218 views

Understanding ARM instruction for numerical literal

I have done an instruction trace while trying to find a bug on a Cortex M3. There is one part of the command I cannot understand. STRB R1, [R3], #+0x01 According ...
1
vote
1answer
78 views

ATTiny414 inline assembly operand constraints for IO pin parameter

I'm trying to use the light_ws2812 library to drive WS2812 LEDs from an ATTiny414. The core of that library is an inline assembly snippet that bitbangs the serial line. here it is with the timing-nops ...
0
votes
3answers
147 views

Why do we need to declare ports as input/output?

I am writing code in assembly language (AT89s51). When I see a standard program, the ports are typically defined as inputs or outputs. But, without defining them it seems to work fine. How is this ...
0
votes
2answers
70 views

How a Computer Represents a Number Electronically

I understand how computers represent decimal numbers using binary. I have yet to absorb this video on how computers add numbers, which looks helpful. Before understanding that though, I would like to ...
1
vote
1answer
165 views

AVR-GCC initialization code

Consider the following asm.S .global main main: rjmp main Compile and dump it with these commands: ...
-4
votes
2answers
80 views

For the first prototype, how many pieces are necessary? Includes 256BGA, SMA, SDRAM

I'll most likely need to re-run. For the first batch of prototype, what is the safest number? Ordered 10pcs of PCBs and ordered 10x components.
0
votes
0answers
532 views

Servo motor interfacing with 8051 by assembly language

I know the principles of servo motor and programming it, I already done it with FPGA and adjusted the PWM like I wanted. But with 8051 assembly, I can't do the PWM or generate the 20 ms for the motors....
0
votes
0answers
41 views

MPLAB strange code jumps

I am writing assembly code for the 16F84A microcontroller and have run into some issues. I've implemented a 1 second time delay code which repeats itself consecutively for a total of 3 seconds, ...
2
votes
1answer
169 views

Why am I not able to compile this assembly code?

When assembling the code, I get the error : fpu.s(13): error: A1240E: Immediate value cannot be used with this operation ...
1
vote
3answers
781 views

AVR assembly language on Division

how do i performs a division by 4 of the 16-bit unsigned value in registers r4:r5 Where r4 is the most significant bit. I understand that by division of 4 which means i have to shift the bit by 2. ...
1
vote
1answer
46 views

xorwf literal not affecting z flag even when literal value is same as value in w

According to Instruction Set Description "xorwf myLiteral" should xor contents of "w" with "myLiteral" and if both are same then flag Z in STATUS must be set (not interested where this instruction ...
0
votes
1answer
307 views

PIC18F452 interfacing with HD44780 LCD in assembly

I have been trying to get a Hitachi HD44780 LCD to work with my PIC18F452 for a few days now, with no luck. I have tried moving the data lines to different ports on the microchip, I've tried ...
2
votes
2answers
315 views

Unsigned 32-bit multiply in AVR assembly

How do I perform a multiplication by 2 of the unsigned 32-bit quantity in registers r18:r19:r20:r21 where r18 is the most ...
1
vote
2answers
319 views

24-bit two's complement division in AVR assembly

How do I perform a division by 2 of the 24-bit two's complement value in registers r6:r5:r4. (r6 is the most significant byte.) From what I have this is what I tried: ...
0
votes
1answer
43 views

Micro-controller: External Interrupt “ RBIE ”

I'm working on a little project using micro controllers (PIC 16f84A) and got stuck at a point. I have 4 switches and those are the external interrupts now the idea is I don't understand how can I know ...
0
votes
2answers
54 views

Loop on flash memory

I have flash memory that I write assembly code on it. I know that flash has limit cycle ( read/ write) If I write a loop that run 100,000,000 times like ...
0
votes
1answer
100 views

What is the Microcode in the Intel's Linux Microcode update?

I am a bit confused as to the use of the word microcode in the following links: https://downloadcenter.intel.com/download/27591/Linux-Processor-Microcode-Data-File?product=873 https://newsroom.intel....
0
votes
3answers
103 views

IT TTT block in assembly language

Why do we have four instructions in IT block for Cortex M4 processor? Is it related to the fact that we have three pipelines for ARM assembly instructions?
1
vote
1answer
792 views

Character '0' used but not declared for type std_logic_vector??? (Algorithm state machine)

After adding the counter to my VHDL code am getting the following error: Error (10316): VHDL error at ASM.vhd(31): character ''0'' used but not declared for type "std_logic_vector" Thank you Code: <...
1
vote
1answer
145 views

VHDL Algorithm state machine output

...
1
vote
2answers
217 views

Where is the location of display buffer on a computer board? [closed]

On an OS development text by Nick Blundel, at chapter 4.1 titled Adapting to Life Without BIOS, it is explained that while graphics hardware is in text-mode, we can write ASCII characters on screen by ...
2
votes
1answer
70 views

How close can BGA packages be placed to each other? [closed]

I'm wondering if there is some rule of thumb about how close different BGA packages can be placed to each other. What limits that besides pick and place accuracy? I'll ask a few board assembly ...
5
votes
1answer
552 views

Why doesn't my VGA implementation using an AVR microcontroller work?

Problem I'm trying to generate the appropriate signal output for interfacing an AVR ATmega328P microcontroller with an LCD monitor, via the VGA specification. The VGA specification I am trying to ...