The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [assembly]

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

Filter by
Sorted by
Tagged with
7
votes
2answers
528 views

Unsigned addition on the 6502

I am currently playing around with pointer and indirect addressing on the C64 and I encountered a problem with the ADC opcode. I am trying to increment a number repeatedly and when it overflows (goes ...
7
votes
3answers
807 views

Is there a way to link object files for DOS from Linux?

I'm able to use NASM to assemble simple COM files from my modern Linux computer, but how can I create a DOS EXE file while still in Linux? Specifically, I am interested in a solution that will target ...
7
votes
3answers
519 views

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

When did Intel undergo the SEX change?

I am reading the book "The 8086 / 8088 Primer Second Edition" by Stephen P Morse. In it on page 54, it says The 8086 provides instructions to facilitate the task of sign extension. These ...
7
votes
2answers
7k views

Best path to learn C64 assembly [closed]

The amount of tutorials, youtube videos, scanned books on C64 programming is overwhelming. What materials would you recommend -- and, importantly, in what order! -- to build a path to programming my ...
6
votes
3answers
521 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
4answers
808 views

How were interpreters loaded into computers?

I have been learning about PCs, the first of which was the Altair 8800. So that users could run programs, Micro-Soft created a BASIC interpreter to allow the program to be mapped to processor ...
6
votes
1answer
407 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. ...
6
votes
4answers
721 views

Reason behind “ASCII Adjust” instructions being ASCII and not BCD?

I'm just curious if there was ever other instructions that were more ASCII-centric than the CISC associated ones we're left with now? Specifically, all the Binary Coded Decimal (BCD) instructions ...
6
votes
1answer
335 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
2answers
1k views

Why the “jmp” instruction is not working?

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 ...
5
votes
5answers
505 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 ...
5
votes
1answer
344 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 ...
5
votes
1answer
251 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?
5
votes
1answer
508 views

What instructions for the 8086 and subsequent x86 CPUs are not available in Long Mode?

I know from this answer that, Modern x86 CPUs are binary compatible with 8086. You can literally run 8086 binaries on a modern PC, in real mode. (The species analogy is a stretch here, but works ...
5
votes
1answer
414 views

Can someone help me get xROAR to read files? (M6809/TRS-80 ColorComputer)

I implemented a Forth interpreter or the TRS-80 Color Computer (M6809) way back in the 1980s, and I've been trying to figure out how to get it loaded into an emulator to test some parts of the ...
4
votes
3answers
403 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 ...
4
votes
1answer
256 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?
3
votes
2answers
310 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
1answer
550 views

How does JSR actually work on the 65c816 CPU for the SNES (Super Nintendo)?

Take the following machine code for the 65c816 for the SNES (Super Nintendo): 00000000 ea ea 78 18 fb c2 18 a2 ff 1f 9a 20 fa 80 e2 20 |..x........ ... | 00000010 a9 80 8d 00 21 a9 e0 8d 22 21 ...
2
votes
2answers
355 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 ?
2
votes
1answer
467 views

What do the addressing modes imm, dir, and abs mean for the 65c816?

From http://www.6502.org/tutorials/65c816opcodes.html#6.1.1.2 For the CPX instruction: E0 3-x 3-x imm x.....xx . CPX #$54 E4 2 4-x+w dir x.....xx . CPX $10 EC 3 5-x ...
2
votes
1answer
128 views

Can't enable list even with “enable run-stop” poke

Well, I've downloaded an old non-English textual adventure, which of course, "for the sake of professionalism" have list disabled. Even after entering pokes for enabling "run-stop/restore" and for ...
1
vote
2answers
213 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 ...
1
vote
2answers
460 views

Resource for 6502 assembly directives?

I am currently learning about 6502 assembly. One of the documents I am learning about it from is a super mario bros. disassembly document. When I was reading the code I noticed part of the code had ...
1
vote
1answer
453 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 | | ...
1
vote
2answers
185 views

(How) can I safely use direct addressing for machine code routines on the Epson HX-20?

I am working through the exercises of Lance Leventhal's 6800 Assembly Language Programming on my Epson HX-20. My understanding is that the HX-20's Hitachi 6301 processor is compatible with the ...
1
vote
1answer
260 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
1answer
50 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 ...
0
votes
3answers
733 views

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 ...
0
votes
6answers
934 views

Can you compile 6502 assembly into a stand-alone PC application? [closed]

6502 assembly is a language meant for humans to write themselves, not compilers. It's an older Assembly that powered the olden days of computing and consoles such as the NES and Atari 2600. I want to ...
0
votes
2answers
403 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 ...
-6
votes
4answers
872 views

What is the starting address pointed by Stack Pointer in PDP 11?

To which memory location does the stack pointer point at the beginning of the program in PDP 11? And what can be the end address the SP can point to before overflow occurs?