Hi,
I want to use jmp to jump to following memory area 1000:0. I am using following statement:
jmp 1000:0h
I am getting following error:
D:\masm prog>ml /c btlder1.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: btlder1.asm
btlder1.asm(67) : error A2096: segment, group, or segment register expected
D:\masm prog>
Can somebody help me with this ?
Zulfi.
I can think of three methods ATM, but there are probably more.
.model small
.386
.stack
.data
;---------------------------------------
; For a far pointer the segment address
; must be in the high-order word.
;---------------------------------------
fpdd dd 10000000h
fpdw dw 0,1000h
.code
.startup
push 1000h
push 0
retf
jmp fpdd
jmp dword ptr fpdw
.exit
end
hi Zulfi
you can also create an empty segment and place a label in it
or - the old-fashioned way - hard code it - lol
FixedSeg SEGMENT AT 1000h
org 0
BranchLabel:
FixedSeg ENDS
.
.
.
jmp BranchLabel
hard-code
db 0EAh ;JMP FAR
dw 0 ;offset
dw 1000h ;segment
Hi,
I am using the hard coded sol of dedndave:
Some portion of code is given below:
mov ax, 1000h; read sector into address 0x1000:0
mov es, ax
xor bx, bx
mov ah, 2; read sector function
mov al, 1; read 1 sector
mov ch,1;
mov cl,2; reading 2nd sector
mov dh, 0
mov dl, 0
int 13h
; --------------
db 0EAh ;JMP FAR
dw 0 ;offset
dw 1000h ;segment
ORG 1FEH
dw 0AA55h
;----------------------------------------------------------------------------------
END boot0
I am not getting the compilation error but I am getting a linker warning:
D:\masm prog>link16 /tiny btlder1.obj,btlder1.bin;
Microsoft (R) Segmented Executable Linker Version 5.60.339 Dec 5 1994
Copyright (C) Microsoft Corp 1984-1993. All rights reserved.
LINK : warning L4055: start address not equal to 0x100 for /TINY
D:\masm prog>
Is it a prob?
Can somebody plz help me with this?
Zulfi.
The warning would indicate a problem if the start address were supposed to 100h, which would be the case for a .COM file, but not for a boot sector.
important to understand - it is a warning - not a hard error
it is more or less providing you with extra information
as long as you did not want it org'ed at 100h, you may ignore it