Questions tagged [assembly]
Assembly languages in general, of any architecture. Use with the particular processor’s tag as appropriate.
230
questions
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
973
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
299
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 ...
6
votes
0
answers
276
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 ...
11
votes
2
answers
563
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 ...
4
votes
1
answer
227
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 ...
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, ...
87
votes
9
answers
15k
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
324
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
342
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
7k
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
196
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
6k
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
375
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
512
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
280
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
2k
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 ...
4
votes
2
answers
343
views
Mysterious things happening to stack when running 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 ...
5
votes
5
answers
767
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 "...
26
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 ...
10
votes
2
answers
753
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
3k
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 ...
18
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
245
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
421
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 ...
4
votes
2
answers
856
views
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 #&...
3
votes
1
answer
346
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 ...
4
votes
2
answers
915
views
Using C64 floating point kernal routines with 16 bit integer
How to use floating point kernal routines for 16 bit arithmetics such as: $1234*$ABCD or $1234/$ABCD ?
22
votes
3
answers
6k
views
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, ...
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 ...
39
votes
4
answers
21k
views
Who is credited for the creation of Assembly Language?
The C Programming Language was originally developed by Dennis Ritchie who also co-designed the Unix operating system with which development of the language was closely intertwined.
Is there a ...
8
votes
3
answers
1k
views
Was The Telemark Assembler available for the Unix or Mac Environments?
I'm trying to build the recently released Infinity Game Boy Color source code on my macOS El Capitan box. The original development environment was a Windows box, and I'm trying to modify the build ...
10
votes
11
answers
949
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 ...
17
votes
3
answers
2k
views
Why can't I invoke the next interrupt service by incrementing the AX register after calling the same interrupt?
I have two snippets of 8086 assembly code, both of which are supposed to do the same thing: make the mouse appear on the screen.
Show_Mouse:
push ax
mov ax,0 ;Reset Mouse
int 33h
...
7
votes
1
answer
699
views
Adding control characters to string constants in ca65 assembler
According to the cc65 documentation, a string constant in assembler programs can be defined with the .ASCIIZ command. However, I could not manage to sneak control commands in, for example, the ...
6
votes
2
answers
461
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 ...
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 ...
0
votes
1
answer
250
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 ...
16
votes
1
answer
6k
views
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