Amos Professional Manual  Contents  Index

Machine Code

function: read two bytes from an even address

DEEK reads a two-byte "word" at a specified address. This address must be even, or an address error will be generated.

instruction: change a two-byte word at an even address
Doke address,number

Use the DOKE command to copy a two-byte number between 0 and 65535 into the memory location at a specified even address. Only DOKE into places where you are certain of safety, because indiscriminate use of this command will almost certainly crash your Amiga!

function: read four bytes from an even address

The LEEK function returns a four-byte "long word" stored at the specified even address. The result will be in exactly the same format as a standard AMOS Professional integer. This may result in negative values being returned in certain circumstances, such as if bit 31 of your number is set to 1. The correct value can be calculated by making use of DEEK, then loading the result into a floating point number, like this:

   Print Leek(Varptr(A))
   Print A#

instruction: change a four-byte word at an even address
Loke address,number

LOKE copies a four-byte number into the memory location at a specified address. As before, the address must be an even location, and this command must be used with the greatest of care to avoid crashing the computer.

instruction: poke a string of characters into memory
Poke$ address, string$

Use the POKE$ command to take a source string and copy it directly to a chosen memory location, one character at a time. The address parameter holds the address of the first byte to be loaded with the new string data.

Back    Next