An assembly language is a low-level programming language for a computer, microcontroller, or other programmable device, in which each statement corresponds to a single machine code instruction.

learn more… | top users | synonyms (1)

0
votes
1answer
69 views

Are there system calls like posix in assembly level using int number for windows

I want to write assembly program using windows syscall Interrupt number , so in order to use system call in assembly level using int of sys call, In windows are there kernel calls like posix ...
0
votes
1answer
21 views

SPIM MIPS simulator assign number to a symbol for reuse later

In MIPS, I can allocate space like so: .data space_here: .space 40 # Allocate 40 bytes Later on, using a SPIM syscall I can read a maximum string of length 40 bytes into this memory location, like ...
-3
votes
1answer
80 views

What is 16 bit word's equivalent in decimal?

Question: For a 16 bit word with 6 bits for an opcode How many different instructions could I fit into the instruction set? What is the largest number that I could use as data? ...
8
votes
2answers
255 views

Apollo-11: Using inclusion instead of a linker

Recently digitized and turned into a repo, the original Apollo 11 guidance computer source code has been made available for viewing on Github. In MAIN.agc, the repo author comments that they ...
2
votes
6answers
334 views

“Write an Assembler in C.” Why writing a machine code translator for a low level language in a higher level language?

My Microprocessor class instructor gave us an assignment and said: "Write an Assembler in C." - My beloved Professor So it seemed a little bit illogical to me. If I'm not wrong Assembly ...
2
votes
4answers
204 views

Is C is a portable language for new architecture or it is specific for ISA?

How C language is portable to any instruction set (I mean for new architecture). Do we have to write again C compiler for new architecture?
3
votes
2answers
109 views

How does one structure an assembly-language project?

So, I'm taking a MIPS course after returning to school; and we're approaching the point where we begin on our final project. I've always been one for large, well-structured projects: lots of ...
0
votes
1answer
196 views

How assembler converts to machine code 1 and 0 [duplicate]

I know that assembler is the one which converts to machine code. So here in 8085 instruction set LDA has opcode "3A". My question is how assembler convert mnemonics to opcode and finally to machine ...
1
vote
2answers
180 views

What are microcontrollers programmed in most in industry? C or Assembly? [closed]

So recently in school we have started programming klm25z boards using ARM Assembly. I was wondering if in most industry jobs, microcontrollers are really programmed in assembly over C. It seems to ...
2
votes
3answers
137 views

Is there any low level way to get shifted or unshifted bits which results from bitwise operations?

I was playing with bitwise operations and a question about counting true bits of any positive integer value, so I solved the problem with bit shifting, so I just thought if there would be some way to ...
0
votes
3answers
97 views

Operation excution in terms of clock cycles

Typically for a single instrcution, 6 machine cycles are needed: FETCH instruction DECODE instruction EVALUATE ADDRESS fetch OPERANDS EXECUTE oepration STORE result My concern is regarding the ...
0
votes
3answers
149 views

Memory addresses and Assembly

I recently started reading about programming in Assembly. To my knowledge, in Assembly, a programmer, when storing and retrieving their variables, has to specify the address their variables are stored ...
-1
votes
1answer
59 views

Finding register parameters for system calls

By consulting various scattered tutorials and books, I've been able to learn that the 64-bit Linux "exit" system call is 60, and the status value is moved to edi. Similarly, "write" has call number 1, ...
6
votes
1answer
368 views

Does unused code affects the assembly after startup (Memory for example)?

Disclaimer: I come from a PHP background. In PHP, I could have thousands files, which are never loaded, if not needed, due to the autoloader feature (If some code is needed, it would be loaded) How ...
7
votes
1answer
134 views

Unit Testing: Assembler code and different architectures

I am currently unit testing some C code and I am faced with a problem: Within the code there are called functions that contain inline assembler code for the SPARC 8 architecture. Since I am doing ...
2
votes
2answers
127 views

Difference in endianness between operating systems [closed]

