Questions tagged [assembly]

For questions about Assembly Language in general. Also use the appropriate processor's tag.

Filter by
Sorted by
Tagged with
3
votes
3answers
408 views

How to transfer the address of a data block into zero page using the Merlin 8 assembler on my Apple //e?

I've been fooling around with the Merlin 8 (v2.58) assembler on my Apple IIe and ran into a small snag. Basically, I would like to load the address of a block of data into a two-byte pair in zero ...
0
votes
0answers
117 views

How can I play MIDI with assembly? [closed]

I use DOSBOX with 8086x assembly and I want to add to my game project background music with MIDI
11
votes
2answers
364 views

Best learning path for Apple IIe assembly language [closed]

I have an emulator up and running and access to the asimov ftp site, and I want to learn how to program assembly language on the Apple IIe. What assembler should I use (Merlin? LISA?) and what book or ...
8
votes
3answers
645 views

How can I access/use memory outside of the standard 1 MB address range of MS-DOS?

How do you access more memory (above the 1MB) in DOS if the 640KB of conventional memory are not enough? I have read a lot about this, but I couldn't figure out how to do this in actual code. Is ...
5
votes
3answers
283 views

Did the Apollo Guidance Computer or other multi-ROM machines subdivide code between ROM chips/modules to facilitate partial updates?

The Apollo Guidance Computer had its code stored in six modules that held 6 kwords of storage each, and the design of each module was such that changing even a single bit after construction would have ...
7
votes
2answers
1k views

Imaging a HDD from DOS over Serial

I have recently fixed an old IBM Clone, which has an MFM hard drive. The PC booted up fine, but then I saw, that a few years back, I have deleted a few important files (probably by mistake). The ...
1
vote
5answers
730 views

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

RTC 16bit I/O read/write

Why can't RTC (0x70, 0x71) read and write 16 bits? such as Mov ax, 0xa8f Out 0x70, ax But I found in a 286 BIOS that they did this: (BIOS ID string: S286-6181-101590-K0) 00005357 B87253 ...
52
votes
7answers
9k views

Why did the MS-DOS API choose software interrupts for its interface?

Access to the DOS API was done through the INT 21h x86 instruction. This was always counter-intuitive to me, coming from 8-bit systems that accessed system services by calling subroutines through a ...
10
votes
2answers
715 views

Zilog Z80 estimated time discrepancy

I am writing a basic Zilog Z80 assembly language interpreter and something I noticed as I went through the 8 bit load commands is that the estimated times for LD (IX+d), n and LD (IY+d), n are ...
14
votes
11answers
6k views

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 ...
3
votes
3answers
148 views

ca65 vs tass syntax: converting a hex address to decimal?

Most of the tass example programs start with a header like this, which places BASIC code at the beginning of the file that has an appropriate SYS instruction to run the rest of the application: * ...
4
votes
2answers
635 views

Adding a register to the accumulator in 6502

In the past, the only assembly programming I've done has been a tiny bit of ARM, and then a larger game project in 68k. In 68k I was used to being able to do things like add.l d0, d1 to add the ...
6
votes
1answer
206 views

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 ...
2
votes
1answer
106 views

In vasm 1.7d targeting 68000, how to assemble with program counter at specific address without padding?

I'm programming for the Sega Mega Drive using vasm 1.7d assembler. I'm copying a block of my code from ROM to RAM so I can do some self-modifying code. ; First $200 bytes are header, dc.b ...
21
votes
2answers
2k views

Why didn't the 6502 have increase/decrease 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. ...
10
votes
5answers
760 views

Has there ever been a instruction set architecture that did not require instruction decoding at all?

I am studying basic principles of instruction set architectures and am considering what it would take to not have any instruction decoding at all. I.e., all the control lines of the computer would be ...
67
votes
9answers
8k 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 ...
18
votes
4answers
3k views

Why are branches relative in many 8-bit CPUs?

I was looking over an old article on the 6809 and was perusing the opcodes and noticed that the branch instructions came in two flavors, long and short. That sparked a memory about one of the 6502-...
13
votes
3answers
1k views

Memory models for assembly libraries for Turbo C

Turbo C follows the Intel Memory Model where in Tiny, Small and Compact models calling a function is near but in Medium, Large and Huge models calling a function uses far calls. If I want to develop ...
4
votes
0answers
100 views

MICRO 800 assembler?

I'm reading (well, writing...) about the FLOW language and it mentions the "MICRO 800 assembler". This was in the early 1970s, and I can't imagine what this might be. The context suggests it was on ...
4
votes
1answer
223 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
1answer
182 views

Different handling of ASCII interpretation between ca65 and cl65

I stumbled upon a divergence in the ASCII upper case/lower case handling when using assembler and linker of the cc65 suite separately (I used cc65 V2.15 on Win10). For a test I made the following ...
5
votes
1answer
279 views

How can I change the MSX function keys using ASM?

How can I change the texts assigned to MSX function keys using Z80 ASM?
15
votes
6answers
5k views

How slow was the 6502 BASIC compared to Assembly

Imagine a modern computer, where let's say Python is a high level programming language and needs to be interpreted in order to execute a piece of code. You could write some code in C, compile it, ...
19
votes
3answers
3k views

What makes MOVEQ quicker than a normal MOVE in 68000 assembly?

I'm "re-learning" 68000 assembly language and came across the "MOVEQ" command that is labeled "MOVE QUICK". According to the NXP Programmers Reference Manual (reference below), the command MOVEQ (...
29
votes
9answers
10k views

