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
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 ...
user1095108's user avatar
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+...
tigrou's user avatar
  • 445
4 votes
1 answer
577 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....
Folkert van Heusden's user avatar
4 votes
1 answer
312 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 ...
Tamás Putz's user avatar
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 ...
Bart Friederichs's user avatar
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 ...
reymagnus's user avatar
  • 173
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 ...
Noel Whitemore's user avatar
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 ...
zomega's user avatar
  • 5,372
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, ...
Kuba hasn't forgotten Monica's user avatar
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 ...
EvanTheGamer's user avatar
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 ...
Les's user avatar
  • 171
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 ...
Alan B's user avatar
  • 4,620
5 votes
1 answer
344 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 ...
ajxs's user avatar
  • 836
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 ...
Geo...'s user avatar
  • 10.2k
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 ...
Marc Nieper-Wißkirchen's user avatar
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 ...
Edward Winch's user avatar
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 ...
Leo B.'s user avatar
  • 19.2k
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-...
padawan's user avatar
  • 447
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 ...
Luxocrates's user avatar
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 ...
SkyeG06's user avatar
  • 21
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 ...
John Källén's user avatar
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, ...
hippietrail's user avatar
  • 6,656
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 ...
Folkert van Heusden's user avatar
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 // =...
Gavin Williams's user avatar
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 ...
Coder's user avatar
  • 1,068
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 ...
don bright's user avatar
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 "...
don bright's user avatar
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". ...
Folkert van Heusden's user avatar
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 ...
v-rob's user avatar
  • 857
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 ...
Borg Drone's user avatar
6 votes
2 answers
281 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....
Taciano Dreckmann Perez's user avatar
3 votes
1 answer
358 views

Is RosAsm assembler self-hosting?

I have a few questions about the RosAsm assembler (not in active development anymore) by René Tournois: Is/was there a command-line tool (i.e. without a GUI) included to generate executable programs ...
pts's user avatar
  • 2,013
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 ...
pts's user avatar
  • 2,013
10 votes
3 answers
2k views

How to write text in MODE 0x13?

I have read How to write directly to video memory using "debug.exe" in MS-DOS? and I know how to write text to video memory in mode 0x3 but I can't figure out how to write text to video ...
Lone Learner's user avatar
10 votes
11 answers
991 views

Towards people who were there, what programs did you use to develop applications for the IBM 5150? [closed]

I want to get into programming on old MS-DOS systems, before then going to older DOSs like CP/M. However, while programming for MS-DOS I'd like to also use era-appropriate software, both for the ...
Sage Hendricks's user avatar
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 ...
Paolo Amoroso's user avatar
24 votes
1 answer
2k views

Where can I find the debate around snow-free screen updates mentioned in the Zen of Assembly Language?

Michael Abrash's book Zen of Assembly Language: Volume I (1989) contains a reference to a column in a computer magazine, though the actual source is not cited. From the text: I recall a debate in the ...
640KB's user avatar
  • 1,297
0 votes
1 answer
286 views

Apple II mixed mode cursor placement

I've been playing on my recently resurrected Apple IIs, a //e, IIc, and IIgs (mostly the //e), tinkering with assembly. I'm reading the paddles and plotting a colored block on the screen, kind of an ...
mswade's user avatar
  • 93
8 votes
2 answers
2k views

Asking explanation of 65C02 assembler code

From Gary B. Little's "Apple ProDOS: Advanced Features for Programmers", pages 176 - 188: "Since the ONLINE command handler is not inherently relocatable, all references to internal ...
mswade's user avatar
  • 93
6 votes
2 answers
473 views

SciTech's SVGAKit seems to be incomplete

I'm trying to get into MS-DOS development for fun, and I'd like to use SciTech's SVGAKit library. The last version of it is still downloadable via the Internet Archive here. However it seems to be ...
Spudd86's user avatar
  • 211
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 ...
puppydrum64's user avatar
  • 1,638
5 votes
5 answers
520 views

Chaining IRQs in x86 ROM code

Objective Summary: I need to write a sleep() function to be used in 8088 (PC/XT ISA) ROM code with 1 ms resolution. Though the question can be more generalized to chaining INTs with data in different ...
640KB's user avatar
  • 1,297
15 votes
3 answers
3k views

Running CP/M on my own Intel 8080 emulator

I recently finished writing an emulator for the Intel 8080, having passed all of the usual test suites, and wanted to try running an actual OS on it (such as CP/M). I'm aware that I would have to ...
linguisician's user avatar
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 ...
Danya02's user avatar
  • 383
6 votes
1 answer
524 views

How do I read a port value using Turbo Pascal inline code on CP/M?

After successfully using port[0] to read a port value in Turbo Pascal, I thought I'd try to understand how to do this using inline assembly/machine code. I'm able to write to the port (my OutPort ...
Nick Bolton's user avatar
39 votes
3 answers
5k views

Why are assemblers called assemblers?

We tend use the term assembler as if there is a fundamental implication of being different from a compiler. This disparity is usually taken as a fact, no matter how sophisticated or primitive either ...
Raffzahn's user avatar
  • 224k
10 votes
3 answers
2k views

Is there an equivalent of "#pragma once" in RGBASM (Gameboy DMG assembly language)?

So I am really just starting out in my assembly coding adventure. I have a little bit of knowledge of C/C++ but nothing too advanced yet. But I also used to do a tiny bit of Z80 assembly, and I wanted ...
I_Keep_Trying's user avatar
-5 votes
1 answer
458 views

If I build a new CPU architecture, how would an OS like Linux know how to run it? [closed]

I am trying to build a CPU from scratch (from NOR gates) in an emulator first, then on breadboard. (Inspired by nand2tetris and Ben Eater) Just trying to understand how things work. Now, as my CPU ...
Palash Kanti Kundu's user avatar
2 votes
2 answers
377 views

From an electrical and software engineering perspective, ignoring available software, should I go for the Z80 or 65C02? [closed]

This might be a weird title but I noticed that recommendations for one over the other usually go into a direction that is not too helpful for me. I would like to build an 8 bit computer and picked ...
Asyx's user avatar
  • 29
7 votes
1 answer
505 views

PDP 11/70: how does MTPI work?

I'm trying to understand the MTPI (and its MFPI counterpart) instruction on the PDP/11. As far as I understood, it: it retrieves a value from the "current" memory space with the current ...
Folkert van Heusden's user avatar

1
2 3 4 5