Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 May, 2013, 09:25:04 *
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: Some general Questions -  (Read 1622 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Aichi
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 08:49:29
Date Registered: 25 September, 2010, 15:13:24
Location: Germany
Posts: 291

Topic starter
Total Post Ratings: +72

View Profile WWW
« on: 31 October, 2010, 12:32:48 »
0

I thought I could learn Asm by disassembling single Axe Parser compiled commands,
but this idea was fail.  Undecided I read some tutorials and source codes, but there are still some issues:
1) How let I run my prog under 15Mhz processor speed?
2) How to randomize a word, like Axe Parser's rand^x?
3) I want to include Joe Wingbermuehles's fastcopy routine into my code, but I'm not sure what 'gbuf' has to be. I think it must be a constant pointed to the start of the Buffer, if yes, which adress is it on a TI84+? I dont use ion.inc, since this means to be unable to use ti83plus.inc at the same time.
Thats all for now. Thanks in advance!
Regards,
Aichi
« Last Edit: 31 October, 2010, 15:31:30 by Aichi » Logged
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:18:47
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Total Post Ratings: +706

View Profile WWW
« Reply #1 on: 31 October, 2010, 16:35:33 »
+1

1) Programs run at 6 MHz by default, and to start executing at 15 MHz, load 1 to A (it's 1 for 15 MHz and 0 for 6 MHz) and do a b_call(setExSpeed). The b_call doesn't exist on OS versions before 1.13, so you should check for that first:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    b_call(getBaseVer) ; OS version in A and B
    cp  2 ; test A for OS version > v2.00
    jr  nc,fast ; it's > v2.00, so it's good
    cp  1 ; test A for OS version > v1.00
    jr  nz,slow ; if not, quit
    ld  A,B ; test decimal in OS version
    cp  13 ; test if it's v1.13 or above
    jr  c,slow ; it's > v1.13, so it's good
fast:
    ld  A,1
    b_call(setExSpeed)
    ... ; continue with the program at 15 MHz
slow:
    ... ; continue with the program at 6 MHz

TI's official guide is at https://docs.google.com/viewer?url=http://education.ti.com/downloads/guidebooks/sdk/83p/ti83pseadn.pdf.

2) Well, there's no built-in rand thing, but you can use the memory refresh register R, which basically goes up every time "something happens", so it's pretty much random. It's a byte between 0 and 255.

I think Ion has a random integer function. Not sure how it works, though.
« Last Edit: 31 October, 2010, 16:36:43 by Deep Thought » Logged




Aichi
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 08:49:29
Date Registered: 25 September, 2010, 15:13:24
Location: Germany
Posts: 291

Topic starter
Total Post Ratings: +72

View Profile WWW
« Reply #2 on: 31 October, 2010, 18:43:42 »
0

1) Thank you! Smiley
2) Ok, I found a nice routine by Joe Wingbermuehle.
3) Perhaps gbuf is the same as the system pointer 'plotsscreen'.

4) http://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:put8x8sprite I tried to copy the first routine into Mimas, but it seems like Mimas cannot handle the line LD  D, (IX) ôo. Does anyone know what the problem is?
Logged
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:18:47
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Total Post Ratings: +706

View Profile WWW
« Reply #3 on: 31 October, 2010, 23:23:29 »
0

Oh, by the way:

3) Yes, they're the same. In ion.inc there's a line that says


1
2
gbuf =plotsscreen
Logged




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 #4 on: 01 November, 2010, 01:16:07 »
+2

Easier than calling SetExSpeed, you can set the speed yourself:

1
2
3
4
5
6
7
 in a, (2)
  add a, a  ; check if on a TI-83+ BE
  jr nc, is_a_ti83p
  ld a, 1
  out (20h), a
is_a_ti83p:

or use MichaelV's method, which works because port 20h is the same as 0 on the 83+ BE (so this also resets the link port):

1
2
3
4
5
 in a, (2)
  rlca
  and 1
  out (20h), a

But if you're writing an Ion/MirageOS program, you need to be sure to set the speed back to 6 MHz (write zero to port 20h) before exiting, since otherwise the shell and other programs won't work correctly.  In particular, depending on the shell, the ionFastCopy routine may not work correctly at 15 MHz.

