Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

pointers

eitan23eitan23 Member Posts: 2
How do force a pointer to take a certain number as it's address ? for example if I want a pointer like: byte *segvga to have the value of: 0xa000:0x0000 or 0xa0000.

Comments

  • DariusDarius Member Posts: 1,666
    : How do force a pointer to take a certain number as it's address ? for example if I want a pointer like: byte *segvga to have the value of: 0xa000:0x0000 or 0xa0000.
    :
    :

    If you care about portability you don't, but you can do it as follows...

    (assuming sizeof(pointer)==sizeof(long) (i.e. use a far pointer in DOS))

    char *specific_address=(char *)0xA0000000L;

    "We can't do nothing and think someone else will make it right."
    -Kyoto Now, Bad Religion

  • eitan23eitan23 Member Posts: 2
    Thanks man, that's exactly what I did but I forgot to check that the pointers where 32bit. I'm so used to programming djgpp in protected mode that it seems obvious. Thanks again.
  • Justin BibJustin Bib USAMember Posts: 0

    _________ { http://forcoder.org } free video tutorials and ebooks about ( Delphi MATLAB Go Objective-C Scratch Visual Basic .NET PHP C# Java Swift C++ PL/SQL JavaScript Ruby Visual Basic C Assembly R Perl Python Dart Transact-SQL Clojure VBScript COBOL Logo Awk Apex Alice Kotlin Lisp Rust Bash Lua ABAP LabVIEW Prolog Crystal Scala Erlang Fortran F# SAS Scheme FoxPro ML Ada D Hack Julia ) ______________

Sign In or Register to comment.