Calculator Community > ASM
[8X+] port $24 question
E37:
What's the risk with using real hardware? Sure you are running code with flash unlocked but you are hardly likely to corrupt things. Maybe if you set it so that none of flash is executable and it gets stuck in a reset loop but unless the port lets you deny execution on page 0 the OS should fix it... right? I know the OS does some strange things but I'd be really surprised if it doesn't set the executable limits for flash on boot. It does with the RAM execution.
the_mad_joob:
Having some vital boot|system pages becoming non-executable was something i was considering, which could have happened easily with crappy code.
Like you said, port $24 is probably initialised if things go south, but when you're not sure of something in asm, paranoia is total awareness.
And an old chinese coder used to say "Never overestimate TI.".
EDIT : And even if such port $24 "repair" code exists, it's useless if it's located on a non-executable page itself. #CanYouSmellTheBrick?
thepenguin77:
--- Quote from: the_mad_joob on July 31, 2019, 02:46:37 pm ---Having some vital boot|system pages becoming non-executable was something i was considering, which could have happened easily with crappy code.
Like you said, port $24 is probably initialised if things go south, but when you're not sure of something in asm, paranoia is total awareness.
And an old chinese coder used to say "Never overestimate TI.".
EDIT : And even if such port $24 "repair" code exists, it's useless if it's located on a non-executable page itself. #CanYouSmellTheBrick?
--- End quote ---
It's pretty hard to brick a TI-84. Outside of hardware fault (which I think I saw once in 4 years), I think only brandonW has succeeded in permanently bricking a TI-84. Both he and I have temporarily bricked them by corrupting the certificate, but it's usually possible to fix this by buffer overflowing the boot code link-port receive commands and then clearing out the certificate. (His perma-brick was a maliciously crafted certificate so hardly possible to do by accident.)
There's a new way we discovered to brick your calculator which would be to overwrite the boot code, but you have to be trying to do this and I doubt anyone's ever done it.
But, onto, "what happens to port $24?". In some rather sketchy experiments where I did overwrite the boot code, I mapped out the starting values of all the ports. It turns out that when the calculator restarts (be it a battery pull or internal kill signal), all of the ports get reset to default values. You can find those values here.
Also, the boot code initializes a bunch of stuff. Here's some code from boot code 1.03:
--- Code: ---ROM:41B5 loc_41B5: ; CODE XREF: ROM:41ACj
ROM:41B5 pop af
ROM:41B6 ld a, 2
ROM:41B8 out (2Dh), a
ROM:41BA call setupLinkHandler
ROM:41BD ld a, 17h
ROM:41BF out (29h), a
ROM:41C1 ld a, 27h ; '''
ROM:41C3 out (2Ah), a
ROM:41C5 ld a, 2Fh ; '/'
ROM:41C7 out (2Bh), a
ROM:41C9 ld a, 3Bh ; ';'
ROM:41CB out (2Ch), a
ROM:41CD ld a, 45h ; 'E'
ROM:41CF out (2Eh), a
ROM:41D1 ld a, 4Bh ; 'K'
ROM:41D3 out (2Fh), a
ROM:41D5 ld a, 0
ROM:41D7 nop
ROM:41D8 nop
ROM:41D9 im 1
ROM:41DB di
ROM:41DC out (21h), a
ROM:41DE di
ROM:41DF ld a, 8
ROM:41E1 nop
ROM:41E2 nop
ROM:41E3 im 1
ROM:41E5 di
ROM:41E6 out (22h), a
ROM:41E8 di
ROM:41E9 ld a, 29h ; ')'
ROM:41EB nop
ROM:41EC nop
ROM:41ED im 1
ROM:41EF di
ROM:41F0 out (23h), a
ROM:41F2 di
ROM:41F3 ld a, 10h
ROM:41F5 nop
ROM:41F6 nop
ROM:41F7 im 1
ROM:41F9 di
ROM:41FA out (25h), a
ROM:41FC di
ROM:41FD ld a, 20h ; ' '
ROM:41FF nop
ROM:4200 nop
ROM:4201 im 1
ROM:4203 di
ROM:4204 out (26h), a
ROM:4206 di
ROM:4207 xor a
ROM:4208 out (0Eh), a
ROM:420A out (0Fh), a
ROM:420C out (5), a
ROM:420E ld a, 3Fh ; '?'
ROM:4210 out (6), a
ROM:4212 ld a, 0F0h ; '='
ROM:4214 out (39h), a
ROM:4216 ld a, 20h ; ' '
ROM:4218 out (4Ah), a
ROM:421A push af
ROM:421B xor a
ROM:421C nop
ROM:421D nop
ROM:421E im 1
ROM:4220 di
ROM:4221 out (14h), a
ROM:4223 di
ROM:4224 or a
ROM:4225 jp nz, unk_0
ROM:4228 pop af
ROM:4229 ld a, 80h ; 'Ç'
ROM:422B out (7), a
ROM:422D call bootCSCScan
ROM:4230 cp 38h ; '8'
ROM:4232 jr z, loc_4279
ROM:4234 cp 20h ; ' '
ROM:4236 jr z, loc_4270
ROM:4238 ld a, (byte_38)
ROM:423B cp 0FFh
ROM:423D jr z, loc_424B
ROM:423F ld hl, (word_56)
ROM:4242 ld bc, 0A55Ah
ROM:4245 or a
ROM:4246 sbc hl, bc
ROM:4248 jp z, unk_53
ROM:424B ; START OF FUNCTION CHUNK FOR sub_461A
ROM:424B
ROM:424B loc_424B: ; CODE XREF: ROM:423Dj
ROM:424B ; sub_461A-7Aj ...
ROM:424B ld sp, 0FFC5h
ROM:424E ld a, 6
ROM:4250 out (4), a
ROM:4252 call initCalc
ROM:4255 xor a
ROM:4256 out (20h), a
--- End code ---
the_mad_joob:
--- Quote from: thepenguin77 on August 11, 2019, 05:43:31 pm ---But, onto, "what happens to port $24?". In some rather sketchy experiments where I did overwrite the boot code, I mapped out the starting values of all the ports. It turns out that when the calculator restarts (be it a battery pull or internal kill signal), all of the ports get reset to default values.
--- End quote ---
Thanks for sharing =]
So, if i understand correctly, "what" resets the ports to default values is "outside" of the boot code itself?
Navigation
[0] Message Index
[*] Previous page
Go to full version