This is a programming language that is at a low level that corresponds with the instruction set of the machine being programmed.

learn more… | top users | synonyms (1)

0
votes
0answers
13 views

is an unaligned STR in thumb2 atomic if it is supported by hardware?

This http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15414.html describes that some cores support unaligned stores but they may take longer if the store spans a 64 bit boundary. My ...
0
votes
1answer
23 views

Are unaligned LDRH/STRH supported on Cortex M3/M0?

Can all Cortex M0/M3 cores do this? LDRH r0, [0x8001] This would suggest yes but I don't see anything specific about Cortex-M cores.
0
votes
1answer
18 views

PWM in 8051 with PCA counter

I read in documentation of AT89C51RC2, that I can make one of 5 ports to generate PWM signal if I set properly some registers. Some things I don't understand. I don't know what PCA counter is and how ...
1
vote
1answer
35 views

Best way to compare value in register with constant assembly AVR

I am newbie in assembly and AVR, I wonder what is the best way to compare two values like in C ...
0
votes
3answers
38 views

How To use ANDWF in Microchip PIC18fxxxx Assembly Language

ASSEMBLY LANGUAGE MPLAB PIC18f2550 I am trying to "AND" 2 Variables "If Variable_1 = 0 AND Variable_2 = 1 then" "DO WHAT IS NEEDED." "End If" This below makes no sense used as a "AND" Logic ...
1
vote
2answers
59 views

8051 - After API call at 0xFFF0, instruction pointer is not returning to my program

With microprocessor ATmEL 89C51RC2 , when I prepare registers and ACC for API call and I call CALL 0xFFF0 instructions below the call are never executed. The ...
12
votes
12answers
4k views

Could you program a microcontroller without a computer?

Let's say you had a rather simple and small microcontroller and had no interfacing, no computer, no debugger, compiler, or assembler. Could you write your code in assembly, convert it (manually) to ...
0
votes
1answer
134 views

Assembly Language / Assembly Insturctions (HC12)

Starting at address $0800, CE 00 31 9E 00 2D 01 08 18 06 3F A7 Determine the assembly instructions and indicate the addressing mode of each instruction. CE 00 31 =====> ldx #$ 01 ;x <-- 0031 ...
2
votes
2answers
52 views

Range of MIPS j instruction

I understand that for MIPS-32, the first 4 bits of the address to jump to are taken from the first 4 bits of the address of j instruction, which means that we have a boundary of 2^28 bits around the ...
1
vote
1answer
33 views

Pic18F2550 Assembly xt_xt

I am trying to set up a Serial Port for a PIC18F2550 Microchip. I am using MPLAB. In the 18F2550TMPO.ASM Template the statement CONFIG FOSC = XT_XT ;XT oscillator, XT used by USB. I need to change ...
10
votes
5answers
964 views

Why use AutoCAD Electrical?

I'm an electronic & electrical engineering student in first year of university. I have had to use a few core programs as part of my course for programming and simulation software. However I came ...
0
votes
1answer
37 views

PIC18 inline asm problem: error (195) expression syntax

I'm building a bootloader firmware, and now I want a simple app (LED blinks) to test calling bootloader from application itself. I'm currently doing: ...
1
vote
1answer
58 views

AVR Attiy45 PWM Servo motor control in Assembly

I'm trying to contol a servo motor with attiny45 writing the code in assembler. I figured out how to set the timer in pwm mode and how to choose a needed prescaler. And with different OCR0A values i'm ...
0
votes
0answers
74 views

“Constant value required” while compiling asm inline with avr-gcc

I am trying to insert some assembler code into my C program for AVR MCU, but every time I compile it, I get an error message from gcc-as: "Error: constant value required". I've tried changing I/O ...
1
vote
1answer
236 views

PIC12F683 or PIC16F688 assembly or C blinking LED example with XC8 compiler, MPASM or gputils

Hello I am new to PIC programming and I finally have got my dev environment working, I downloaded the XC8 compiler from microchip and also as backup I downloaded the gputils assembler. I have not been ...
0
votes
2answers
69 views

Shift value to some point in binary number

I wonder if it is possible to do the following. For instance, I have a number 00001110. I am shifting it left. -> 00011100.... But the question is if it possible to start setting value in carry flag ...
1
vote
1answer
45 views