Oh, and:
4) http://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:put8x8sprite I tried to copy the first routine into Mimas, but it seems like Mimas cannot handle the line LD  D, (IX) ôo. Does anyone know what the problem is?
Yeah, that's a known issue with Mimas.  You have to write "LD D, (IX+0)" instead.
« Last Edit: 01 November, 2010, 01:20:22 by FloppusMaximus » Logged
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:18:47
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Total Post Ratings: +706

View Profile WWW
« Reply #5 on: 01 November, 2010, 01:19:00 »
0

The second one's the one Axe uses. Don't know how it works, though Sad
Logged




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 #6 on: 01 November, 2010, 01:23:41 »
0

Well, bit 7 of port 2 is zero on an 83+ BE, whereas it's one on an SE or 84+.  So after the 'and', A is 0 on an 83+ BE, or 1 on a newer model.  As I said, port 20h on an 83+ BE is the same as port 0, so writing 0 to port 20h resets the link port.  Whereas on an SE, writing 1 to port 20h sets 15 MHz mode.
Logged
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 19:18:47
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Total Post Ratings: +706

View Profile WWW
« Reply #7 on: 01 November, 2010, 01:46:07 »
0

Oh, I see, thanks.
Logged




Aichi
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 08:49:29
Date Registered: 25 September, 2010, 15:13:24
Location: Germany
Posts: 291

Topic starter
Total Post Ratings: +72

View Profile WWW
« Reply #8 on: 01 November, 2010, 18:25:44 »
0

Yeah, that's a known issue with Mimas.  You have to write "LD D, (IX+0)" instead.
Ah, thanks. I should develope on PC while Mimas' early Alpha phase.

5) How compare I the HL register by using something like CP?
« Last Edit: 01 November, 2010, 18:29:03 by Aichi » Logged
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:42:06
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #9 on: 01 November, 2010, 19:34:16 »
0

Yeah, that's a known issue with Mimas.  You have to write "LD D, (IX+0)" instead.
Ah, thanks. I should develope on PC while Mimas' early Alpha phase.

5) How compare I the HL register by using something like CP?

This seems like the logical method to me:


1
2
3
4
or a
push hl
sbc hl,reg16
pop hl

EDIT: Don't do that, do this
« Last Edit: 02 November, 2010, 04:48:59 by Runer112 » Logged
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 #10 on: 01 November, 2010, 20:11:25 »
0

And here is the best one: (I think by calc84?)

1
2
3
4
or a
sbc hl, de
add hl, de

The flags are affected exactly the same way as cp.
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
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #11 on: 02 November, 2010, 02:37:51 »
0

That is indeed the method reported by WikiTI Grin
Sometimes the "logical" method isn't the best Tongue
Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:42:06
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #12 on: 02 November, 2010, 03:12:51 »
0

And here is the best one: (I think by calc84?)

1
2
3
4
or a
sbc hl, de
add hl, de

The flags are affected exactly the same way as cp.

I debated posting that, but that addition will leave some flags (s, z, and n) with incorrect values.
« Last Edit: 02 November, 2010, 03:16:07 by Runer112 » Logged
calcdude84se
Needs Motivation
Members
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 16:12:14
Date Registered: 21 April, 2010, 04:20:59
Posts: 2207


Total Post Ratings: +62

View Profile
« Reply #13 on: 02 November, 2010, 03:19:01 »
0

n is unimportant, and I'm not sure it's affected by 16-bit additions/subtractions.
As for s and z, I do agree that they are changed, but that's unimportant if you're dealing with c (and p, I believe)
It's better in some cases, I guess. Grin
Logged

"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Bug me about PartesOS. I might just need reminding.
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: 02 November, 2010, 03:55:44 »
0

Straight from the zilog manual for add hl, <register>:

Quote
Condition Bits Affected:
S is not affected
Z is not affected
H is set if carry out of bit 11; reset otherwise
P/V is not affected
N is reset
C is set if carry from bit 15; reset otherwise

To be honest, I actually forgot that S and Z were ignored. I bet somewhere in one of my programs I did that wrong.
« Last Edit: 02 November, 2010, 03:56:23 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
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.501 seconds with 30 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.