Jump to content
IGNORED

Moj Mikro magazine listings: Tips and tricks #1


Gury

Recommended Posts

Hello all in Christmas time,

 

Here is another bulk of listings from Moj Mikro magazine. Presented here are short listings, which may be useful and fun for some of you... or not.

 

The programs are collected in ATR disk image file, with Atari DOS installed. All programs are in tokenized form, except of file HEADER.LST on disk, which is of no concern here. For a change source code listings of programs are included for everyone to examine with no need to run original hardware or Atari emulator.

 

File for download is in attachment section. All the material here is the property of Moj Mikro magazine, but the listings can be used freely in your own programs.

 

mojmikro_logo.png

 

 

Trapping BASIC errors

 

Moj Mikro 1986/10/33

Author: Igor O.

File on disk: MM861033.BAS

 

One of the rarely used commands in Atari BASIC is TRAP. It can help you find errors in your own programs. Example of using TRAP command is:

 

trap_src.png

 

After program is run, it will jump to line 1000 and print coded error message. Also, it will print the line where error was detected.

 

trap_out.png

 

 

Additional lines

 

Moj Mikro 1987/5/74

Author: Antun Kis

File on disk: MM870574.BAS

 

This short program adds additional lines above existing ones. New lines do not scroll, but the content can be easily changed. You can also try to change to other two text modes, 1 and 2 respectively. This example uses absolute addresses of display list locations, which is not recommended. It is better to read addresses for display list, screen memory and such, with corresponding address pointers, which calculate it for you automatically.

 

add_lines_src.pngadd_lines_out.png

 

 

Special characters for formatting the text on the screen

 

Moj Mikro 1988/03/55

Author: Bosko Lucev

File on disk: MM880355.BAS

 

Some of the special characters, integrated in your little machine, can be used for formatting text on the screen. Simultaneous press of two or three keys print such characters on the screen. I will not describe the functions of these special characters, because there are many books for your Atari, which cover this subject.

 

Here is an example program, which generates a menu on the screen by using special control characters.

 

menu_src.pngmenu_out.png

 

 

Timer

 

Moj Mikro 1989/3/54

Author: Zlatko Bleha

File on disk: M8903541.BAS

 

If you want to make use of internal timers of 8-bit Atari, this program is for you. Time is measured in seconds and miliseconds. It won't be hard to modify this program to show minutes and hours. Such program is useful for setting time limit, for example measuring the time in games.

 

timer_src.pngtimer_out.png

 

 

Reset

 

Moj Mikro: 1989/3/54

Author: Edin Husakovic

File on disk: M8903542.BAS

 

Moj Mikro 1989/4/58

Author: Zlatko Bleha

File on disk: M8904581.BAS

File on disk: M8904582.BAS

 

This program shows how to use your own machine language routine in place of default reset behaviour - when you press Reset button. If we put value 3 on address 9, we call the routine, which low and high byte of address are on locations 2 and 3. When you run this program and press Reset key, text shows on the screen. Zlatko Bleha recommended safer approach by filling location 9 with value 1 or 2. Previous solution can lock the system.

 

a) Putting address of the program at locations 12 and 13 (DOSINI)

 

10 POKE 9,1: POKE 12,0: POKE 13,6

 

b) Putting address of the program at locations 2 and 3 (CASINI)

 

10 POKE 9,2: POKE 2,0: POKE 3,6

 

reset_src.pngreset_out.png

 

 

Help button

 

Moj Mikro: MM89/3/54

Author: Edin Husakovic

File on disk: M8903543.BAS

 

This short program shows how to use Help button in your own program. Location 732 holds value 17, if we press just Help button. In combination with Shift key it gives value 81 and in combination with Control key value 145. When we release Help button, the value on address 732 does not change, so we need to reset its value by typing POKE 732,0 in BASIC.

 

help_src.png

 

help_out1.pnghelp_out2.png

 

help_out3.png

tips_and_tricks_no1.zip

Edited by Gury
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...