Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

How to ?

$
0
0
function _RomDumpCode(Info: TRomDumpCodeInfo): Pointer;
var
CodeStart: Pointer;
CodeEnd: Pointer;
begin
asm
JMP @@End
[/font]
[font=宋体, Verdana, Arial, Helvetica, sans-serif]
{ *BEGIN* 16-bit code  }
{ -- never use it in your program! -- }
{ COM which writes ROM-BIOS to StdOut }
@@Start:
{ Dump F000:0000-F000:FFFE }
XOR eDX, eDX  // DS = 0xF000   ; Data segment
MOV DH, 0F0h
MOV DS, eDX
XOR eDX, eDX  // DX = 0x0000   ; Data offset
XOR eCX, eCX  // CX = 0xFFFF   ; Data length
DEC eCX
XOR eBX, eBX  // BX = 0x0001   ; STDOUT (file handle)
INC eBX
MOV AH, 40h   // DosCall(0x40) ; INT21, DOS_WRITE_TO_HANDLE
INT 21h
JC   @@Exit // On error exit ; AL = Error code
{ Dump F000:FFFF }
XOR eDX, eDX  // DS = 0xF000   ; Data segment
MOV DH, 0F0h
MOV DS, eDX
XOR eDX, eDX  // DX = 0xFFFF   ; Data offset
DEC eDX
XOR eCX, eCX  // CX = 0x0001   ; Data length
INC eCX
MOV eBX, eCX  // BX = 0x0001   ; STDOUT (file handle)
MOV AH, 40h   // DosCall(0x40) ; INT21, DOS_WRITE_TO_HANDLE
INT 21h
JC   @@Exit // On error exit ; AL = Error code
MOV AL, 0 // no error   ; AL = 0
@@Exit:
MOV AH, 4Ch   // DosCall(0x4C) ; INT21, DOS_TERMINATE_EXE
INT 21h
@@End:
{ *END* 16-bit code  }
[/font]
[font=宋体, Verdana, Arial, Helvetica, sans-serif]
MOV CodeStart, OFFSET @@Start
MOV CodeEnd, OFFSET @@End
end;
case Info of
   rdciStart:
Result := CodeStart;
   rdciEnd:
Result := CodeEnd;
   rdciSize:
Result := Pointer(Cardinal(CodeEnd) - Cardinal(CodeStart));
else
   Result := nil;
end;
end;

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>