A86: Re: Help!!!!!


[Prev][Next][Index][Thread]

A86: Re: Help!!!!!




I'm not sure what you were trying to do in your program, but here's an
example.  If you are out of memory, I'd suggest not breaking up your
program.  I'm guessing that your sprites are taking up too much room (that's
alot of sprites!).  What you need to do is break your program up from the
data.  Compile the data separately with TASM.  At the top of it, set an .org
statement to $800b.  Export a symbol table and turn it into a header file
with equates for all of the labels in it.  Include this header in your main
program.  Use Jimmy Mardell's (or write your own...good C practice) BIN2STR
to turn the TASM .obj file (make sure you tell it to make a binary object
file...should be the same size as all your data) into a string.  In your
main program, copy the string data to $800b.  It's a pain when you have to
change the data, but you'll have to live with that (unless the next version
of assembly studio let's you compile a file into a string and exports a
header file with all of the equates for the lables...hint, hint).  Anyway...

; p1.asm
#include "ti86asm.inc"
.org _asm_exec_ram
 ld hl,msg         ; point to string
 call _puts        ; print first line
 call _newline     ; next line
 call _getkey      ; wait for key
 ld hl,exec_name-1 ; point to name
 rst 20h           ; move name into OP1
 call _exec_assembly
 ld hl,msgb        ; let them know
 call _puts        ; that we're back
 ret               ; return to TI-OS
exec_name:
 .db 2,"p2"
msg:
 .db "Program #1--[enter]",0
msgb:
 .db "Back to #1",0
.end

; p2.asm
#include "ti86asm.inc"
.org _asm_exec_ram
 ld hl,msg     ; point to string
 call _puts    ; what does _puts do again?
 call _newline ; space 'em out
 call _getkey  ; wait again
 ret           ; return to first program
msg:
 .db "Program #2--[again]",0
.end


--
David Phillips <electrum@tfs.net>
ICQ: 13811951
AOL/AIM: Electrum32
86 Central: http://www.tfs.net/~electrum/

-----Original Message-----
From: Charles Bergmeier <cyberreeper@hotmail.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Sunday, December 13, 1998 5:44 PM
Subject: A86: Help!!!!!


>
>Why won't this program (from Ti.com) work?  I save the programs as PROG1
>and PROG2, yet I still get an error...  I need to know how to call other
>assembly programs from another assembly program for the game I am
>working on (PunchOut).  (I have run into problems with memory usuage.
>If there is a better way to solve the problem, I'm open to suggestions.)
>I'll appreciate any help....