16 bit Assembly

Home   Site Map   Instruction Index  


LFS   - Load Far Pointer Instruction

The LFS instruction is used to load (read) a segment and address from memory into registers.
The memory address most hold the Segment and offset address.

This command has 3 parts, Instruction, Register, and a 32 bit memory address made up of 16 bit Segment number followed by an offset from the start of it.

LFS loads the Segment first in to the FS Register, then loads the Offset address into the Register provided in the first operand.

Breakdown   DescriptionCode
LFS ; Instruction0F B4
SI ; Register number
[BX] ; A memory address from [BX]
  pointed to by BX
DataAddress; A Label address 25 C0

LFS using a memory address

Assembly SampleDescription
MOV BX, 0x0345;  Assign the memory address of the Pointer
or
MOV BX, DataAddress;  Assign the memory address of the Pointer
LFS SI, [BX];  Call LFS

Alternate method

Assembly SampleDescription
MOV BX, 0x0005;  Assign the memory address of the Pointer
PUSH BX
POP FS
MOV SI, DataAddress;  Assign the memory address of the Pointer to a Register

Assembly Sample Description   16 bit Machine Code
LFS SI, [BX];  Load FS and a Register
  from the memory adress in [BX]
  0F B4 33




Last Update 11/02/2023