Skip to main content

Questions tagged [assembly]

Assembly languages in general, of any architecture. Use with the particular processor’s tag as appropriate.

Filter by
Sorted by
Tagged with
88 votes
9 answers

Why is the processor instruction called "move", not "copy"?

Many processors have an instruction called "move" (sometimes spelled MOV) which copies data from one location (the "source") to another (the "destination") in registers and/or memory. It does not do ...
JoelFan's user avatar
  • 2,127
11 votes
2 answers

Putting code into two different memory areas with cc65/ca65

According to cc65 / ca65 documentation, the .org directive does not affect the placement of the code unlike with other 6502 assemblers. The docs suggest defining a memory segment with the intended ...
Peter B.'s user avatar
  • 4,387
72 votes
3 answers

Why did DOS use dollar-terminated strings?

According to a few tutorials I am seeing, DOS used dollar-terminated strings to write to the terminal. This seems to also be documented here on INT 21H. AH = 09h - WRITE STRING TO STANDARD OUTPUT ...
Evan Carroll's user avatar
  • 3,388
48 votes
4 answers

Why are first four x86 General Purpose Registers named in such unintuitive order?

On x86 the first four general-purpose registers are named AX, CX, DX, BX. It would be quite intuitive if their indices (those used in instruction encoding) were in alphabetical order, but instead of ...
Ruslan's user avatar
  • 1,444
17 votes
1 answer

How to write directly to video memory using "debug.exe" in MS-DOS?

The base address for the video memory in MS-DOS is 0xB8000. I am trying to write to this address using debug.exe, but I am getting an error: 1165:0103 mov [b8000],ax ^ Error
user5161's user avatar
  • 491
16 votes
12 answers

How can a Z80 assembly program find out its own memory address?

I'm wondering how to write a program in Z80 assembler that discovers its own memory location. I thought that maybe I could somehow load the program counter PC into, for example, BC. Is there a way ...
twisted's user avatar
  • 263
12 votes
1 answer

8080/8085 Instruction Test Suite

(This question was inspired by Comprehensive test suites for MOS 6520 PIA / 6522 VIA / 6526 CIA) Is there a comprehensive test suite for the Intel 808X series of processors? Something that would ...
JAL's user avatar
  • 9,620
8 votes
3 answers

Arithmetic operations on multiple words on the PDP-8

For the PDP-8 with its strange ISA, I've always wondered what the "standard" (i.e. fastest) way to do arithmetic operations (add, subtract, maybe multiply) on integers consisting of multiple words was....
dirkt's user avatar
  • 28.1k
0 votes
3 answers

Does anyone have the source code of an early program written in Assembly? [closed]

I am interested in looking at the source code of any program that was written in Assembly just about when the Assembly language was invented. If anyone have a source code for such a program, please ...
user5045's user avatar
64 votes
13 answers

Were later MS-DOS versions still implemented in x86 assembly?

Recently, Microsoft published the source code of old MS-DOS versions on GitHub. What is odd in my opinion is the use of x86 assembly language for everything. The assembly language would not be my ...
juhist's user avatar
  • 963
61 votes
8 answers

Are there any modern compilers that can generate Amiga/m68k executables?

I would quite like to resurrect my openkick project. As I note on that project's, it is stalled because GNU GCC is not fit for purpose. Sadly, there do not seem to be any other modern ...
pndc's user avatar
  • 11.4k
53 votes
12 answers

How was the first assembler for a new home computer platform written?

How did the 8-bit computers (Spectrum, Commodore, Atari, Amstrad etc) typically "bootstrap" from bare electronics into a platform with a working assembly language and OS? What I mean: An assembler is ...
SF.'s user avatar
  • 7,115
53 votes
7 answers

Why use static RAM addresses instead of the stack?

I'm studying the 65c816 assembly for the 1994 game, Super Metroid. A hobbyist studied the game in-depth and created a RAM map. From it: 7E:0B56 - 7E:0B57 Moves Samus this distance horizontally, ...
Andrew Cheong's user avatar
31 votes
3 answers

Why didn't the 6502 have increment/decrement opcodes for A?

In 6502 Assembly, we can use INX and INY to increase the value stored in X and Y. They can be decreased with DEX and DEY. However, it seems that there are no such instructions for A, like INA or DEA. ...
LuNa's user avatar
  • 588
