Assembler doesn't work. WHY? 
Author Message
 Assembler doesn't work. WHY?

Hi,

This has been bugging me for SEVEN years, and no one has been able to
give me a solution. Using Borland Turbo Pascal 7.0, I need the following
piece of assembler code into my program (I know *NOTHING* of assembler):

  MOV AH,0D              ; Disk Reset
  INT 21h                ; causes SmartDrv 4.x to write cache
  MOV AX, 40             ; set up segment addressing MOV DS, AX
  DS:
  OR  BYTE PTR [17],0C   ; equivalent of pressing CTRL+ALT
  MOV AX,4F53            ; Issue a "DEL" (53h = DEL scan code)
  INT 15h                ; EMM386 sees this & shuts down
  DS:
  MOV WORD PTR [72],1234 ; Set REBOOT flag to Warm-Boot (0=cold)
  JMP F000:FFF0          ; Execute the internal restart routine

The above code produces a 32 byte .COM file in debug. So far, with the
help of others, I've come to the followong procedure for TP 7.0.

procedure bootwarm; far{?}; assembler;
asm
  mov AH, $0D
  int 21h
  mov AX, $40
  mov DS, AX
  or  BYTE PTR DS:[$17], $0C
  mov AX, $4F53
  int 15h
  mov word ptr DS:[$72], $1234
  jmp [$F000:FFF0]              // Syntax error!
end;

(Same error for: $F000:FFF0, $F000:$FFF0, [$F000:$FFF0] etc.)

As you can tell, I'm writing a little boot program for DOS.

The problem is the last line, which is a far jump, but I have tried
every possible syntax I can think of, but the compiler won't have it.
PLEASE help, I want to FINISH this little {*filter*} already...

-- Erwin Dokter

    http://www.*-*-*.com/



Wed, 18 Jun 1902 08:00:00 GMT  
 Assembler doesn't work. WHY?


Quote:
> Hi,

> This has been bugging me for SEVEN years, and no one has been able to
> give me a solution. Using Borland Turbo Pascal 7.0, I need the
> following piece of assembler code into my program (I know *NOTHING*
> of assembler):

>   MOV AH,0D              ; Disk Reset
>   INT 21h                ; causes SmartDrv 4.x to write cache
>   MOV AX, 40             ; set up segment addressing MOV DS, AX
>   DS:
>   OR  BYTE PTR [17],0C   ; equivalent of pressing CTRL+ALT
>   MOV AX,4F53            ; Issue a "DEL" (53h = DEL scan code)
>   INT 15h                ; EMM386 sees this & shuts down
>   DS:
>   MOV WORD PTR [72],1234 ; Set REBOOT flag to Warm-Boot (0=cold)
>   JMP F000:FFF0          ; Execute the internal restart routine

> The above code produces a 32 byte .COM file in debug. So far, with the
> help of others, I've come to the followong procedure for TP 7.0.

> procedure bootwarm; far{?}; assembler;
> asm
>   mov AH, $0D
>   int 21h
>   mov AX, $40
>   mov DS, AX
>   or  BYTE PTR DS:[$17], $0C
>   mov AX, $4F53
>   int 15h
>   mov word ptr DS:[$72], $1234
>   jmp [$F000:FFF0]              // Syntax error!
> end;

> (Same error for: $F000:FFF0, $F000:$FFF0, [$F000:$FFF0] etc.)

> As you can tell, I'm writing a little boot program for DOS.

> The problem is the last line, which is a far jump, but I have tried
> every possible syntax I can think of, but the compiler won't have it.
> PLEASE help, I want to FINISH this little {*filter*} already...

1) Use db aa,bb,cc,dd,ee where you look up the aa/bb/cc/dd/ee in debug,
or
2) link in an .OBJ file,
or
3) jump through a pointer

Was dat nou zo moeilijk?

Robert
--
Robert AH Prins

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 Assembler doesn't work. WHY?

The way you were trying to jump to a spot in memory will not properly
compile under TP 7.0.  So you have to do it manually.  I have done that for
you.  This code should do what you want.

asm
  mov AH, $0D
  Int 21h
  Mov AX, $40
  Mov DS, AX
  or BYTE PTR DS:[$17],$0C
  mov AX, $4F53
  Int 15h
  Mov word ptr DS:[$72],$1234
  DB $0EA
  DW $0F000
  DW $0FFF0
end;

                                                            Tyler Prete

"Let only the best overcome you, then overcome them."



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why Doesn't This Work?

2. Why GetData doesn't work with TBLOBField???

3. Why doesn't this alias work?

4. Stored Procedures: Why doesn't it work with Personal Oracle

5. Simple proggie doesn't work, but why?

6. Sorting tables doesn't work WHY?

7. QR2 : why doesn't inheritance work ?

8. Why is it that SVGA doesn't seem to work in TP for me

9. why the engguy.pas doesn't work?

10. Why doesn't MSACCESS driver work?

11. Why Doesn't TTable.Refresh Work Here?

12. Why doesn't it work?

 

 
Powered by phpBB® Forum Software