What is Pipeline Flushing in microprocessors

I am reading the book "Writing Operating System from Scratch" by Nick Blundell. In one of the chapters, it is explained how we make transition from 16bit mode to 32bit mode. It says that before moving ...
0
votes
4answers
77 views

What is the meaning of performing logical operations on two numbers?

If we are to consider two Boolean values, the logical operations on them make perfect sense. But what would it mean to perform AND/OR/XOR operation on two binary numbers? I am learning Assembly ...
2
votes
2answers
104 views

PIC16F690 Consecutive flashing LED's

I am having trouble writing the code for flashing 6 LED's from PORTC on the PIC16F690 microcontroller. The LED's should flash like the lights on a runway. With the code that I currently have the ...
2
votes
1answer
80 views

How does the CPU handle XCHG internally?

While designing my own 16-bit CPU I wonder how the register-register XCHG instruction is executed internally. From computer science I know the DLX which doesn't provide XCHG and therefore doesn't need ...
1
vote
1answer
92 views

PIC16F1933 Output pins not working

I am having problems with getting certain pins on my microcontroller (PIC16F1933) working as outputs. I have been simulating the code in Proteus Design Suite by Labcenter Electronics and it doesn't ...
0
votes
1answer
70 views

What other problems can be caused when using the JMP instruction to navigate through subroutines instead of using the instruction CALL/RETURN?

I've been creating a report on why the JUMP instruction shouldn't be used in the piece of code above and instead CALL/RETURN instructions should be used to navigate through the subroutines. I ...
1
vote
2answers
81 views

How is data allocated in an assembly language using the instruction set?

Consider the following excerpt of assembly code written for the Nios II embedded processor architecture: ...
0
votes
0answers
37 views

Need Some Help Using a GLCD on EasyAVRv7

I am trying to use a GLCD, a WDG0151-TMI-V#N00 on my EasyAVRv7 board and I realized that I might need some help. The MPU I have is an ATmega32. Problem is, nothing works. For example I can't even tell ...
1
vote
1answer
64 views

implementing direct addressing mode for a load instruction on a mips archtitecture

Given a Mips machine with 26 bit addresses and 32 bits data-paths, where the load instruction is as follows |OPT code|rs|rd|immediate| |6 bits |5 bits|5 bits|16 bits| The OPT code is the ...
2
votes
0answers
131 views

How to tell CCS debugger where to start?

I am just starting with MSP430 and Code Composer Studio (CCS). I want to make a pure-assembly project. At the moment, I have a "hello world" program that does nothing but light an LED on the ...
2
votes
3answers
89 views

Curious how does ALU addressing work like in Assembly code?

When writing assembly code, say R1 = R2 + R3, it is pretty easy to understand the addressing procedure because all registers are close to the ALU. But I find it hard to see how does the ALU go to the ...
2
votes
1answer
61 views

AVR Assembler Labels

According to doc1022, p. 17 (AVR Assembler User Guide): User defined labels which are given the value of the location counter at the place they appear. My question is, what goes into the opcode ...
0
votes
1answer
145 views

Use of $at register in MIPS?

Register r1 or $at, is it's sole use in pseudoinstructions? If so, is this the sole solution to enable pseudoinstructions within the architecture?
0
votes
1answer
122 views

8080 assembly comparing which of the numbers is greater etc

In my 8080 assembly project I need to check if user entered digits and if so do some stuff on it, otherwise display some error and close app. Normally i would do it like that ...
0
votes
1answer
225 views

XMega bootloader - How to make use of the functions in assembly source file

Its been two days I'm trying to write a Bootloader for ATXMega32E5. The Atmel studio doesn't have boot.h header file supporting XMega. As a result of searching and ...
2
votes
0answers
106 views

PIC12F ADC conversion has an unwanted offset

The current setup is shown below. PIC12F1822 with a 10-bit ADC. I'm using a 250R 0.05% precision resistor to get a nice 0-5V input to the analogue pin (AN2 if it matters). As far as I can tell I ...
0
votes
1answer
99 views

How to calculate cache size?

