Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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
42 votes
16 answers
10k views

What "unusual" syntax assembly languages are/were there?

This question may have the apparent form of a question soliciting a "list" answer, but I'm expecting the list to be very short, so please bear with me. What "unusual" syntax ...
28 votes
3 answers
4k views

Why are the Intel 8080's rotate instructions called opposite to intuition?

The Intel 8080 has two pairs of instructions for rotating the value of the accumulator -- RLC/RRC and RAL/RAR. One of them shifts the 8 bits in the accumulator circularly, writing out into the carry ...
0 votes
2 answers
189 views

ASM as a DSL of a HLL? [closed]

There used to be a lot of discussion as regards embedding DSLs (Domain Specific Languages) into high-level languages (HLLs). The only example, where this is possible, I know of, is c++ and I had ...
8 votes
2 answers
4k views

What does an ADC (add with carry) instruction following ADD do?

I have found this line in an old 16-bit DOS application (likely to have been generated by Borland Turbo C compiler) and I want to understand the purpose of it: mov dx, [bp+var_192] mov ax, [bp+...
4 votes
1 answer
575 views

Why does this code trigger a TRAP on a PDP11/70?

On the PDP11/70, in the XXDP BKTCB0.BIC program I saw the following code: 012716 177777 mov #-1,(KSP) 006627 MTPI (PC)+ According to the comments in the source-code, this triggers a trap....
5 votes
3 answers
570 views

Why is memory below the stack pointer constantly being overwritten under a debug session?

When I run a debug session using FreeDOS and DEBUG.EXE, I get a session like the following. I've added a description of what I saw as annotation on the image. Each step, I've printed out the stack ...
7 votes
1 answer
2k views

The proper way to shift a byte using a Z80

In a nutshell, why can I not shift a byte using this way? LD A, 11110000b ; I want this to be 00001111b LD C, 4 SRA C OUT (0), A ; doesn't give correct number What is the proper way of shifting a ...
4 votes
1 answer
311 views

How to use external asm function in "vscode-amiga-debug" cross compiler?

I would like to write functions in assembly along with the c source code, but somehow I can't find the syntax. I tried e.g. in the fname.asm file (simplified): fill_bmap: rts In the fname.c ...
5 votes
1 answer
315 views

Documentation for the SALUT preprocessor of the IBM Macro Assembler 2.0

The IBM Macro Assembler 2.0 included the SALUT program, which was a preprocessor for assembly language for structured programming. It was also included in the IBM Macro Assembler/2. I am looking for ...
4 votes
1 answer
424 views

Is there an standardised 6502 assembly syntax?

I am working on a Flex/Bison based 6502 assembler (for fun and learning) and looking around for a "standard" syntax for the assembly language. Opcodes and addressing are more or less ...
-1 votes
3 answers
606 views

c64 copy chars to sprite issue [closed]

How to do correct copying char to sprite ? Lets say 1st char is at $2000 second is at $2008 and copying to sprite at $2480. And with this we can copy 1 char to top left position of 1st sprite. But ...
59 votes
3 answers
45k views

Does this 8088 code in the Leisure Suit Larry 2 game actually do anything?

In the Sierra On-Line game "Leisure Suit Larry 2" there's a part in the game where the main character (Larry) has to write a program in 8088 assembly language as part of his tribal ...
5 votes
2 answers
180 views

Change text color in Z80 assembly for Amstrad CPC 464

I am trying to code this program, similar to game: "The Typing of The Dead" in Amstrad CPC 464 using Assembly language for the Z80 processor. The program consists in when you see a string of ...
3 votes
1 answer
1k views

Why did this Hitachi 6301 assembler routine only work once?

I am trying to learn assembler on the various retro machines I own, or am about to buy. Today I tried converting this 8080 routine (which worked, repeatedly): | START: | MVI A,0 | 8000 | 3e | | ...
65 votes
13 answers
16k views

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 ...
24 votes
5 answers
18k views

When did Nintendo switch from assembly to a higher programming language?

I am only talking about games developed by Nintendo itself. I know that NES Super Mario Bros. was written in assembly. (Here is an SE answer saying the same.) They must have switched to a higher ...
9 votes
1 answer
485 views

Sending DOS commands in assembly on my C64

Consider the following Basic program for the C64. 10 OPEN 15,8,15 20 PRINT#15, "I" 30 CLOSE 15 This classic gem simply opens the 'command channel' and sends the DOS 'init' command to the ...
8 votes
1 answer
596 views

Size-optimization of a 256-byte "LDIR" adapter

I'm working on tweaking ABC-800 BASIC II machine code, and there's a routine there that does a "256-byte" equivalent of LDIR. B is not used, C=0 transfers 256 bytes, C=1 transfers 1 byte, ...
20 votes
1 answer
2k views

How can I set up the Microsoft C compiler to make it prefer immediate-mode push instructions?

I started a project to get a better understanding on how to compile a game for Windows 3.x. I tried to set up the build workflow so that it produce the byte-exact clone of a great open sourced Win16 ...
8 votes
2 answers
1k views

Help understanding TAIPAN source code for the Apple II

I am trying to run the source code found at https://taipangame.com/BASIC.txt on Epple 2 (with Apple II+ roms) to eventually run on my own Apple II+, but the program keeps crashing. First, I used a ...
17 votes
3 answers
4k views

Does this 1978 code for a 6800 really clear ALL of memory?

On page 43 of the October 1978 Dr. Dobb's Journal (reprinted in Volume 3 Page 425 Issue 10 Number 29) is a letter to the editor giving three 6800 routines to clear ALL of memory, stating... Routine ...
8 votes
1 answer
1k views

C64 char screen plot routine - not clear about reason for logical OR

I'm trying out some 6502 assembly language, specifically using Kick Assembler. I have the following routine that just sticks a character on the text screen at a specified x and y, it's taken from the ...
5 votes
1 answer
342 views

Can anyone help me identify what 6803/6303 development tools might have been used to build this program?

I've been doing some hobby work reverse-engineering vintage synthesizer ROMs from the early 80s, and I'm curious about what kind of development tools the original engineers may have used. Normally ...
11 votes
2 answers
623 views

IMPI Instruction set: is there any reference?

I've had an IBM 9404 B-10 for some time and I'm curious about its assembly language. I'm fully aware the AS lines were designed with portability in mind as much IBM didn't seem to provide assembly ...
15 votes
3 answers
3k views

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, ...
88 votes
9 answers
16k views

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 ...
2 votes
0 answers
353 views

Trying To Understand DOS Game Assembly Instructions [closed]

I am trying to understand assembly language instructions, for a DOS Game. I have looked at the following Link :- https://atrevida.comprenica.com/atrtut07.html reading about how VGA Graphics work in ...
5 votes
0 answers
357 views

Did the Soviets need industrial espionage to get IBM software pre-1970?

Due to lack of the OS-level file system on the BESM-6, and to deficiencies of data visualization tools which could help people decide which blocks of a system disk could be reused (the line of ...
12 votes
2 answers
1k views

Floppy drive detection on an IBM PC 5150 by PC/MS-DOS

The only functions of INT 13h available for pre-XT systems are the first six, from AH=00 to AH=05 (see here and here) Since function AH=08 (Get current drive parameters) is unavailable, how does PC-...
41 votes
12 answers
8k views

When did assembly source code begin to be written in lowercase?

In nearly all the assembly source files and published listings I read up to the early 1980s, the labels, mnemonics, and operands were written in all uppercase. Just a few years later, I noticed 80x86 ...
48 votes
4 answers
8k views

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 ...
13 votes
3 answers
2k views

What's the convention for < > low/high-byte in 8-bit assembler?

It's a little hard to Google for greater-than and less-than symbols in assembler math... If you saw, let's say, 6502 code like... lda #>SOME_LABEL or Z80 code like... ld a,>SOME_LABEL ...would ...
1 vote
1 answer
262 views

Interfacing with the Commodore 64 IEC Serial Port using Assembly

I'm struggling a bit to find relevant documentation on this subject when it comes to using just assembly. All I've found is either irrelevant or for BASIC. My goal is to be able to send and receive ...
31 votes
3 answers
7k views

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. ...
6 votes
1 answer
411 views

Which CPU was the first to clear the carry and overflow bits after performing logical operations?

As I work on implementing support for old architectures for the Reko decompiler (https://github.com/uxmal/reko) I notice over and over how consistently most 1980's CPUs echo a pattern. Since an ...
10 votes
1 answer
552 views

Undocumented ModR/M byte combinations

The reason I am asking this question is because I was trying to compile a list of all 8086 opcodes, regardless of whether or not they are documented. The list is just for fun, the documented opcodes + ...
11 votes
5 answers
2k views

Creating 8086 binary larger than 64 KiB using NASM or any other assembler

For fun I'm developing an IBM PC emulator. I would like to test all instructions to see if I implemented them correctly. For most instructions this is straight forward, for "FAR CALL/JMP" it ...
8 votes
1 answer
289 views

Using the (An)+ to Memory addressing mode when address register is pointed to ROM causes Sega Genesis DMA to fail

This is a weird one, and I haven't found it documented anywhere. I was testing Sega Genesis DMA during scanline interrupts and found something very odd. When writing to VDP_CTRL to initiate DMA, if ...
15 votes
2 answers
1k views

Trying to understand some assembly syntax in the Unix v7 write system call

so here is the code: (which comes from here, I've also verified this source is in my unix v7 distribution). For reference, this is running on a PDP-11 simulated with the simh program (so please keep ...
10 votes
4 answers
3k views

Assembly delay function for C64

I've written a delay function that simply counts the times the screen raster line reaches a particular value. // zero page addresses .const delayFrames = $00fa .const delayCounter = $00fb // =...
18 votes
3 answers
2k views

6502 ORA not updating the accumulator

Unless I'm reading the manual incorrectly, the following should produce $11 when D404 = $10 (I'm turning on the gate for voice1 which has been previously set to triangle wave %00010000/$10) 00153 ...
5 votes
5 answers
812 views

Are there any statistics or data showing how much more productive the C programming language is compared to x86 assembly language?

I found out today that a large project like Microsoft Windows 1.0 took 80 man-years to develop. And this one was written in x86 assembly language. Is there a form or rule of thumb that states how much ...
16 votes
4 answers
2k views

Is it possible to detect a CGA card on an IBM PC 5150 by write/reading the Motorola 6845?

I am trying to programatically detect the CGA card on old IBM 5150-ish PCs. The Paku Paku game source code doesn't directly detect it. The strategy is to detect VGA, EGA, Tandy, PCJr, etc etc, then if ...
14 votes
3 answers
2k views

Help porting nasm code down from 386 to 8088 (shifts by more than 1 bit)

I have been writing some small asm COM program using Netwide Assembler (nasm), but am having trouble getting it to run on 8088 emulators like PCjs. I could use some help translating the assembly "...
10 votes
2 answers
764 views

How can I avoid overflowing R_SPARC_13 relocations when writing SPARC assembly?

For fun I'm trying to create an assembly program for Sun Solaris on SPARC. I'm emulating the system with QEMU. My test assembles fine, yet linking fails with "relocation error: R_SPARC_13". ...
31 votes
6 answers
4k views

Managing registers/memory effectively on the Z80

I've been writing assembly for the Z80 for some time, lately. Initially, I had no experience with working with 8-bit processors, but after going through a tutorial for my platform and spending a lot ...
19 votes
3 answers
2k views

How to use the "darker" CGA palette using x86 Assembly?

For those of you retro developers out there, I am having a hard time figuring out how exactly to select the "darker" color palette in 320x200 CGA mode. Here's what I have so far: setup_cga_graphics: ...
15 votes
4 answers
2k views

Looking for an open source DOS .com program written in assembly

I'm writing a NASM-compatible assembler targeting the Intel 8086, and I'm looking for an existing open source program written in assembly, with which I can showcase the capabilities (and understand ...
6 votes
2 answers
280 views

6502 Assembly on Apple IIe: GETLN fails with 'syntax error' under ProDOS

I'm writing a text adventure in assembly for the Apple IIe (using Merlin). I'm also using ProDOS 8 v2.0.3. At some point, I have a subroutine to read user input from the keyboard using the GETLN1 call....
7 votes
1 answer
426 views

Why didn't the CP/M-86 assembler support traditional macros?

The ASM86.CMD assembler Digital Research shipped with CP/M-86 provided only code-macros, a limited type of macros for creating new instructions through a small set of specific directives. Why didn't ...

1
2 3 4 5