This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
Job the GameQuitter


Member


Joined: 04 Jun 2003
Posts: 102

Posted: 06 Jun 2003 12:03:19 pm    Post subject:

I think I understand a little bit of The Duck's routines (I can't quite figure out the timings though). However, Shouldn't there be a RETI at the end of the interrupt instead of a RET? Confused
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 07 Jun 2003 02:23:54 am    Post subject:

No, they are different!


The most notable difference is that reti is used when interrupts are chained together. e.g. a table of interrupts.

RETI acts like RET except that some zilog
peripherals recognize the RETI instruction sequence (0xed, 0x4d) for
purposes of clearing their internal interrupt-pending flags.
This has repercussions for the daisy-chain interrupt technique used by the Z-80 family.

Now, as for retn, you will never use it unless you wright an OS.
Back to top
Job the GameQuitter


Member


Joined: 04 Jun 2003
Posts: 102

Posted: 07 Jun 2003 07:15:51 am    Post subject:

I still don't quite get it. When do you use RETI? And why don't you in Duck's Greyscale routines?

Last edited by Guest on 07 Jun 2003 07:18:38 am; edited 1 time in total
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 07 Jun 2003 07:49:13 am    Post subject:

Well, first, can someone please explain to me what is meant by the "daisy-chain interrupt technique used by the Z-80 family"? Then I'll have some chance of understanding what "repercussions" RETI causes.
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 08 Jun 2003 03:06:15 am    Post subject:

reti does not equal ret exactly.

If you set up an im 2 routine that uses a table to run interrupts for more than one device, you need to use reti because it clears the databus for the next interrupt to occur if there is more than one device.

How it works.

There is a table that the I register points too.

e.g.

ld a,$99
ld i,a

table:
routine1
routine2
...

Interrupt table will start at $9900 where $9900 points to a word (2 byte address) containing the address of an interrupt.
$9902 points to another word that contains an address to anothe rinterrupt.

Explanation:

In reality, the databus is not truely random, and there is also a use for IM 0!

If an interupting device signals interrupt Request $00 to the databus, the device supplied the $00.

The calculator will then take I which is $99 and the data bus $00 and create $9900 which it will read to determine the address of the correct interrupt routine for the device.

Chaining:

While in a chained interrupt, di is not executed at the top; therefore, masked interrupts are still permitted.

If another (higher priority) interrupt occurs while executing an interrupt, it will have a bigger number e.g. (02)

So, while executing interrupt rotine 1, if device 2 interrutps it will place 02.

The calculator will jump to $9902, find the address or interrupt rotine 2, and execute rotine 2.

After routine 2 finishes, you must use reti to clear the databus, so rotine 1 (lower priority than rotine 2) can finish.

In other words, ret does not equal reti if you have more than one interrupt!


As for your calculator, the devices appear to interrupt at radom intervals making the databus seem random although it is not, and TIOS understands this.

When making your own IM2 routine, you must fill the entire table with the same routine because all teh devices in your calculator act goofy by interrupting with a different device number sometimes; thus, you have know idea what the databus is doing Mad
Back to top
Job the GameQuitter


Member


Joined: 04 Jun 2003
Posts: 102

Posted: 08 Jun 2003 08:50:39 am    Post subject:

You've just poured a bucket of knowledge in the teacup that is my brain. Wacko

Maybe if I read it veeery slooowly and about twenty times I'll get it Rolling Eyes.
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 08 Jun 2003 01:35:20 pm    Post subject:

Thanks. I think I understand.
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 08 Jun 2003 02:58:50 pm    Post subject:

It is not important that you understand becasue as in the case of the TI calculator, the databus is random; thus, what is the point of using reti to clear it, so it will be random again.


In other words, reti does not equal ret, but you can use them interchangably when programming for the calculator. Smile
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 08 Jun 2003 03:01:15 pm    Post subject:

so, does that mean that u could use the databus to get random numbers? i dunno, just a thought!
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 08 Jun 2003 03:03:45 pm    Post subject:

If you can find a way to read the databus directly Confused
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 08 Jun 2003 03:10:11 pm    Post subject:

oh, u cant read it directly? *sigh* so much for that idea! maybe i will just use the r register if i need random... back to grayscale Wink , i didn't know the differect between ret and reti until Jbirk explained it, but it seems like they would be totally interchangeable on a calculator, and thus, the grayscale routine may use either!
Back to top
Justin W.
Shattered Silence


Advanced Member


Joined: 24 May 2003
Posts: 429

Posted: 08 Jun 2003 11:36:19 pm    Post subject:

Grayscale is perfectly safe. Grayscale is generated because of the large amount of time it takes for a pixel to turn off. Thus giving a gray effect.
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 09 Jun 2003 01:08:26 pm    Post subject:

now, blue on the other hand, is bad for ur lcd! it could leave little lines and stuff...
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 10 Jun 2003 04:16:46 am    Post subject:

Blackish blue does not appear to have a deterious affect on the LCD. You may be able to achieve this shade of blue by turning your contrast to the max.

To let you know, greyscale is no different than black and white except the pixels turn on and off fast.

Blue lines and vivid shades of blue created by bad assembly programs can cause damage to the LCD; however, if you see a blue line or two on your LCD, you shoudl not panic, but you should remove an AAA immediatly to turn off the LCD.

After removing the battery, wait about a second after the LCD fully clears and then re-inseart. With any luck, the ram will clear and the LCD will be okay.
Back to top
Justin W.
Shattered Silence


Advanced Member


Joined: 24 May 2003
Posts: 429

Posted: 10 Jun 2003 10:17:14 pm    Post subject:

Yes blue lines on your LCD are caused by an assembly progam causing the calculator to send the max power to the lcd. When this max power is acheived the black pixels become blue. This can be very dangerous as it can burn out pixels in the display and/or cause LCD fluid to leak. As long as you are sure to remove the battery as JBirk said above in a very prompt manner it is highly unlikely that any damage will be caused to your calculator.
Back to top
62 52 53 53
Formerly known as 62 52 53 53


Active Member


Joined: 30 May 2003
Posts: 607

Posted: 11 Jun 2003 09:05:38 pm    Post subject:

no, contrast is how dark the pixels are, greyscale is turning pixels on and off to make them look lighter.

Edit: no, not look lighter, appear lighter.


Last edited by Guest on 12 Jun 2003 08:18:57 am; edited 1 time in total
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 12 Jun 2003 04:48:14 pm    Post subject:

b wrote:
So could u change the contrast only for certain pixels, or does it have to be the whole screen?

No, you can change only the entire LCD's contrast.
Back to top
Display posts from previous:   
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
    » Goto page Previous  1, 2, 3  Next
» View previous topic :: View next topic  
Page 2 of 3 » All times are UTC - 5 Hours

 

Advertisement