Author Topic: make a function of "peek" by using NASM, who can teach me?  (Read 7386 times)

Charell King

  • Guest
make a function of "peek" by using NASM, who can teach me?
« on: April 28, 2011, 02:56:54 AM »
The 'C' language has no the function of "peek", now I want to use NASM and realize the function. who can help me , master

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: make a function of "peek" by using NASM, who can teach me?
« Reply #1 on: April 28, 2011, 04:35:31 PM »
PEEK and POKE are BASIC constructs that simulate functionality that natively exists in other languages such as C and various assembly languages.

In C, you want to start by studying pointers.

In NASM, you want to start by studying effective addresses.

Charell King

  • Guest
Re: make a function of "peek" by using NASM, who can teach me?
« Reply #2 on: April 30, 2011, 02:27:51 AM »
haha ,you are right .    C - pointer and  NASM - effective address

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: make a function of "peek" by using NASM, who can teach me?
« Reply #3 on: April 30, 2011, 05:56:00 AM »
Yeah, it doesn't take much of a "function" to do the equivalent of "peek" in asm. You don't say "What OS?"... if you're using a segmented memory architecture (dos), and need both segment and offset, it might be worth a "function", but mostly it's "mov reg, [mem]" and you're done...

Best,
Frank