Questions tagged [real-mode]

x86 real mode is where a CPU begins execution. It has a 20-bit memory address space and unlimited direct software access to all addressable memory, I/O addresses and peripheral hardware. It has no concept of virtual memory, paging or memory protection as in protected-mode and long-mode. Use this tag for programming questions related to real mode.

Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs.

Real mode is characterized by

  • a 20-bit segmented memory address space (giving exactly 1 MiB of addressable memory) and
  • unlimited direct software access to all addressable memory, I/O addresses and peripheral hardware, it
  • provides no support for memory protection, multitasking, or code privilege levels.

Before the release of the 80286, which introduced real mode was the only available mode for x86 CPUs. In the interests of backwards compatibility, all x86 CPUs start in real mode when reset, though its possible to emulate real mode on other systems when starting on other modes.

281 questions
3
votes
1 answer

How did debuggers for 16-bit real mode programs produce stack traces?

I'm messing around with running old DOS programs in an emulator, and I've gotten to the point where I'd like to trace the program's stack. However, I'm running into a problem, specifically how to detect near calls and far calls. Some pretext: A…
jpfx1342
  • 868
  • 8
  • 14
3
votes
1 answer

Why the address is 0xF000:0xE05B in the long jump instruction located at 0xFFFF0 in BIOS?

We know that on x86 when power is on, CS register is set to 0xF000 and IP is set to 0xFFF0. And the instruction at 0xFFFF0 is jmp far 0xF000:0xE05B. The question is why is it 0xE05B but not other addresses? If it is for compatibility, how does its…
Lime
  • 71
  • 6
3
votes
1 answer

(assembly x86 real mode) Data gets "cut off" at the end of the program?

This is a follow-up from (nasm x86 real mode) How to write/read strings in boot-loaded sector?. I'm working on a toy OS for x86 real mode in NASM. The 512B boot sector loads another sector with the rest of the code. The problem is that I seem to run…
jth
  • 369
  • 3
  • 8
3
votes
1 answer

How would I implement Int 16h to use the keyboard to navigate through my program?

My goal is to use the Int 16 instruction to be able to move up and down through a program using the arrow keys until my user decides to press the escape key. Do I read in multiple key presses using the following code in a loop and adding a terminate…
Assembler246
  • 39
  • 1
  • 3
3
votes
1 answer

Simplest chainloading a boot manager

In order to boot from flash memory drive we load disks using the BIOS interrupt 13h in real mode with specifying the disk 0x80. Another disks should be accessed by 0x81, 0x82... as mentioned over this link I am trying to make my simple GRUB. My very…
user7688222
3
votes
1 answer

DOS debug.exe: Restricted areas of memory?

(this my first question, excuse me for any mistakes) I was messing around with debug.exe and tried to alter the BIOS date stored in address range FFFF:0005 to FFFF:000C. -d FFFF:5 L 8 FFFF:0000 30 31 2F-30 31 2F 39 32 …
JohnyQ
  • 31
  • 1
3
votes
1 answer

STOSB instruction not storing byte when run from a bootloader

After making a small bootloader to teach myself assembly language, I noticed that the stosb instruction does not seem to be work. I compressed the issue to a minimal example: BITS 16 start: mov ax, 07C0h add ax, 288 mov ss, ax mov sp,…
zerotwo77
  • 188
  • 1
  • 5
3
votes
1 answer

Is pipelining/OoOE available on modern x86 processors when running in real mode?

When running a boot-loader program on a modern-day x86 processor, the processor will be running in real-address mode. Will its instruction pipelining features be active in real mode, or not?
3
votes
2 answers

Error while printing a string from assembly code

I'm new to assembly and the course that I follow uses EMU8086. I wrote this code to print Testing and the ASCII code of 50 which is number 2 but it only prints Testing and ignores the rest. What's wrong? .model tiny .code org 100h main proc …
Moe
  • 432
  • 1
  • 6
  • 21
3
votes
1 answer

Second stage of bootloader prints garbage using Int 0x10/ah=0x0e

I am trying to learn assembly and to write a bootloader. The following code loads the contents of a floppy drive to memory and jumps to it (starts loading at address 0x1000). This code is supposed to print "X" on the screen, but for some reason it…
RainingComputers
  • 554
  • 6
  • 17
3
votes
2 answers

TASM program outputs garbage and may hang upon exit

I have the following code, which takes a number in hexadecimal format and prints out its decimal format. This program runs kinda fine in Turbo Debugger, but when I run it in DOS, I see some extra symbols in output after my number output: .model…
vladfau
  • 1,003
  • 11
  • 22
3
votes
1 answer

accessing 4GB RAM in real mode

Is it possible to using 4GB ram in real mode through enabling A20, without switching to protect mode, and without loosing BIOS interrupts?
vakus
  • 732
  • 1
  • 10
  • 24
3
votes
1 answer

How to list network devices in NASM (custom OS)

I have a custom, DOS-like OS built in NASM completely (no C code). It is very modest (it does have a FAT file system, few apps, is in real mode, etc.) I want to write a command that will list all the network devices (network cards) that are…
Sasha
  • 43
  • 6
3
votes
3 answers

Bootloader stack configuration

the following is the start of the code for the educational real mode x86 operating system MikeOs. (mikeos.sourceforge.net) As I understand it the x86 stack grows 'down' that is towards low memory, and the stack segment register ss points to the…
3
votes
2 answers

What interrupts are available in 8086 real mode?

I have read about BIOS interrupts, and know that they can be accessed only in 8086 real mode. My questions: Are there any other interrupts also available ? I have read about DOS interrupts, but I am confused as to if they are available in real mode…
Cygnus
  • 3,222
  • 9
  • 35
  • 65