There is an assembler that I am writing that is located within the file asm.c located in this repository. It uses the instruction set located in the specs file to produce an output binary. (The ...
51
votes
4answers
6k views

Development process used for the code on Apollo 11 missions?

The Apollo missions had technology no more complicated than a pocket calculator. From link here, there's an information about Apollo Guidance Computer (AGC) The on-board Apollo Guidance Computer ...
3
votes
2answers
203 views

What's the REAL benefit of using CDECL? (more specifically pushing instead of reg-ing)

So, I'm learning assembly, and I've come to know the ABIs and i got some basics tests working using the cdecl calling convention to use the c's stdlib under nasm. But I've seen other Calling ...
3
votes
1answer
94 views

How to be sure that a certain code does not call interrupts?

Imagine that you have an object code file from an untrusted source. You want to run this code to know the result of its computation, and you want the code to perform fast, so setting up a whole ...
8
votes
4answers
629 views

What are the key differences between low-level C development and higher level OOP development? [duplicate]

I have been using high-level OOP language (like C# and/or Java) for quite some time. I know patterns like the gang of four, can read and write code reasonably well and am considered a senior by his ...
-3
votes
2answers
466 views

Best x86 processor(computer) to learn computer architecture and assembly [closed]

I'm planning to build a computer as a hobby from scratch, with the least basic hardware possible in functionality so I can learn the basics of computer architecture and assembly language. I already ...
0
votes
0answers
57 views

IBM PC XT 5162 even and odd BIOS

I am writing a whole new BIOS, from scratch, for the 5162. The already existing BIOS is on chips U34 and U35. Normally, exactly one byte (the odd byte) should be on U34, followed by exactly one even ...
-1
votes
1answer
85 views

SPARC and Assembly [closed]

I'm currently self teaching myself programming and became familiar with Python, Java and C and I'm confused as to what are the differences between Assembly and SPARC Assembly and whether or not I ...
4
votes
2answers
401 views

Why was the AT&T assembly syntax designed this way?

The AT&T assembly syntax, often called the GAS syntax, keeps surprising me. For example, its parameter order: mov $100,%eax /* Destination after source */ This just seems so counter-intuitive! ...
1
vote
1answer
380 views

How to make absolute jumps relative?

Given I have x86 assembly code disassembled into a list of structures that fully describe it (opcode, regs, imm, etc.), how can I programmatically turn absolute jumps to relative jumps? Basically ...
0
votes
0answers
88 views

How does a .COM file get loaded for execution

For a bit of fun I thought I would start writing my own emulator for the 80286. I have been reading a bunch about the topic. I thought for simplicity I would start with a really simple COM executable ...
0
votes
0answers
335 views

Writing Z80 table based assembler/disassembler

I have a long-term project: DIY computer with various processors. One of my wishes not only make hardware, but software too. So I started from assembler/disassembler for Linux, though there is a lot ...
-1
votes
1answer
297 views

Longest x86 Instruction

I read the recent article "Longest x86 Instruction" http://blog.onlinedisassembler.com/blog/?p=23 I attempted to reproduce the curious disassembly issue on a Win7x86 development platform using masm ...
3
votes
1answer
318 views

Can SSE (or AVX) be used to do large bsf?

I'm faced with having to do a bsf (find the first bit set) in a 512bits bitmap. This is in the hot path so I'd like to see how I can speed things up. Right now I'm maintaining a header entry to know ...
2
votes
3answers
244 views

8085 assembly question. Why flag stacks named d0-d7?

I'm trying to make my C programming exciting by learning assembly programming. I've encountered an image of flag registers in 8085 assembly programming. In that image blocks are named from d0-d7(...
-1
votes
2answers
126 views

How were assemblers created straight from binary? [duplicate]

How did these earlier programmers know what combinations of binary produced certain results? Is there a way I can create an assembler from binary today?
1
vote
1answer
195 views

Implementing a VM for simulation [closed]

I am aware of this question, and I think I know why it has been closed. I hope that my question manages to be more specific. My skill level: I have a "Computer Science" degree. I have programmed in ...
2
votes
1answer
414 views

Developing a compiler for a self made CPU Architecture

Recently ive been consumed by creating my own simple CPU architecture that at some point could be easily implemented in hardware (No FPGA, but actual Logic Gate circuits). Naturally to fulfill this ...
3
votes
1answer
453 views

Why does GCC use AT&T syntax by default?

I think title says it all :) Is there any particular practical reason (I guess it's mostly historic, but I'm unable to find it on my own) why GCC uses AT&T/GAS syntax? Note: I know this is just ...
1
vote
1answer
491 views

Assembly vs. algorithmic languages (like C, Algol, etc) [duplicate]

Usually, computer science papers describe algorithms in Algol-like pseudolanguage, similar to Pascal or even C/C++. But Donald Knuth uses his own assembly language (MMIX). Are there any good known ...
1
vote
1answer
1k views

Polymorphic engines in C and/or C++ [closed]

I stumbled across polymorphic engines and I don't know anything about them. However, I am curious about how they are written. Every example that I've looked up writes them in assembly, my assembly is ...
-2
votes
1answer
458 views

What are steps in making an operating system in C ? [duplicate]

I am trying to make an my own OS. This is for educational purpose only, so that I get to understand the internals as well as get a good idea of low level programming. I have some prior application ...
0
votes
2answers
139 views

How do we add software to a machine? [duplicate]

When we build a new machine, how do we add software to that machine? I know we have assemblers and compilers that convert the high-level code into machine code for it to understand. But having ...
-1
votes
2answers
492 views

Reading assembly useful for insights when writing C/C++? [closed]

While in most cases its not necessarily, recently I have taken to reading the generated assembly of my C code every so often, when I'm curious as to the kinds of optimizations my compiler is making. ...
3
votes
1answer
501 views

How do VMs implement function calling?

I'm reading a compiler textbook that compiles to some form of assembly. Since I don't know this assembly language I decided to invent my own simple "assembly language" and implement a basic "virtual ...
5
votes
2answers
670 views

If statements in “generic” assembly?

I'm reading a relatively 'friendly' and simple book about compilers named "Let's Build A Compiler" (originally a series of articles). The compiler written in the book generates instructions in some ...
6
votes
2answers
2k views

How are OOP “objects” and “classes” organized in memory in terms of assembly language?

How are objects organized in memory? For instance, I know that a function is a piece of code in memory, that expects parameters via the stack and/or the registers and handles it's own stack frame. ...
3
votes
3answers
9k views

Is there still any value in learning assembly languages today? [closed]

Specifically for a game programmer. If you really needed some assembly routines you could look for help, whereas back in the 80s/90s it was one of the mainstream languages. I read that compilers can ...
2
votes
2answers
133 views

gcc -S seems a bit misshapen with shifting and ANDing bits

Example: int c = 4; int p = 5; if (p & (1 << c)) printf("ok\n"); else printf("nop\n"); gcc -S: movl -4(%rbp), %eax /* eax holds the variable c */ movl -8(%rbp), %edx /* ...
1
vote
3answers
344 views

Why do we need a format for binary executable files

When binary files (i.e. executables) are saved they usually have a format (e.g. ELF or .out) where we have a header containing pointers to where data or code is stored inside the file. But why don't ...
0
votes
3answers
750 views

How Byte loading/storing is implemented By the CPU?

I know that in 32bit machine, cpu read from memory 32bits at a time. since the registers in this case is 32bit in size too, I can understand how this works. What I don't understand is how the cpu ...
2
votes
2answers
743 views

Why convert to assembly language instead of machine code?

When I compile a C program, it is compiled first to assembly code, then assembled into machine code. I'm curious why it doesn't just convert straight to machine code in the first place.
0
votes
5answers
282 views

What conclusion to be drawn from no difference in generated assembly from 2 rather different programs?

I might not have had a counterexample when I got the reply "A pointer is just an address, what's the difficulty?" but I didn't really buy such a simple explanation and at assembly code it's not ...
1
vote
2answers
321 views

Creation of an Assembler [closed]

I've always been interested in how programming languages are created, so for the past 8 months I've been researching, practicing and more about the creation of compilers. I've been able to quite ...
4
votes
1answer
2k views

What is the purpose of red zone?

Red zone is a fixed size area in memory beyond the stack pointer that has not been "allocated". Compilers do generate assembly to access that area in simple leaf functions. But I can't see any real ...