Help with a Poke Command.

SYS 64738
JohnnyRockets
Member
Member
Posts: 5
Joined: Thu Apr 21, 2016 9:05 pm
Contact:

Help with a Poke Command.

Post by JohnnyRockets »

Hi all,

Kind of a newbie question, but here goes...

I'm going through a programming tutorial in BASIC for the C64 and came across an item that I could not quite figure out.

The tutorial was speaking of Poking/Peeking at memory and some do's and don'ts when doing this.

Two examples of POKES not to do were:

- POKE 56325, 12
- POKE 788,5


Here is what I think I found in the C64 Reference Manual:

- POKE 56325, 12 ---> "TimerA High Byte"
- POKE 788, 5 ---> "Vectors: Hardware IRQ"


My question: Why? If you do this, what will happen? Will the OS just lock up? If that is true, then my guess would be that there are LOTS of areas that if you POKE in the wrong place/data, you will get system lock-ups.

Thanks in advance for your help!!!


JR


ViperSan
Member
Member
Posts: 36
Joined: Tue Aug 22, 2017 2:23 pm
Contact:

Re: Help with a Poke Command.

Post by ViperSan »

Poke and Peek are basically just 'Basic' operations that Write and Read memory locations or in some cases registers..
Poking a value to a memory location ..writes that value to that location..
Peeking that same loction allows you to read back a value .
The number before the comma is the location ..the number after the comma is the value.
Poking to a register can directly affect the commodores system achitecture ...wheras ..a value poked to a memory location may have no effect and will just sit there until peeked or read back ...OR ..used by a program already executing .
You really need to just go for it and try for yourself.
..and if you do lock up the computer ..you can always reset.
Hope this helps.
User avatar
eslapion
Active Member
Active Member
Posts: 1215
Joined: Mon Jul 20, 2015 10:11 am
Location: Canada
Contact:

Re: Help with a Poke Command.

Post by eslapion »

@JohnnyRockets
AFAIK, there is one POKE you shouldn't do on some PET computers because it can damage the CRT.

However, on the C64 and the VIC-20, the worst that can happen is that you need to turn off and on the computer.

What the specific POKEs you mention do exactly, I have no idea.
Wealth, like happiness, is never attained directly. It comes as a by-product of providing a useful service. -Harland D. Sanders
User avatar
Melon
Site Admin
Site Admin
Posts: 297
Joined: Thu Apr 10, 2014 7:57 pm
Contact:

Re: Help with a Poke Command.

Post by Melon »

The Programmers Reference Guide is a must if you're wanting to understand what to poke and where.
.oO( MELON64 - ONE SLiCE AiN'T ENOUGH! )Oo.
Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 5 guests