home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
Geneve
/
9640news
/
CAT15
/
GPLCDN.ARK
< prev
next >
Wrap
Text File
|
2006-10-19
|
8KB
|
150 lines
?
A LITTLE INTRODUCTION TO GPL CODE
By Craig Miller
Millers Graphics will be releasing a GPL Assembler in the first part of 86'.
We thought you might like to see what a powerful and COMPACT language GPL code
is. With the GRAM KRACKER and our GPL Assembler you will be able to write
programs that can reside in the Module space and will be displayed on your
Main Menu as a selection. GPL can also link to Assembly and BASIC programs! So
you will have FULL use of the THREE built-in languages in our 4As (Basic, GPL
and Assembly). Eat your hearts out all you Atari, Commodore, IBM and other
computer owners!
*----------------------------------------------------------------------------*
* Disassembly of part of the Editor/Assembler Module *
* Starting at Grom >6069 thru >6132 *
*----------------------------------------------------------------------------*
>6069 MOVE 7 FROM G@REGDAT TO VR01 Load the Vdp registers
CALL CHKMEM Go check for memory expansion and
load the (C) character data
MOVE 16 FROM G@CURSOR TO V@>08F0 Load the box and solid cursor data
* Put up the first Menu Screen
ST >7E,@SUBSTK Initialize the Sub Return stack pointer
DCLR @ERRCODE Zero out A/L Error Code indicator
DCLR @GROMFLG Zero the Grom Flag
ALL SPACE Clear the screen with space characters
FMT Start formatted screen output
ROW 2 At row 2
COL 1 At column 1 (note 0,0 is home position)
HTEXT '* EDITOR/ASSEMBLER * ' Put up horizontal text
ROW+ 2 At current row plus 2
COL 1 At column 1
HTEXT 'PRESS:' .
ROW+ 2 .
COL 2 .
HTEXT '1 TO EDIT' . etc.
ROW+ 2 Note: VTEXT, HCHAR, VCHAR are also
COL 2 allowed in a FMT, so is
HTEXT '2 ASSEMBLE' FOR xx - where xx equals
ROW+ 2 the repeat loop counter
COL 2
HTEXT '3 LOAD AND RUN'
ROW+ 2
COL 2
HTEXT '4 RUN'
ROW+ 2
COL 2
HTEXT '5 RUN PROGRAM FILE'
ROW+ 6
COL 2
HTEXT >0A >0A is the (C) character
HTEXT '1981 TEXAS INSTRUMENTS'
FEND End the formatted screen output
GETKY SCAN Scan the keyboard for a key press
BR GETKY BR (Branch on Reset) no NEW key pressed
CEQ FCTN9,@KEY Was FCTN 9 (Back) Pressed
BR GETKY1 NO! check the other keys
EXIT YES! Execute the Power Up routine
GETKY1 SUB >31,@KEY Subtract >31 from the keycode (0 - ?)
CHE >05,@KEY If its now Higher than 4 - wrong key
BS GETKY So, go wait for another key press
CASE @KEY Otherwise if @KEY equals
BR EDIT 0 - goto Edit Menu
BR ASSEM 1 - goto Load Assembler Prompt
BR LODRUN 2 - goto Load and Run prompt
BR RUN 3 - goto Run Program prompt
BR RUNPRG 4 - goto Run Program File prompt
Notes: -----------------------------------------------------------------------
The above code only requires 202 bytes of memory and that includes 119 bytes
of text! So that means the actual instruction code only uses 83 bytes of
memory! There isn't another language available for our 99/4As that is this
COMPACT as GPL. And, when compared to Assembly, it is much easier to program
in. This is THE Language that TI should have released to us in the first
place!
1. Most instructions can work with bytes or words. The D in front of an
instruction indicates a word operation. The first operand to is SOURCE and
the second is the DESTINATION. ie: ST >03,@TEMP1 stores one byte with the
value of 3 into location TEMP1.
2. The COND bit in the GPL Status register (>837C) is turned ON if the test is
TRUE and OFF when FALSE. It is also turned on when a NEW key is pressed on
a keyboard scan or when the result of certain instructions is zero.
3. BR = Branch On Reset... or Branch if the COND bit in the GPL Status
register is OFF
4. BS = Branch On Set..... or Branch if the COND bit in the GPL Status
register is ON
5. CASE is like ON X GOTO ..... except it starts at zero instead of 1
(Note: the COND bit is always turned OFF (reset) for a CASE or DCASE)
6. A CALL works like a GOSUB or Assembly's BL (Branch and Link)
7. 'ALL' fills the screen with the one byte character following the
instruction. (That's right only 2 bytes to clear the screen!!!!)
8. MOVE is a very powerful GPL instruction. With it you can MOVE x number of
bytes FROM any type of memory TO any type of memory You can also move bytes
to the VDP Registers! The MOVE instruction only requires 6 to 7 bytes for
its object code!
9. SCAN only requires 1 byte of object code!!! (SCAN = >03)
Speed Test: ------------------------------------------------------------------
We ran the old 1 to 10,000 timing test in GPL to see how it compares to the
other languages and here is how it came out.
1. In an incrementing loop with a DCEQ (double Compare Equal) 6.8 seconds.
2. In a decrementing loop (no compare just BR (not zero)) 4.3 seconds.
As we hav seen from previous tests this places third on the list.
1. Assembly - well under .5 second
2. Forth - approx 1.3 seconds
3. GPL - 4.3 to 6.8 seconds
4. Pascal - I think this is where it falls
4. XB - 33.9 seconds
5. Basic - weeks (just kidding)
Since its not as fast as Assembly or Forth you are probably wondering why we
are so excited about GPL?! True, a CRAY 3 its not. However, it requires LESS
THAN one half the space of Assembly code! With the Gram Kracker you have up to
58K of GPL program space (with 6K reserved for the Operating System), which
would require AT LEAST 116K of Assembly code. This still leaves ALL of memory
expansion free plus the 16K of cartridge RAM free for other things or for
Assembly routines for your GPL programs to link to (another 48K). That gives
us a TOTAL program space of 106K plus 16K of VDP Ram for a total of 122K (128K
with the Operating System area). Also with GPL you can EXPAND or modify
existing Modules. And, last but certainly not least, GPL is the controlling
language for our 4As, so now you make it do most anything you want! Start
thinking about those changes you've wanted to make for the last 6 years, your
chance is coming!!!
(Hmmmmm, lets see, a cold boot of an Assembly, GPL, Forth, XB or Basic program
that would ........................)
Download complete. Turn off Capture File.