13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5. When the 6502 routine exits with an RTS instruction, Pascal removesits return address from the stack, restoring program execution to thepoint where ADDR was called.6. Because ADDR is a function of type INTEGER, Pascal now removes 2more bytes from the stack, treating them as an integer value. ADDRthus returns the address passed to it by Pascal in the form of an integer.Here is an example of using ADDR together with the POKE proceduredescribed earlier. It sets the last byte of a Pascal static variable KICKMEto 0:POKE CADDR CKICKME> + SIZEOF CKICKME> - 1, 0);SIZEOF (KICKME) returns the number of bytes of memory occupied byKICKME. It is added to ADDR (KICKME). The resulting value minus 1 is theabsolute memory address of the last byte of KICKME. The POKE procedureforces it to a value of 0.Miscellaneous 1/0 InformationThis section presents a grab-bag of Apple Pascal input/ output informationto supplement the material in Chapter 10. It includeso The effect of certain control characters on the screen display;o How to move the screen cursor with the procedure GOTOXY;o How to read the current values for the t and i keys from the fileSYSTEM.MISCINFO;o How to use the KEYPRESS function;o How to access game control inputs with the PADDLE function;o How to read the o and • keys with the BUTTON function;o How to produce audio outputs with the NOTE procedure;o How to set and test the high bit of characters enterea on the keyboard;o How to disable the Pascal operating system's response to certain controlcharacters;o Rules for Apple Pascal's special handling of control characters with GET,PUT, WRITE, WRITELN, READ, and READLN;o Effects of READ and READLN on EOF, EOLN, and the file buffervariable.Miscellaneous I/O InformationIII-265

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!