[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 318
  • Last Modified:

Mem[$0: $417] in Borland Pascal

i'm worcking in borland pascal at protected mode and i try to access this address [$0:$417] but program not worck with RunTime Error (216).

As you now the Byte $417  is used to make control to keys(Num, Caps, Scroll,
,Alt, ShR, ShL, CtrlL, CtrlR)


 
0
bakry99
Asked:
bakry99
  • 2
  • 2
1 Solution
 
bakry99Author Commented:
correct
As you now the Byte $417  is used to make control to keys(Alt, ShR, ShL, CtrlL, CtrlR)

eg
Mem[$0:$417]:=(Mem[$0:$417])and 1
 that meen Shift right pressed
0
 
HypoCommented:
I'm sorry to say that you can't access that memory in protected mode. not in that way you're trying to anyway...

The memory in protected mode does not work like it does in real mode.
MEM[0:$417] points to one physical location in realmode and another one in protected mode. If you want to use Ctrl, Shift etc... you should use your DPMI handler to map that memory area into a valid protectedmode segment.
0
 
HypoCommented:
Fortunatley, you don't have to do that... since pascal maps that memoryblock on startup. Instead of using mem[0:$417] you should use mem[Seg0040:$17], it works in both real and protected mode. (you know that mem[0:$417] = mem[$40:$17]?)

Seg0040 points to the realmode segment $0040 in protectedmode.

Use mem[Seg0040:$17] when you work in protectedmode instead of mem[0:$417]!!!
0
 
bakry99Author Commented:
thanks Hypo
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now