24 votes
5 answers

How much benefit should be expected on a more advanced compiler for z80/r800 based computers?

I am self studying about compilers, and get hands on very good textbooks about the subject. I am thinking in develop a compiler using the almighty llvm infrastructure to cross compile to old computers,...
flavio's user avatar
  • 580
23 votes
3 answers

Why are these DOS console drivers wasting precious bytes?

While doing some research on DOS device drivers, I took a peek at the console drivers DISPLAY.SYS and ANSI.SYS that are part of the DOS 6.20 installation. Both have "Microsoft" stamped on, ...
Sep Roland's user avatar
  • 1,185
15 votes
3 answers

Difference between machine language and machine code, maybe in the C64 community?

I've always been sure that "machine language" and "machine code" are totally synonymous and mean programming directly in the language the machine understands, whether in binary, ...
hippietrail's user avatar
  • 6,654
15 votes
1 answer

How can a Z80 assembly program find out the address stored in the SP register?

I'm wondering how to write a program in Z80 assembler that discovers the value stored in the SP register. From what I've seen, the only instructions that touch the SP register are: LD SP, HL/IX/IY EX ...
André Wagner's user avatar
14 votes
2 answers

Origin of "arithmetic" and "logical" for signed and unsigned shifts

The assembly language for many processors use the phrase "arithmetic shift" to represent the bitwise shift of a signed value, and "logical shift" for an unsigned value. The two ...
DrSheldon's user avatar
  • 16.3k
13 votes
2 answers

What is the origin of different styles of assembly language mnemonics?

As exemplified in answers to this question (I hope that closed questions that are linked to, don't get purged), the instruction mnemonics in early assembly languages had a 1-to-1 correspondence to the ...
Leo B.'s user avatar
  • 19.4k
13 votes
4 answers

Motorola 6809 two stacks design

I'm an assembly newbie, but I'm curious about why the designers of the 6809 choose to use 2 stack in the microprocessor architecture. What is their original intent? The 6809 Wikipedia page says "...
Biff Iam's user avatar
  • 2,229
11 votes
3 answers

z80 crashes after executing some instructions

I'm building my own Z80 computer but I'm having a very strange problem. Consider this code: ld a,0xaa out (00),a jp a That works as expected, outputting 0xaa on port 0x00. Now consider this code: ...
C32's user avatar
  • 394
8 votes
2 answers

Help understanding TAIPAN source code for the Apple II

I am trying to run the source code found at on Epple 2 (with Apple II+ roms) to eventually run on my own Apple II+, but the program keeps crashing. First, I used a ...
EvanTheGamer's user avatar
7 votes
2 answers

What 6800 assembler to use?

Does anyone know of a good, modern Motorola 6800 assembler? I've used dasm, which I quite like (and it's even actively developed), but it doesn't actually support 6800. It supports 6803, which is ...
tobiasvl's user avatar
  • 1,539
6 votes
2 answers

Does a defacto format exist for Commodore 64 SID music?

I first learned about tracker / mod music on my Amiga in the early 1990's. I remember fooling around with Protracker, listening to mods with Intuitracker, and coming to the realization that all those ...
Geo...'s user avatar
  • 10.2k
5 votes
1 answer

What was the first publication documenting AT&T syntax assembly language?

What was the first publication to document what is (now) known as AT&T syntax assembly language?
user avatar
4 votes
2 answers

How to express hi/lo byte of a label in crasm

I am trying to move my project from xa (which I found rather buggy) to crasm, which is the other 6502 assembler that comes with debian. My project contains a lot of lines like ldx #<pname ldy #&...
Omar and Lorraine's user avatar
4 votes
3 answers

Why is the "jmp" instruction not working if I put data before it?

I have written the following program in debug.exe: 1165:0100 mov ah, 09 1165:0102 mov dx, 107 1165:0105 int 21 1165:0107 db 'Hello World', 0A, 0D, '$' 1165:0115 jmp 1165:0100 However, when I ...
user5161's user avatar
  • 491
2 votes
5 answers

How binaries are generated using Punched cards? [duplicate]

I thought that punched cards already represent the code in binary since a hole means 0 and rest positions mean 1 on a punched card. But then I read that you could use punched cards to present the ...
user2756695's user avatar