Difference between revisions of "84PCE:Syscalls:021D7C"

From WikiTI
Jump to: navigation, search
(Synopsis)
(Synopsis)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:84PCE:Syscalls:By Name|SignExtendDE_broken]]
+
[[Category:84PCE:Syscalls:By Name|SignExtendDE]]
[[Category:84PCE:Syscalls:By Address|021D7C - SignExtendDE_broken]]
+
[[Category:84PCE:Syscalls:By Address|021D7C - SignExtendDE]]
 
== Synopsis ==
 
== Synopsis ==
'''Hypothesized Official Name:''' SignExtendDE_broken
+
'''Hypothesized Official Name:''' SignExtendDE
  
 
'''Syscall Address:''' 021D7Ch
 
'''Syscall Address:''' 021D7Ch
  
This is supposed to extend the signed 16-bit DE value to be 24-bit signed.
+
This was originally a broken call, and still is in OS 5.0.0.0089 (and others, perchance?) But after sending in information, TI did an amazing job and fixed this call.  
  
However, due to what looks like a copy-paste error by TI, this routine is pretty much useless.
+
It is known to work in OS 5.1.0.0110.
  
It looks like they tried to use code from SignExtendBC, and forgot to change a byte.
+
=== Inputs ===
 +
DE - 16-bit signed value
  
Here is what this routine calls, if you can find a particular use for it, go for it.
+
=== Outputs ===
 +
DE - 24-bit signed value
  
<nowiki>SignExtendDE_broken:
+
=== Destroys ===
push af
+
* DEU
  xor a
+
  ld (0D02AD7h), de
+
  bit 7, b                ; This should be d, not b
+
  jr z, _+
+
  dec a
+
_+:
+
  ld (0D02AD9h), a
+
  ld de, (0D02AD7h)
+
pop af
+
ret </nowiki>
+

Latest revision as of 13:04, 4 September 2015

Synopsis

Hypothesized Official Name: SignExtendDE

Syscall Address: 021D7Ch

This was originally a broken call, and still is in OS 5.0.0.0089 (and others, perchance?) But after sending in information, TI did an amazing job and fixed this call.

It is known to work in OS 5.1.0.0110.

Inputs

DE - 16-bit signed value

Outputs

DE - 24-bit signed value

Destroys

  • DEU