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
1
vote
1answer
31 views

8051 to I2C backpack/4 bit LCD Byte Construct Probelms

Been feverishly writing bit bang code in assembly for this I2C backpack/4 bit LCD and dont quite understand the binary constructs I need to display text. Im trying to learn this the real way, not the ...
0
votes
0answers
31 views

Programming a PIC16F84A Microcontoller in assembly with MPLAB increment problem

I'm programming a PIC16F84A microcontroller to automatically increment a number with a 1 second delay, and get it displayed on a 7 Segment Display. The 7 segment display is already set so there's no ...
1
vote
0answers
45 views

How x86-64 Intel CPU understands how many bytes load into a register

I have the following byte code one the left and and its byte representation on the right: ...
1
vote
1answer
121 views
0
votes
1answer
42 views

Control systems composed of several different parts just as program blocks

We're having a course on System Software this semester and we're covering the chapter on Assemblers presently. Our professor gave us some questions to think about. One of them is this: Control ...
2
votes
2answers
29 views

AVR gcrt1.S behavior

So basically i have decompiled unoptimized simple program and saw that it runs through gcrt1.S, and i dived in to assembly language and tried to understand what exactly it does. here is my code and my ...
1
vote
1answer
79 views

PIC programming in Assembly

I went through an assembly program of the PIC16F88 downloaded from microchip and saw something that I have ever seen before ...
0
votes
1answer
104 views

How to “translate” to C the assembly command mov [closed]

I'm not sure how to understand the assembly command mov. e.g. in the following section: ...
0
votes
1answer
53 views

What commands in assembly cast value from hexa to decimal when they are called?

how can I know if a command is treating an immediate as a decimal or as a hexadecimal? For e.g div casts the values into decimal before it makes the arithmetic division: ...
0
votes
1answer
50 views

How does a number is saved in a register

I've tried looking online, but I still haven't quite figured it out - does a number, for example 0x100 saved in a register by some convention like little/big endian like thigs are saved in memory or ...
2
votes
2answers
242 views

How to use structures in 8086 (MASM)

Sample program to add two numbers using structures - ...
3
votes
1answer
109 views

8085; Why RET doesn't require a 6 T-states Fetch cycle?

The CALL instruction, requires 5 machine cycles, namely, OPCODE-FETCH, MEMORY READ, MEMORY READ, MEMORY WRITE, MEMORY WRITE. The ...
0
votes
0answers
47 views

8086 doesn't write to external memory [duplicate]

we are working on a circuit containing a 8086 and 8x(2KB) external memories (6116). the problem is that all control signals are asserted correctly, the address and data is provided but they are not ...
0
votes
1answer
236 views

Connect 8086 cpu to memory chips and io devices in proteus

I have a project based on simulating operation of 8086 processor with memory and I/O devices using Proteus simulator. Memory is eight 2K 6116 chips and I/O contains 2 seven-segment displays and a ...
1
vote
2answers
369 views

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

I'm currently using MPLab x IDE for PIC16F877A I want to divide two numbers and find out the quotient ( Let the two numbers be 10 and 4) and store in some register. I was thinking of a loop which ...
1
vote
2answers
176 views

What does _SFR_IO8(0x04) do? AVR

I'm trying to write a program in assembly to toggle the on-board LED of the Arduino MEGA2560. To do so I just have to indicate the direction of the pin (13 in this case which is PB7) as output and ...
0
votes
1answer
123 views

PIC Microcontroller ADC not functioning

I coded an assembly script to take the input values from two LDRs in parallel. Then my microcontroller was supposed to convert this analogue input into an 8-bit digital value (omitting the 2 LSBs). ...
4
votes
2answers
139 views

Back branches in code

While reading this file on software hazards this slide says: "No Back Branch in the Code" I wonder what does it mean? Normally when we write code in C-language then we don't actually do branching ...
1
vote
2answers
63 views

Load, then add in assembly

Im trying to load 2 values in assembly under the tm4c1294ntpcd (Cortex M4) then add it with the next code ...
-1
votes
3answers
114 views

Startup code in pure Assembly program [closed]

I came across some articles and books that saying when, I write in high-level language like C, startup code is used to prepare for my main code but when I write my program in pure Assembly there is no ...
0
votes
1answer
102 views

Using pointer of a function's returned value

I would like to know if there are possibilities to change the following code: ...
1
vote
1answer
430 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 ...
3
votes
2answers
75 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
2answers
72 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
330 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
80 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 ...
0
votes
1answer
205 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
39 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
133 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
1answer
121 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
48 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
266 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
67 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 ...
18
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
430 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
264 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
159 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
57 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
56 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 ...
3
votes
2answers
356 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
141 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
678 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
2k 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
393 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
108 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
3k 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
1k 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
601 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
138 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
254 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 ...

1
2 3 4 5
7