this is taken from the original post at EMPForum
link to original post
::Project Details::
  1. based off of Grey.Fox+ but faster
  2. used for making ASM files and BASIC
  3. the G.F+ Libs used will be restructured alphabetically
  4. the Libs will have a index and lib file, the index will have the command name and the hex number of which line it is on in the lib
  5. will parse to the hex istead of filling in the line to save space untill the executable is created
  6. uses celtic 3 app
  7. uses a certain header for its files to make it unrecgnizable to dcs and wont run in basic
  8. uses a certain type of line commenting
  9. parses to executable
  10. runs but in slow version because of macro's (BASIC only)

header is as follows

Code:
:Rand
:Return
:{Name of file}
:{Lines in file}
:{type(ASM or BASIC}
:{your code here}
:End
[/code]
well, I've been playing around with the program, but I have a problem. The Celtic III app does not let you make a new null program, so I was paying around with the code to do it..., here is what I got using OTBP assembler:

Code:
Defhdr.hdr
      Bcall zeroop1
      ld hl progname
      ld de,op1
      ld bc,8
      ldir
      ld h,8
      Bcall createprog
      inc de
      inc de
      ld hl,Null
      ld bc,8
      ldir
      bcall getkey
      ret
progname:
      .db progobj,string,0
Null:
      .db tEnter
String:
      .db Stringobj,tStr7,0

now what I am trying to do is make a null program with the name found in str7...but all I am getting is this wierd triangle thing. what am I doing wrong? Also, I am trying to use Celtic II app's exechex function to do it..but I haven't gotten the program to work so I haven't gotten that far yet
ASMnoobs make Kerm a sad Kerm sometimes. Smile Let's try something different:


Code:
Defhdr.hdr
      Bcall zeroop1
      ld hl string
      rst 20h
      bcall chkfindsym
      ret c
      inc hl
      inc hl
      ld de,op1
      ld a,5
      ld (de),a
      inc de
      ldir
//need to load a size in here somewhere iirc
      Bcall createprog
      inc de
      inc de
      ld hl,Null
      ld bc,8
      ldir
      bcall getkey
      ret
Null:
      .db tEnter
String:
      .db Stringobj,tStr7,0
KermMartian wrote:
ASMnoobs make Kerm a sad Kerm sometimes. Smile Let's try something different:


but to be fair ASMnoobs are the best sort of noobs Razz
What are you smoking, Kermy-boy? Parts of that code seem they'd fail miserably... Evil or Very Mad
So here's my take on it (assuming a "Null" program is an empty one):

Code:
 bcall _zeroOP1
 ld hl,string
 rst 20h
 bcall _chkFindSym
 ret c
 bcall _zeroOP1 ;returns a=0, useful
 inc de ;this is the data area; hl is the VAT
 ld b,a
 ld a,(de) ;LSB of the size- effectively the string's length for our case
 and $0F ;sanity check- keep us from killing anything outside the OPs
 ld c,a
 inc de
 ld hl,OP1
 ld a,ProgObj
 ld (hl),a
 inc hl
 ldir
 ld hl,0 ;size parameter
 bcall _createProg
 bcall _getKey ;why is this here..?
 ret
string:
 .db StringObj,tStr7,0,0,0,0,0,0,0 ;pad out to 9 bytes- who knows what chkFindSym would do without them
chkfindsym doesnt care what happens after it hits a null value. if its 2 bytes, then 0 then 6 bytes of garbage, it just ignores the 6 bytes of garbage because it has the 0
thanks guys, I'll give them a try.
@ Tari the getkey was because it kept on crashing on me, and I had put it in to try and find out what part of the code was unstable, also I was going to put in a part telling you that it was finished

EDIT: nope it didn't work...not even a program this time around
@Tari: Yea, this is why I should get more sleep. Of course the progloc is in de, not hl. Razz And I decided I would ignore a sanity check on the string, but I forgot that string vars are not zero-terminated. Your code looks fine to me...
well, for some reason they didn't work at all, maybe the ret c? cause it cuts out really quick way faster then mine did...
Eeems wrote:
well, for some reason they didn't work at all, maybe the ret c? cause it cuts out really quick way faster then mine did...
The ret c would only trigger if Str7 did not exist. And at the speeds ASM executes at, even with TI's shoddily-written bcalls, there would be no perceptible difference between it running with and without hitting the ret c.
well I cuts out way faster then it did before, and nothing happened. No new program or anything maybe it was OTBP assembler that made a mistake in assembling the code
where does it get the name for the program?
if the name is invalid, the prog will be hidden.
It gets it from str7... and no programs are under the program menu, the mem managment menu or from doors CS. so i don't think that the name is invalid, I think that there isn't even a program being created.
whats with the second "bcall _zeroOP1?"
I guess it ended up being extraneous. Removing that and the padding to the string name shouldn't affect anything.
I think I'll try it
funny thing; just found the create null prog function in the celtic III app readme, looks like I didn't need to do this after all, but since I started might as well finish it
I tried it and it didn't work, also when I removed the Ret c and made sure I had Str7 the program messed up the program menu and then crashed my calc... any ideas what went wrong?
The problem seems to be that the string name going to OP1 is incorrect. String names are actually two-byte tokens. Try this instead:


Code:
.db StringObj,tVarStrng,tStr7,0


And WOOT! 1000th post! Shock
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement