Questions tagged [assembly]

Programming questions are off-topic here. Do not ask questions about how to write code in assembly. However, conceptual questions about how coding in assembly is different may be appropriate. See our help centre for the scope of this site.

Filter by
Sorted by
Tagged with
1
vote
1answer
37 views

Manipulating stack pointer in assembly

I have written an assembly program to store digits in a stack. And to print the digits I have used loop2: mov ah,2 int 21h sub cl,1 jnz loop2 But this would only ...
0
votes
0answers
25 views

How does the assembler translate english assembly to binary machine code instructions?

My assumptions (please correct me if anything in this part is wrong including wrong usages of jargons) In MIPS instructions, add t1 t2 t3 translates to ...
0
votes
1answer
29 views

Are EAX , EBX registers 64 bit in length in modern processors [closed]

The EAX, EBX and ECX registers on a cpu are they 64 bits for a 64-bit cpu ?
0
votes
0answers
24 views

Why are registers name in assembly cryptic

Why are registers named so short - EAX, EBX,...etc They could have easily made the names more descriptive rather than encrypted like that.
1
vote
1answer
31 views

Addressing mode in 8086

I'm a beginner learning about Assembly language and I was doing questions where I have to identify different addressing mode in 8086 processor. One such instruction is: mov ah,09h Here the source ...
1
vote
0answers
19 views

purpose of stack segment in assembly language

The code snippet below is the "beginning lines of an assembly language program" used to display a single line string . ...
0
votes
0answers
10 views

Using Pep8 assembly code to load the last digit of a number in the accumulator [closed]

How could I load the last digit of my number in the accumulator This is how I would load the last digit: LDA 0x0009,i .End The whole number is 2476879 What would be the way to declare the number and ...
0
votes
1answer
30 views

What will a given CPU architecture do in the event that we were to invert all of the instruction bits to a given instruction?

Given an arbitrary CPU - Architecture and its instruction set... What would be the outcome of the given inverted instruction within that Architect? For simplicity, let's use an 8-bit CPU architecture ...
0
votes
0answers
63 views

Difference between int 21h and int 80h?

What is the difference between int 21h and int 80h? I get that both perform interrupt functions, but what is their difference?
0
votes
0answers
13 views

If an instruction contains an address, how is it copied to the MAR?

Since the Memory address bus is unidirectional, how is an address copied to the MAR if a previous instruction such as "STO 150" contains an address? STO would store the contents of the ...
0
votes
0answers
21 views

Parallel Floyd-Warshall algorithm in Assembler - possible?

I want to implement parallel Floyd-Warshall algorithm in assembler. The FW algorithm is all about if and assign statements ...
1
vote
0answers
11 views

How does an assembler manage varying offsets when using a literal pool?

I am trying to write a simple multi-pass assembler. Wikipedia states that: Multi-pass assemblers create a table with all symbols and their values in the first passes, then use the table in later ...
1
vote
2answers
73 views

Why can't we compile 8086 Assembily for all OSs from any OS?

If Mac OS, Linux, and Windows (mostly) all use Intel's 8086 64 bit instruction set, why can't we compile 8086 64 assembly from any operating system to any other operating system? (e.g. compile a Mac ...
0
votes
0answers
35 views

Unbanked access, banked access and common memory access

What are they and what are their differences? Unbanked access Banked access Common memory access [EDIT] This question is originated from my reading of MPLAB XC8 PIC Assembler User's Guide where the ...
2
votes
0answers
14 views

Detecting Data and Control Hazards for a mips 5 stage pipeline

I'm practicing data and control dependencies, but having trouble detecting them. For this example, I'm assuming this pipeline is fully bypassed (with forwarding). I think the only data dependency is ...
0
votes
3answers
52 views

CPU Registers and Computation

How exactly does the control unit in the CPU retrieves data from registers? Does it retrieve bit by bit? For example if I'm adding two numbers, A+B, how does the computation takes place in memory ...
0
votes
1answer
51 views

Is it possible to modify the linux assembler in order to modify what fuctions do?

I was wondering if it were possible to modify the linux assembler in order to change the function of "-" to "+" and vice versa. I was also wondering if this would affect the whole system making it ...
2
votes
0answers
55 views

What is “orthogonality” in the context of Instruction Encoding?

What does it mean by "orthogonality" in the context of Instruction Encoding? Why CISC Architecture is orthogonal while RISC is not?
0
votes
1answer
63 views

RAM and ROM confusion

we know RAM contains instruction for we ask computer to do operations we know ROM contains instructions which for computer to work does this mean RAM contains address of instruction sitting in ROM? ...
0
votes
1answer
133 views

Can a 32-bit processor work with a 64-bit size word?

In a 32-bit byte addressable memory system, each "row" has 4 bytes and each byte has a 32-bit address. My question is: can I read and/or write word of length 64 bits from/to memory? In other terms, ...
8
votes
5answers
453 views

Are assembly languages untyped?

I'm writing my Bsc thesis about type systems of various languages and I want to have a short section about assembly languages. Initially I thought I'll bring up assembly as a counter example to ...
0
votes
1answer
290 views
1
vote
1answer
25 views

Names of power-of-two bit operations on bitsets that would not assume any number interpretation

Three commonly used functions when it comes to bit manipulation are : is_pow2: Checking that an integer is a power-of-two (only one bit is set): $00010000 \...
0
votes
2answers
86 views

Do compilers of high programming languages always compile them directly to machine code?

As an amateur Bash/JavaScript scripter who never wrote one sentence in Assembly, I ask: Do compilers of high programming languages always compile them directly to machine code, or are there cases ...
6
votes
7answers
1k views

Essential difference between Assembly languages to all other programming languages

I understand that any assembly programming language has so little abstraction, so that one who programms with it (OS creator, hardware driver creator, "hacker" and so on), would have to know the ...
2
votes
2answers
408 views

Does assembly language get translated to binary code? If so, is assembly language portable across machines?

I've tried to find the answer through Google but I've come across conflicting uses of terminology, so I just wanted to be absolutely clear. Here is my understanding: High level code written in a ...
2
votes
1answer
62 views

Understanding addition overflows when performing full, signed multiplication of two 64-bit numbers

I am close to solving question 3.59 from Computer Systems: A Programmer's Perspective 3rd Editionby Randal E. Bryant and David R. O'Hallaron, however I am having difficulties with understanding the ...
23
votes
7answers
6k views

Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code

this is a piece of Assembly code ...
4
votes
3answers
1k views

How is an Assembly Language Processed by a CPU's Circuitry?

I'd like to have a bit more understanding of how, on a circuitry/hardware level, an assembler program works. I think I have a very broad-brush understanding of how a CPU would process machine code on ...
8
votes
2answers
2k views

Assembly writer vs compiler in VLIW architecture

I read this sentence in a book: In VLIW architecture, the compiler/and or assembly writer chooses instructions that can be executed in parallel. What is the difference between assembly writer and ...
2
votes
1answer
64 views

Prove that the next multiple of 4 is obtained using the next formula

I was reading an assembly procedure that needed to align addresses on 4 bytes boundary for performance reasons so it has used the next statement that i formulated as a theorem to be proven. Let $s$ ...
0
votes
1answer
68 views

The instructions a Stack Machine has

Trying to figure out which instructions a stack machine has, and wanted to clarify / reassure that these are in fact all of them. push onto stack ...
19
votes
6answers
9k views

Why do compilers produce assembly code?

Assembly language is converted in to machine language by assembler. Why would a compiler convert high-level language to assembly? Can't it directly convert from the high-level language to machine code?...