Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 May, 2013, 10:45:39 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: Conversion from 83+ to 83 -  (Read 981 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Yesterday at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Topic starter
Total Post Ratings: +174

View Profile
« on: 09 June, 2012, 02:10:41 »
0

Hi guys !

I'm trying to do a mad thing translating an 83+ ASM program to 83 ASM shocked

I know that's possible, even it's long and difficult, but right now I have some issues with replacing adresses, so I ask several Ti-83+ related questions :

- What is the use of the variable appID $838D ?
- What does the romcall _saveDisp do ?
- Is there any extended ti83asm.inc, like for BrandonW's ti83plus.inc ?
- How (or with what) can I replace _bufClr, appBackUpScreen, appID, keyExtend, kbdGetKy, _saveDisp, ramStart ?

Many questions, I hope that you'll can help me Smiley
« Last Edit: 09 June, 2012, 02:12:39 by Matrefeytontias » Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
ralphdspam
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 09:10:11
Date Registered: 01 February, 2011, 07:58:40
Location: California, USA
Posts: 841


Total Post Ratings: +36

View Profile
« Reply #1 on: 09 June, 2012, 02:52:41 »
0

Are you porting your own program, or are you porting someone else's program?  If you're porting your own ASM program, you know how what each subroutine does and can easily change the addresses and system calls.  If it's someone else's program, you have to be aware of how much memory each array requires and which optimization hacks the programmer used. Note that some programs are impossible to port due to the hardware differences.

Make sure that you read WikiTI and the documentation on TIcalc.org.  Those will be invaluable resources.
Take a look at this: http://www.ticalc.org/pub/text/calcinfo/83rom.zip
And this: http://wikiti.brandonw.net/index.php?title=Category:83:RAM:By_Name
Logged

ld a, 0
ld a, a
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 06:03:48
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1484


Total Post Ratings: +778

View Profile
« Reply #2 on: 09 June, 2012, 02:52:54 »
0

- AppID is used when searching for apps. This program is either using it as temporary space or is doing some OS hack.
- _saveDisp saves the screen to a 768 byte buffer pointed to by HL
- I've never programmed for the 83, so I don't know if there is a better include, but there probably isn't.

_bufClr

1
2
3
4
5
6
7
8
9
bufClr:
ld d, h
ld e, l
inc de
ld (hl), 0
ld bc, 767
ldir
ret

appBackUpScreen and appID - these are probably just free ram areas appBackUpScreen is 768 bytes and appID is no more than 20

keyExtent - this is specific to _getKey, the 83 should have it's own version

kdbGetKy - I ran a quick test and this appears to be the getCSC code for the most recent key scan (these happen every interrupt)

_saveDisp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#define DWAIT in a, ($10) \ or a \ jp m, $-3

saveDisp:
ld a, $80
out ($10), a
ld c, $20
saveColumn:
DWAIT
ld a, c
out ($10), a
cp $2C
ret z
ld b, 64
ld de, 12
DWAIT
in a, ($11)
saveByte:
DWAIT
in a, ($11)
ld (hl), a
add hl, de
djnz saveByte
ld de, -767
add hl, de
inc c
jr saveColumn

ramStart - this is for free ram, it offers up to like 1000 bytes, but most people use less than 100


Edit:
   For these routines, you're actually better off looking at TI's official docs. They can be found here and the two you want are TI-83 Plus Developer Guide and TI-83 Plus System Routines.
« Last Edit: 09 June, 2012, 02:57:39 by thepenguin77 » Logged

zStart v1.3.011 4-29-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
FloppusMaximus
LV5 Advanced (Next: 300)
*****
Offline Offline

Last Login: 09 May, 2013, 05:05:29
Date Registered: 03 October, 2010, 00:02:51
Posts: 286

Total Post Ratings: +52

View Profile
« Reply #3 on: 09 June, 2012, 05:09:34 »
0

squish.inc is the file you want; it was included, I believe, with TI's SQUISH/ZASMLOAD package.  You can probably find it somewhere on the web.  That file contains names for all of the TI-83 ROM calls.

There's no _BufClr on the TI-83.  There's no _SaveDisp either, but maybe you can get around that by using _SaveOScreen (which copies the LCD into saveSScreen.)

kbdGetKy = kbdScanCode + 6.  It holds the scan code most recently pressed, and is called that because it's used to implement the BASIC getKey function.  It's 8006h on the TI-83.

keyExtend = kbdScanCode + 7 (8007h on the TI-83.)  It holds the "extended" keycode returned by _GetKey (or by the menu system.)  But the TI-83 doesn't support lowercase, nor hooks, so it seems unlikely that you would ever use keyExtend in a TI-83 program.  What's the program you're trying to port?

ramStart is just the start of RAM - that's 8000h for every model - but again, I'm not sure why any program would ever use that symbol.  On the 83+, ramStart is the same as appData, which is the start of 256 bytes of more-or-less safe memory that programs can use (it's used for Flash-related stuff and also for OFFSCRPT/ONSCRPT, so it may be overwritten by _GetKey or by _Arc_Unarc or similar.)
Logged
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Yesterday at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Topic starter
Total Post Ratings: +174

View Profile
« Reply #4 on: 09 June, 2012, 17:16:28 »
0

In fact, I'm trying to port an Axe program to the 82 stats (my Jetpack for instance, see the topic in the Axe projects subforum), so I disassembled it and I ask for advices here.

@thepenguin77 @FloppusMaximus thank you very much Smiley thepenguin77 I'll try to replace the calls with your code.
« Last Edit: 09 June, 2012, 17:22:52 by Matrefeytontias » Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Yesterday at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Topic starter
Total Post Ratings: +174

View Profile
« Reply #5 on: 11 June, 2012, 18:25:15 »
0

Up !

I replaced nearly all the things I needed to replace, else appID and appBackUpScreen : since they are respectively 20 and 768 bytes large, which are can I use to replace them ? I can found for appID but I didn't found for appBackUpScreen ...

EDIT : in fact I don't know how much bytes appID is large ...
« Last Edit: 11 June, 2012, 19:51:11 by Matrefeytontias » Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 06:03:48
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1484


Total Post Ratings: +778

View Profile
« Reply #6 on: 12 June, 2012, 01:02:22 »
0

The amount of space used at appID cannot be more than 178 bytes. The reason for this is 178 bytes after appID is where the memory locations for getCSC are stored.

However, this program might not use all 178...
Logged

zStart v1.3.011 4-29-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Yesterday at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Topic starter
Total Post Ratings: +174

View Profile
« Reply #7 on: 12 June, 2012, 01:42:23 »
0

As I remind (I don't have the source right now) the program use 75 bytes (since I saw (appID+74))

I also find that I needed to replace the variable flags (the IY register) : on a 83+ it's $89F0, but on a 83 ?

So for recap, I need to replace appBackUpScreen, appID and flags, and then it's done (according to the fact that flags don't move Undecided )
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
FloppusMaximus
LV5 Advanced (Next: 300)
*****
Offline Offline

Last Login: 09 May, 2013, 05:05:29
Date Registered: 03 October, 2010, 00:02:51
Posts: 286

Total Post Ratings: +52

View Profile
« Reply #8 on: 12 June, 2012, 04:23:42 »
0

'flags' (the usual value of IY) is 8567h.  As far as I know, it's true that all of the TI-83's flags are located at the same bit/offset on the 83+, but the converse is not true.  I can't easily check this at the moment, but I think that 23h (35 decimal, aka asm_Flag3) is the end of the system flags on the 83.  So you will want to be certain your program is not using any flags beyond that point; if the program is relying on those flags, then it may need to be substantially modified.  Two popular 83+ flags that the 83 doesn't support are bufferOnly (draw only to plotSScreen, not the LCD) and fracDrawLFont (use the large font for _VPutMap.)

As far as RAM areas go: first of all, what shell/loader are you using?  I highly recommend that you use Venus, if you're not doing so already.  If you are using Venus, then you can use cmdShadow (128 bytes at 9157h) for temporary storage.  You can also use textShadow if you take some precautions - clear the appTextSave flag while your program is running, and set it again and call _ClrWindow when your program exits.

If you are using Ion or another "traditional" 83 shell, then the rules are slightly different - you can use textShadow if you like, but absolutely not cmdShadow.

You can use statVars (858Fh, somewhere around 500 bytes but I don't remember exactly) for temporary storage, but if you're using Venus you will need to call _DelRes when your program exits (Ion does this for you, I think.)

If you are not already using saveSScreen, that would make a good alternative to appBackUpScreen.  But if you are already using saveSScreen and plotSScreen and you really need a third 768-byte buffer, you'll need to make one yourself.  The quick and easy way is just to stick an extra 768 bytes of zeroes into your program; the less greedy way would be to dynamically allocate it in free memory.  (Free memory starts at (FPS), (930Dh).  You can use _EnoughMem - see the 83+ SDK docs - to check whether there's enough memory available.)
Logged
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Yesterday at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Topic starter
Total Post Ratings: +174

View Profile
« Reply #9 on: 12 June, 2012, 07:23:32 »
0

Okay, thanks a lot for your explanations, I'll try it Smiley
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Today at 08:48:03
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3110


Total Post Ratings: +120

View Profile
« Reply #10 on: 13 June, 2012, 14:22:46 »
0

I suggest taking a look at wikiti.brandonw.net
« Last Edit: 13 June, 2012, 14:22:59 by aeTIos » Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Yesterday at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Topic starter
Total Post Ratings: +174

View Profile
« Reply #11 on: 13 June, 2012, 15:59:29 »
0

I already read all the site before opening this topic ...
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
tr1p1ea
LV6 Super Member (Next: 500)
******
Online Online

Last Login: Today at 10:20:07
Date Registered: 27 August, 2008, 07:52:13
Posts: 347


Total Post Ratings: +55

View Profile
« Reply #12 on: 14 June, 2012, 10:57:46 »
0

Id just include appropriate buffers in the program itself to see if the port at least runs properly. Then you can look at allocating them somewhere.
Logged
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Yesterday at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Topic starter
Total Post Ratings: +174

View Profile
« Reply #13 on: 14 June, 2012, 14:34:14 »
0

Ok, here is an update.

I had to convert two programs : an installer (done) and a huge executable (51K of source). I have very big problems with this one, and I'm since I'm not really good at z80 ASM, I'm searching for someone who could look over a huge 51K ASM source file to find errors, but that's not errors that stop the compilation, just bad programming (since it's only disassembled Axe). Of course, this is 83 ASM.

If you can help me, please do, I can't carry on anymore Cry
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 06:03:48
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1484


Total Post Ratings: +778

View Profile
« Reply #14 on: 14 June, 2012, 18:30:07 »
0

I know what the problem is, there are a lot of pointers inside this program that are simply numbers now (they used to be labels). The problem is that now the code is executing from a different location (because of 83 reasons as well as adding/removing code). What you need is to have all your labels in line.

If you post the .8xp, I'll get you a disassembly with all the labels in the right spot. (I'm going to use IDA)
Logged

zStart v1.3.011 4-29-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.511 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.