Re: A86: Asm Questions that have been building up :)


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

Re: A86: Asm Questions that have been building up :)




At 19:57 1998-03-19 -0500, you wrote:
>Possibly Stupid Questions
>------------------------------------
>
>Is the whole purpose of an org in a source file is so that the assembler can
>calculate fixed memory jumps? (JP)

Not only jumps, but all absolute memory addresses. The Z80 uses absolute
addresses ever time you somehow access a label in the program. The
only exceptions are JR (including conditions) and DJNZ. Every
time you LD something from or to a variable in your program, absolute
addressing is made.

>Why does the Z80 reverse bytes so often, like when you store or retrieve a
>byte from the memory, it is stored in reverse order. Why does it make things
>so complicated?

It's not complicated... it's just a way to store numbers, called
little-endian. The Intel x86 processors also uses the same method.
The 68k CPU (TI-92) uses big-endian, ie the other way.
Both methods has advantages and disadvantages.

>How come the [on] key cant break out of an asm program? Is functionality
>like that possible?

Why would a keypress break out of something? In BASIC program, the ROM
checks (probably after each command) if the ON key has been pressed,
and breaks if that's true.

I guess it would be possible to make a TSR program to break out
of an ASM program by pressing ON.

>Fairly Intelligent Questions
>-------------------------------------
>
>For example, what is the APD? Does this involve the calc going into low
>power mode? Does this also involve get_key or whatever, where a keypress is
>received in low power mode?

APD = Auto Power Down = the calc turns off if no key has been pressed
for some time. Low power mode is something different I think.
To activate APD, you have to set some flag in IY land (I believe).

>How are you guys so successful with disassembly? Are
>there any tricks to this skill of reverse engineering? I am still amazed
>Zshell was even made! and even the menus look fairly complicated, yet
>someone out there managed to figure them out.. Damn

To be good at disassembly is to figure out what some asm code is
supposed to do.

ZShell was more than just disassembling though...

>What exactly is a token?

I'm not sure if we're talking about the same thing, but every basic
command is represented as a one-byte token when the program is
"compiled". It takes some time to convert a program from pure ASCII
to tokenized form.

>Are interrupts used in grayscale? I was looking over the source code to a
>grayscale pic and it seems to rapidly change the display using port 0. But I
>have heard interrupts are in use with it. The grayscale pic uses HALT alot,
>and halt is supposed to wait for an interrupt.. Huh? Where does this
>interrupt come from?  Anyone have any info about? How come no one has made
>any grayscale games? It is excessively complicated?

Grayscales uses interrupts yes. You create an interrupt routine which
changes the address to the LCD screen using port 0. Interrupts occurs
very fast (200 times/sec) and when to pictures are flashing at 200hz,
your eyes are fooled.

Grayscale is not complicated at all. Personally, greyscale graphics
can be somewhat hard to see sometimes. For instance, 8x8 sprites using
grayscale usually doesn't look good. It's often hard to see the difference
between the pixels. Big picture often look good in grayscale though.

>What are other uses for interrupts? One interrupt cycles 200 times a second
>right? Could this be utilized as a system clock?

Not really, because it doesn't occur exactly 200 times a second. The
speed depends among other things on battery strength (can change between
190-200 hz or something).

Other uses are decreasing counters in games. In Sqrxz for instance,
each frame is at a fixed speed. This is done by setting a timer
to a number (3, 4 or 5 in Sqrxz depending on the speed you choose).
The interrupt routine decrease this number if it's bigger than zero.
At the end of the frame, the game waits until the timer reaches zero.
That way, each frame takes at least 3 (4, 5)/200 sec. And since
interrupts doesn't occur faster on turboed calcs, it's a good way
to make games equally fast on both kind of calcs.

The HALT instruction can also be used, but it's not good sometimes
because the delay part is always fixed. Using the above method,
the delay part may change, depending on how much work is required
to do the "gaming".

>Is there a memory point where asm is executed when the calculator starts up?

Wasn't that _alt_on_exec ($D490)?

>Questions you should smack me for
>--------------------------------------------------
>
>How are the games emulated on the TI-85? Why is grayscale emulation so
>difficult to emulate? Anyone think grayscale will work better with the
>TI-89? It is supposed to have a better LCD, maybe it has a higher refresh
>rate.

Grayscale will probably work better on the 89, because it's rather
nice on the TI-92. But that may be because of a higher screen
resolution.

>What is the file format of the .86p file? Is it similar to the 85 file? 

A .86p file and a .85p file have - on the compuer - an almost identical
format, except for a byte or two.

>The
>paged ram on the 86 is supposed to make it slower. How slower is the 86
>compared to the 85? Would this make games like Daedulus out of the question?
>How come Andreas doesnt work on the TI-86? Does it have to do with his
>interest in the game boy?

The paged RAM on the 86 makes accessing variables slower. In
TI-BASIC program, you do that all the time. In fact, a BASIC
program is a variable. Assembly programs however, are copied
to a fixed location on RAM page 0 (_asm_exec_ram). Since
you don't deal with variable stuff very much in asm programs
(almost only when saving highscore or similiar thing), asm
programs are executed at the exactly same speed as on the 85.
I mean, both calcs uses a 6 MHz Z80 CPU, so why would
assembly execute slower on the 86?

Andreas doesn't have a TI-86, and it doesn't seem he intends
to get one either. Daedulus is being ported to the 86
by Bill N. - right Bill? Daedulus could maybe be faster
on the 86 - I think - because it has more RAM memory,
and big lookup tables could be used. By using the memory
area $4000-$BFFF as a 32k lookup table (for fast multiplication
maybe), it could hopefully be fast enough to be enjoyable
as well as just impressing :-)

--
Real name: Jimmy Mårdell                 
IRC......: Yarin                         
Email....: mailto:yarin@acc.umu.se      <-- NEW E-MAIL ADDRESS!!!!
Homepage.: http://www.algonet.se/~mja/


References: