External Module

That SHOWBYTE procedure is great! It'll be used ALOT in future programs. How else can you show the user what number the program has calculated?
BUT, if we use the SHOWBYTE procedure in every program, that means we have to include it's code into every programs's source.
There is a solution.
We will Compile (TASM) SHOWBYTE by itself . Then Link (Tlink) it to whatever program needs to use it.

To accomodate this arrangement, we need to:
1) declare the SHOWBYTE procedure as PUBLIC in it's local source-code
2) declare the SHOWBYTE podedure as EXTRN (external) in the source-code which calls upon it.
that's it.

The next program will show the changes made to the SHOWBYTE source-code. The PROCEDURE itself doesn't change, but it's MODEL changes to .tiny and NO stack is declared.

When you need to link SHOWBYTE to another program(let's say: pacman.asm/pacman.exe), do the following:
TASM PACMAN
TASM SHOWBYTE
TLINK PACMAN SHOWBYTE, PACMAN


You can also keep SHOWBYTE around as an Object file (.obj, the output of TASM). Then there's no need to TASM it a thousand times.

A good note: When you Link, the first parameter should be the source with the MAIN procedure (or whatever serves as the MAIN procedure, in your case). This is because tasm lays down the code in the order of it's parameters. First code lain down is the first code to execute.

After you have SHOWBYTE coded as an independant module. The following tutorial (#7) will be a simple test program that demonstrates calling SHOWBYTE.