Dear All:
Who known the usage of "load" instrction? In the belowing code, It shows "value out of range". Why?
But if using the "load LoadConst byte from 'config.sys':5" , the complier OK.
Whose know the reason and solution it?
Thank you.

; fasm example of writing 16-bit COM program

org 100h ; code starts at offset 100h
use16 ; use 16-bit code

display_text = 9

finit
fld1
fild
fyl2x
fistp

mov ah,display_text
mov dx,hello
int 21h

mov ah,display_text
mov dx,var
int 21h

int 20h

hello db 'Hello world!',24h
DIMMSIZE DW 0h
TempVar dw 0
;FILE 'config.sys':10h,5
load LoadConst byte from 5
if ~defined var & used var
var db 'Macro Syntax Test',24H
end if
Posted on 2003-04-10 11:44:26 by Kevin_Zheng
This error means that you are trying to load value from the address out of current addressing space. This is because you've used "org 100h" directive and therefore the addressing space from where you can load values begins at address 100h and ends at address, where load directive is used (it's TempVar+2). If you did load LoadConst byte from 100h, the LoadConst would have value of the first byte of finit opcode.
Posted on 2003-04-10 12:11:49 by Tomasz Grysztar
Dear Privalov:
Thanks you big helpping! I have modifed the code and running OK.
Best regards.

; fasm example of writing 16-bit COM program

org 100h ; code starts at offset 100h
use16 ; use 16-bit code
display_text = 9
;Out put the string
mov ah,display_text
mov dx,hello
int 21h

;Output the ASCII
mov ah,09H
mov al,TestLoad
mov bh,0
mov bl,30H
mov cx,10
int 10h

;Out put the load string
mov ah,display_text
mov dx,HelloLabel
int 21h

int 20h

hello db 0DH,0AH,'Hello world!',24h

label HelloLabel byte at hello
FileVar file 'config.sys':5,3
load TestLoad byte from HelloLabel+2
Posted on 2003-04-10 23:45:37 by Kevin_Zheng