How did early x86 BIOS programmers manage to program full blown TUIs given very few bytes of ROM/EPROM?

I've always wondered how so much functionality and relative luxuries(CMOS Configuration Utilities. See: https://geekprank.com/bios/ for an example) included with most popular x86 BIOSes could be ...
8
votes
1answer
210 views

Are there any PDP-8 assemblers that create linkable object files?

I am currently writing a compiler for the PDP-8. The compiler is going to translate source code into PDP-8 assembly code that calls some runtime routines to perform high-level functions such as ...
5
votes
1answer
530 views

What can an 8086 CPU do if an x87 floating-point coprocessor is attached to it? [duplicate]

As far as I know, old x86 CPUs (for example: the 8086 CPU) couldn't do floating point arithmetic, and in order to be able to do floating-point arithmetic, an x87 floating-point coprocessor should be ...
8
votes
1answer
390 views

What's the fastest way to ignore keypresses?

I'm writing a game for the IBM PC (running MS-DOS), complete with fancy cutscenes. Unfortunately, though, the keys pressed during those fancy cutscenes are carried out once the fancy cutscene has ...
5
votes
5answers
549 views

Did any assemblers work like this?

Once you get past the stage of manually entering numeric machine code, the most primitive programming tool is a machine code monitor. Intended primarily as a debugging tool, this works with a target ...
4
votes
3answers
458 views

Z80 unexpected output

I am trying to build a Z80 computer inspired by Grant Searle's design. I'm starting simple, with just a clock (clocked by an AVR pulsing at at 12.5 Hz for testing), a Z80, and a 8K EEPROM with a ...
9
votes
1answer
795 views

Looking for a specific 6502 Assembler

I found some 6502 assembler code for a Commodore 64 program that uses meta commands like #include "foobar", define the address to be assembled to via *=$1234 and define labels without a colon. ...
6
votes
3answers
834 views

Comparing Signed Numbers on Z80 (8080) in Assembly

How do you compare two signed numbers in Z80 assembly? According to this site, To compare stuff, simply do a CP, and if the zero flag is set [then] the argument[s] were equal, else if the carry ...
6
votes
1answer
465 views

Common practices of programming the AY-3-8910 on Amstrad CPC: via Firmware routines or directly?

I'm starting to learn how to program in assembly (z80) on the Amstrad CPC computer. As an high level developper i find it pretty fun and i learn a lot of things about computer and CPU architecture. ...
32
votes
6answers
11k views

Which was the first programming language that had data types?

Machine language (and Assembly language) don't have the concept of data types, so if you want to add an int and a float variables in Assembly, you have to use the appropriate Assembly instruction that ...
21
votes
5answers
8k views

Will PC-DOS run faster on 4 or 8 core modern machines?

When I run PC-DOS on my 4 core AMD Phenom chip, does it take advantage of the extra parallel CPU's? If not, is there a way to coax DOS to use all available CPU's or does this require specific ...
1
vote
1answer
274 views

What don't I understand about this LR35902 code?

The question you are now reading is about a comment on this question, about overflow bugs in some Pokemon game. A comment on that question says: It was Game Freak's first project. They just were ...
1
vote
6answers
1k views

Compile the 6502 assembler source code for running on modern computers [closed]

I want to make an executable file for modern computers that you can download and run without any other software, using any kind of a 6502 assembler. Can I compile source code, written for the 6502, ...
1
vote
2answers
581 views

Does anyone have an x86 EGA draw pixel routine?

So far, I have gotten by with using the BIOS draw-pixel routine here: http://stanislavs.org/helppc/int_10-c.html This works of course, but I can't imagine that commercial games used this BIOS call as ...
15
votes
1answer
549 views

Why does AT&T syntax use * and $?

In a comment to an answer about AT&T assembly syntax, another-dave asked the following: DEC used #foo for an immediate operand in -11 assemblers; the Unix guys apparently preferred $foo, which ...
13
votes
2answers
786 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: ...
4
votes
1answer
281 views

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?
8
votes
2answers
1k views

What is the meaning of M in the Z80 statement ADD A,M

Recently I have been trying to compile CP/M 2.2 from source. When I try to assemble, everything works except for the instructions ADD A,M and SBC A,M, which the assembler returns a syntax error. I ...
12
votes
2answers
955 views

Does the Commodore 64 have the PHX opcode?

Code written for the Commodore 64 sometimes uses the PHX opcode, which should push X onto the stack. There also are plx, phy, ply. These were apparently added on the CMOS versions of the 6502; very ...
3
votes
2answers
358 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 #&...
2
votes
2answers
402 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 ?
9
votes
1answer
1k views

Why does this 6502 code push a function address onto the stack before calling?

I am learning how to program the Atari 800 by examining some tutorial code that came with the IDE/Assembler I am using. I am using the MADS assembler for this. putchar_ptr = $346 csrhinh = 752 ...
8
votes
2answers
898 views

How useful were the 6809/6309's indirect addressing modes?

Much like the VAX, the 6809 and 6309 have a preponderance of indirect addressing modes (in VAX parlance, "deferred"), though neither go so far as to include a VAX-like doubly-indirect mode. To what ...
16
votes
2answers
5k views

What does “jmp *” mean in 6502 assembly?

Right now I am learning 6502 assembly. Currently I am using the MADS assembler to program for the Atari 800. This program is just a small tutorial program that came with the assembler zip file I ...