A cache with a line size of L 32-bit words, S number of sets, W ways, and addresses are made up of A bits. Assume that the cache is word addressed, i.e., the low two bits of the address are ...
0
votes
1answer
87 views

Direct cache vs. associative cache

Trying to solve this problem where direct cache would outperform associative: Propose you have a cache with a line size of L 32-bit words, S number of sets, W ways, and addresses are made up of A ...
0
votes
1answer
114 views

5-stage pipelined implementation (RISC) of a microprocessor

I'm trying to solve two questions about a RISC 5-staged pipeline that is not exactly like MIPS found here (everything is included in this post). Consider the non-pipelined implementation of a simple ...
0
votes
1answer
90 views

ISA efficiency code compaction and memory traffic

I'm having issues understanding this problem and am new to ISA's. Here's a problem with 3 questions and my biggest question is, what is supposed to happen? Specifically, the HLL Code at the bottom. ...
1
vote
2answers
129 views

MSP430 Stack pointer and frame pointer behavior

While trying to analyze a simple Assembly file generated through the msp430-gcc, I stumbled upon a set of instructions that I don't understand dealing with the frame pointer and the MSP430's stack ...
0
votes
1answer
117 views

Numerical value in decimal of the 32-bit word stored at address 1000H

I'm a little confused how to tackle these three questions. Assuming two's complement arithmetic and operand alignment, give the numerical value in decimal of the 32-bit word stored at address 1000H ...
2
votes
0answers
91 views

What happens to AVR registers during multi-cycle instructions?

This is more of a theoretical question... (Also my first on Stack Overflow) I am wondering what happens to Atmel AVR microcontroller (i.e. ATTINY85) registers during a multi-cycle instruction. i.e. ...
1
vote
1answer
113 views

Assembly XMEGA program creating a longer than expected pin toggle?

I'm trying to do the fastest pin toggle possible on an XMEGA32E5 running at 32MHz. My code is as follows: ...
0
votes
2answers
86 views

Average Cycles Per Instruction

We have two different computers with the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. Computer M1 has a clock rate of 80 MHz and Computer M2 has ...
5
votes
3answers
1k views

Is this a correct way to have a 1 second delay?

If I have a PIC24 with a 4 MHz frequency. Is it accurate to have a 1 second delay by having 4 million clock cycles? I made a 1 second delay like this on my PIC24FJ128GA010: ...
1
vote
1answer
135 views

The PIC24F RETURN instruction

The PIC model I have is PIC24FJ128GA010. My question how many clock cycles does the RETURN instruction consume? The datasheet says 3(2), what does that mean?
2
votes
2answers
426 views

AVR microcontrollers, who initilizes assembly `data` segment and what is the purpose to have this directive?

I am new to assembly and microcontrollers and am trying to figure out how they work. Now, I have read a lot how in assembly text and ...
4
votes
0answers
367 views

32-bit unsigned binary integer to 8-bit BCD in AVR ASM for ATtiny. How to make it more efficient?

I wrote a program in AVR ASM for converting 32-bit unsigned binary numbers to 8 digit ...
1
vote
2answers
192 views

ATtiny2313 vs ATtiny84 software compatibility

I make and sell a variant of the USBtiny AVR programmer. It uses an ATtiny2313 clocked at 12 MHz and does bit-banged USB using hand-tuned assembly language (that someone else wrote - it's an open ...
3
votes
3answers
160 views

Frequently used functions, performance improvements using static variables?

Does defining variables (large arrays) as static inside a function have any performance improvements if the function is to be called repeatedly say in the order of seconds?
1
vote
0answers
107 views

Weird bug in MPLAB X IDE

When using the RTCC module in the PIC24F, we need to use the secondary oscillator (by setting bit #2 of OSCCONL register) and disable the write lock on the RTCC registers. Now the write lock can be ...
2
votes
2answers
251 views

Problem with the explorer 16 dev board

I have the explorer 16 dev board equipped with the PIC24FJ128GA010. I wrote a C code to write something on the LCD and a LED blinking after that. I wrote the same code in assembly and both codes work. ...
0
votes
1answer
134 views

pic18f instruction reference for XC8 Assembler

I found lots of tutorials online on PIC18 assembly programming, but i did not found any official document from microchip on PIC18 architecture and assembly programming. Can anybody share the link ?