72 votes

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

In a brief email conversation with Al Lowe (yes, the man himself!) he suggested that he probably used the COMMAND.COM file as the basis for this code as it would have been installed on every PC. ...
Noel Whitemore's user avatar
47 votes
Accepted

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

It's most definitely not a program 'written' by a programmer, but rather a listing of some random program segment using the disassembly command of a debugger. Have you tried to find that code within ...
Raffzahn's user avatar
  • 219k
33 votes

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

The question seems to been written under an assumption that there must have been a company wide one way change ("switch") from one language to another that change being company wide ...
Raffzahn's user avatar
  • 219k
24 votes
Accepted

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

For sar and sal (and the other shift instructions), you need to use the cl register if you are shifting by more than one bit. So: mov cl, 4 sar al, cl
Greg Hewgill's user avatar
  • 6,869
23 votes
Accepted

Difference between machine language and machine code, maybe in the C64 community?

That video probably tries to add a bit too much definition into blurry terminology, at least my opinion. In fact, all three ways he describes are ways of creating machine code, and, at the same time, ...
tofro's user avatar
  • 34.1k
21 votes
Accepted

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

You can, in fact, relatively reliably and safe, detect a 6845 in your system by trying to write to a 6845 register and see whether you can read back the same value. I have successfully done that with ...
tofro's user avatar
  • 34.1k
20 votes
Accepted

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

SPARC instructions are 32-bit in size, so you cannot load a 32-bit pointer as an immediate in one instruction. This is typical of any RISC architecture. The alternatives are to split the immediate ...
matja's user avatar
  • 481
18 votes

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

Today ...would you expect that we're loading the low byte or the high byte of SOME_LABEL? > is rather universal for the high byte while < selects the low byte. Rather easy to remember when ...
Raffzahn's user avatar
  • 219k
17 votes
Accepted

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

C64 screen memory by default begins at $0400. The ORA #$04 ensures that you are treating location (0, 0) as address $0400, treating the location one to the right of that as $0401, etc. It has the same ...
Tommy's user avatar
  • 36.6k
16 votes

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

On its own, not much. As a whole, the code doesn’t seem to make much sense, though some instruction sequences in it do look realistic. Judging by the form of each instruction, the code was almost ...
user3840170's user avatar
15 votes

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

8086/8088 has imul but only in the one-operand widening form, just like mul where it does DX:AX = AX * r/m. Note that's r/m, not imm16, so you will have to mov your constant into a register first (...
Nate Eldredge's user avatar
14 votes

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

[As @Justme mentions, there is no need to make files larger than 64 KiB to use far calls. He's also right that this question is more about tool usage - or better picking the right format: .EXE vs .COM....
Raffzahn's user avatar
  • 219k
14 votes
Accepted

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

To give a very general, but pragmatic answer, you could say around the time of the N64. Nintendo 64 games were largely written in C. From the Ultra64 Fan website: N64 game applications are written in ...
zippy's user avatar
  • 156
13 votes
Accepted

Assembly delay function for C64

I would get something like this... Yes, all of them. The code may be fast enough to report a line multiple times, get all lines and miss some, all at once. It all depends on the machine setup, other ...
Raffzahn's user avatar
  • 219k
13 votes

Difference between machine language and machine code, maybe in the C64 community?

An assembler actually does two important but separate things to help the programmer. One, which you mentioned, is to convert instruction mnemonics into opcodes, based on the addressing mode (e.g., LDA ...
cjs's user avatar
  • 25k
13 votes
Accepted

Help understanding TAIPAN source code for the Apple II

You don't need to follow the listing far to see the problem. Line 10 ends with GOTO 10000, and 10000 starts with CALL 6147, which is $1803, smack in the middle of the Applesoft source code, which ...
Nick Westgate's user avatar
13 votes

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

There's evidence of the existence of source code projects and compilers in at least Nintendo 64 launch titles. Doom was a C project so presumably that port was probably also in a high-level language. ...
davolfman's user avatar
  • 555
12 votes

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

https://pushbx.org/ecm/doc/insref.htm is a corrected + improved version of the appendix of the NASM manual that documents the CPU required for each form of each instruction, along with English ...
Peter Cordes's user avatar
  • 3,197
12 votes

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

TL;DR: It looks at the disk mounted PC-DOS simply looks at the media present and acts accordingly. At least since 1.1/2.0. PC-DOS 1.0 only assumed. Details The only functions of int 13h available ...
Raffzahn's user avatar
  • 219k
12 votes

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

Assuming the address space of the CPU is 100% writeable (i.e. no ROM somewhere), these routines seem in fact to clear all of the memory (including the routines themselves) to either zero or the opcode ...
tofro's user avatar
  • 34.1k
12 votes
Accepted

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

You can go with: 653D .ORG 653dh 653D 06 00 LD B, 0 653F 0D DEC C 6540 03 INC BC 6541 ED ...
Selvin's user avatar
  • 236
11 votes

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

The Paku Paku game source code doesn't directly detect it. The strategy is to detect VGA, EGA, Tandy, PCJr, etc etc, then if none of those "hit", assume it is CGA. Does it, or would MDA ...
Raffzahn's user avatar
  • 219k
11 votes

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

If all the other adapters have already been detected to be absent from the system, the possible options are that there are no MDA or CGA adapter at all, there is either MDA or CGA adapter installed, ...
Justme's user avatar
  • 30.4k
10 votes
Accepted

Undocumented ModR/M byte combinations

As part of his series about the 8086 micro code Ken Shirriff has just added a blog post where he analyses some of the mentioned cases: Undocumented 8086 instructions, explained by the microcode It ...
Raffzahn's user avatar
  • 219k
10 votes
Accepted

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

I can't believe I only see this topic so long after it was post ! For reference: I made the 68k optimizations of the video engine of a recent and quite famous game. The Genesis Software Manual scanned ...
Olivier's user avatar
  • 659
9 votes

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

You'll never find a good single number for this sort of thing. One factor is that software time estimation is famously difficult in-general. Nobody has ever been good at estimating how long software ...
wrosecrans's user avatar
  • 2,264
9 votes

Assembly delay function for C64

Going from recollection, I got pretty decent results by waiting for line 0, then line 100 (pick a random, but different line) counting one frame, then repeating the cycle. I'd also have written the ...
Jerry Coffin's user avatar
  • 4,752
8 votes

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

I wanted to make a few examples of what I mentioned in a comment. That is, to create an MZ .EXE header or to manually implement relocations in a flat format binary, all using only NASM's multi-section ...
ecm's user avatar
  • 923
8 votes

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

TL;DR The productivity gain is in the portability of the "C" language relative to Assembly. I think you might have an unintended caveat in the question in referencing a specific dialect of ...
Brian H's user avatar
  • 60.5k
8 votes

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

TL;DR: I wonder if that observation is heavily biased by looking at today's all-influencing x86 architecture and its direct predecessors (x80). From my memory the described behaviour is only shown by ...
Raffzahn's user avatar
  • 219k

Only top scored, non community-wiki answers of a minimum length are eligible