Difference between revisions of "83Plus:State of the calculator at boot"
Thepenguin77 (Talk | contribs) (Created page with 'This page is dedicated to what happens right when the calculator begins to execute code. For now, all the information is about the 84+. When someone does some boot code work wit…') |
Thepenguin77 (Talk | contribs) |
||
Line 322: | Line 322: | ||
* Every other port works exactly how it should | * Every other port works exactly how it should | ||
* Page 00h is restored to 0000h when and only when a byte is executed in a memory bank controlled by [[83Plus:Ports:06|port 06]]. This means that in memory map mode 0, a byte must be executed in the 4000h-7FFFh range, and in memory map mode 1, a byte must be executed in the 4000-BFFFh range. When this byte is executed, 00h instantly goes back to 0000h. | * Page 00h is restored to 0000h when and only when a byte is executed in a memory bank controlled by [[83Plus:Ports:06|port 06]]. This means that in memory map mode 0, a byte must be executed in the 4000h-7FFFh range, and in memory map mode 1, a byte must be executed in the 4000-BFFFh range. When this byte is executed, 00h instantly goes back to 0000h. | ||
+ | |||
+ | It has also been determined that [[83Plus:Ports:0E|ports 0E and 0F]] play no part in this behavior on the 84+. | ||
==Gathering this Information== | ==Gathering this Information== | ||
This information could only be gathered by replacing the boot code. This was a very dangerous operation as one mistake will brick the calculator. You should not attempt to recreate anything on this page or write your own boot code unless you are a master at z80 assembly. | This information could only be gathered by replacing the boot code. This was a very dangerous operation as one mistake will brick the calculator. You should not attempt to recreate anything on this page or write your own boot code unless you are a master at z80 assembly. |
Revision as of 18:09, 25 November 2011
This page is dedicated to what happens right when the calculator begins to execute code.
For now, all the information is about the 84+. When someone does some boot code work with the 83+, this page will have to be updated.
Registers
All registers are 00h. However, if you are writing a boot code, you should still initialize the variables on the off chance that one is not 00h, or if someone jumps to your boot code.
Port Values
These port values were all found on an 84+SE hardware revision M with a port 15 value of 55h.
|
|
|
|
|
|
|
|
Interesting points:
- Flash is locked
- 4000h contains flash page 00h
- 8000h contains flash page 00h
- C000h contains ram page 00h
- The LCD driver is disconnected (port 29 causes this)
- The boot code is unlocked
- 84+BE/SE cannot be determined from port 21 as it reads 33h
- All parts of flash except privileged pages are non-executable (2C-2F, 3F, 6C-6F, and 7F)
- All of ram is non-executable except the first 1024 bytes of ram page 00h
- None of the LCD delay ports are set
- The clock is off
- The USB driver is off
Memory Mapping
Here's where the boot code gets fun. Since on boot all variables and ports have been reset, it would logically follow that execution should start at 0000h. There's a problem though, 0000h is always flash page 00h. In order to beat this, TI actually had to add a hack to put the boot code into the 0000h region.
- The calculator is in memory map mode 0
- Page 7Fh is swapped into the 0000h region and acts completely normal
- Every other port works exactly how it should
- Page 00h is restored to 0000h when and only when a byte is executed in a memory bank controlled by port 06. This means that in memory map mode 0, a byte must be executed in the 4000h-7FFFh range, and in memory map mode 1, a byte must be executed in the 4000-BFFFh range. When this byte is executed, 00h instantly goes back to 0000h.
It has also been determined that ports 0E and 0F play no part in this behavior on the 84+.
Gathering this Information
This information could only be gathered by replacing the boot code. This was a very dangerous operation as one mistake will brick the calculator. You should not attempt to recreate anything on this page or write your own boot code unless you are a master at z80 assembly.