Jump to content
IGNORED

How ending program ?


FredTheFred

Recommended Posts

Hello,

 

I'v got a question about ending program in CV code. I've made a little simply program. A little text is displayed (Text 1) on screen and another one after pressing fire (Text 2). Very simply and it's working fine on a emulator. but it's an infinite loop after displayed text 2, it's start again on text 1 and waiting to press fire and so on....

How made an ending point ? like exit command or abort ?

Link to comment
Share on other sites

For a program to "exit", there needs to be something to exit to. For example, if you're running a program in a DOS window, when the program exits, it exits to the DOS command prompt. There is no such thing on the ColecoVision, or any other game console: The program "exits" when you turn off the hardware.

  • Like 1
Link to comment
Share on other sites

Something like,

main{

print_at(0,0,"Text here.");
pause();

print_at(1,0,"2nd text here.");

loop:

goto loop;
}

Will put the program in infinite loop, thus ending the program. Otherwise, it'll go all the way to the end of the address $FFFF, and then make it way back to $8000, restarting the program.

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...