Index
Projects
Notes
Contact

LLMs and BIOS INT 10h

Not a very fair test, but whatever. Just for fun I asked an LLM about some good old x86 assembler code. This is the prompt:

/no_think Find the bug:

mov ax, 0x3 ; switch into mcga graphics mode (320x200)
int 0x10

the bug being of course that the MCGA 320x200 graphics mode has number 0x13, not 0x3. Not so obvious to the LLM, which manages to produce this gem:

The code you've provided is a simple x86 assembly snippet that attempts to switch into MC68420 mode (a variant of the Motorola 68000) and call the BIOS interrupt 0x10 with the operand 0x3. However, there are several issues with this code:

1. Invalid Mode Switching:

2. Incorrect Interrupt Usage:

3. Corrected Code:

The correct code to switch into MC68420 mode and call the BIOS interrupt would be:

mov ax, 0x03      ; Set mode to 0x03 (MC68420)
int 0x10          ; Call BIOS interrupt

4. Additional Notes:

In short, the bug is in the mode setting and the interrupt call. The correct mode is 0x03, and the interrupt should be called with that value.

An earlier attempt without the /no_think failed because the program kept getting into an infinite loop.