DOS386 13.04.2009, 10:20 |
18 Bytes !!! Anyone can beat this? HEX16 for 8086 (Developers) |
Task: convert the value in DX (or some other register) into a 4-Bytes string representing the number in HEX using 8086 compatible instructions (no TSR this time, sorry ) --- |
ecm Düsseldorf, Germany, 13.04.2009, 14:08 @ DOS386 |
18 Bytes! Anyone can beat this? - No |
My solution requires 34 bytes, but I think it's easier to understand than using das (or daa, see below). --- |
DOS386 13.04.2009, 14:32 @ ecm |
18 Bytes! Anyone can beat this? - No DAS |
> easier to understand than using das --- |
rr Berlin, Germany, 13.04.2009, 16:13 @ DOS386 |
18 Bytes! Anyone can beat this? - No DAS |
> So my code grows to 21 Bytes. I have no idea how DAS works but it --- |
mht Wroclaw, Poland, 13.04.2009, 16:04 @ DOS386 |
18 Bytes !!! Anyone can beat this? HEX16 for 8086 |
You can still improve register usage. Use rotations on one register instead of shifts on two (4 rotations by 4 bits = no-op). |
DOS386 18.05.2009, 05:54 (edited by DOS386, 18.05.2009, 06:09) @ mht |
18 Bytes !!! Anyone can beat this? HEX16 for 8086 | ROL |
rr wrote: --- |