Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bios reset in dos?

Status
Not open for further replies.

Ben3D

Technical User
Apr 22, 2003
6
0
0
GB
Okay, I have a simple piece of assembly code...now I want to jump to the bios reset area and reset the pc to a cold restart if that makes sense.

I think memory location 0472 should be 1234h, and the bios offset is at FFFF0h...

So how would I perform a reset in asm...only new to assembly...but its in a different segment so its sort of complicated.

Thanx for any help..

(i'm using the masm assembler)
 
yup...but I want to do it the other way..... I'm just learning to master asm, and wanted to see how you do it this way, instead of using int 19
 
now I have a masm assembler...but how come this line gives me an error:

jmp far 0100:0000

As this will allow me to change CS and IP...but I get the error:

"Left operand must have segment"

Thanks for any help on this

Ben
 
IIRC it would be like this:
Code:
mov	ax, 40h
mov	ds, ax
mov	bx, 72h
mov	word ptr [bx], 1234h

mov	ax, 0FFFFh
push	ax
xor	ax,ax
push	ax
retf

Good luck
 
Thanx AirCon,
thats fantastic...thats just what I wanted to know how to do....

Brilliant....couldn't work out how to do that for ages...but you've solved my problem :)

Thanx again AirCon.


Ben
 
Yes it is DOS-only. Windows works differently. You have to know what is the limitation in windows
 
the retf seems a bit long winded to me

when ever i want to perform a hard coded far jump i always use the following

this is 16bit code so the address after the opcode is a word and not a dword.

my ASM code would look something like:

db 0EAh ;Opcode for JMP FAR Immediate
dw 0h,0FFFFh

personally i use it all the time because the assemblers wont let me do it conventionally. but its alot shorter than friging the stack for a retf.

straiph



"There are 10 types of people in this world, those who know binary and those who don't!"
 
Hi adholioshake,
Windows disables the bios routine. Instead you could use the Windows API function 'ExitWindowsEx(...)'
[thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top