RE: Interesting code I need help with

From: Baltissen, GJPAA (Ruud) (ruud.baltissen_at_abp.nl)
Date: 2004-04-13 11:24:04

Hallo Jim,


I haven't an idea what exactly it is doing but it doesn't stop me to
translate it to Pascal.

> .C:bccf   8D FE BC   STA $BCFE           BCFE := Acc 

> .C:bcd2   98         TYA              not needed
> .C:bcd3   48         PHA              not needed
> .C:bcd4   A2 08      LDX #$08         X := 8

                                                   repeat

> .C:bcd9   2A         ROL A
> .C:bcda   29 01      AND #$01         Acc := BCFE and 1

> .C:bcd6   4E FE BC   LSR $BCFE                BCFE := BCFE shr 1


> .C:bcdc   4D 00 BD   EOR $BD00                Acc := Acc xor BD00

> .C:bcdf   4E FF BC   LSR $BCFF                B1 := BCFF and 1
                                                        BCFF := BCFF shr 1

> .C:bce2   6A         ROR A                    B2:= Acc and 1
                                                        Acc := Acc shr 1
                                                        if B1 = 1 then Acc
:= Acc or 128

> .C:bce3   90 0E      BCC $BCF3                if B2 = 0 then
                                                                BD00 := Acc
                                                        else
                                                          begin

> .C:bce5   A8         TAY              not needed

> .C:bce6   AD FF BC   LDA $BCFF
> .C:bce9   4D FC BC   EOR $BCFC
> .C:bcec   8D FF BC   STA $BCFF                        BCFF := BCFF xor
BCFC

> .C:bcef   98         TYA              not needed

> .C:bcf0   4D FD BC   EOR $BCFD
> .C:bcf3   8D 00 BD   STA $BD00                        BD00 := Acc xor BCFD

                                                          end

> .C:bcf6   CA         DEX                      dec(X)

> .C:bcf7   D0 DD      BNE $BCD6           until X = 0

> .C:bcf9   68         PLA              not needed
> .C:bcfa   A8         TAY              not needed
> .C:bcfb   60         RTS

IMHO one can translate above to C.


--
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: Ruud.C64.org









=====DISCLAIMER=================================================================

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij overgebrachte virussen.

The information contained in this e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail; please delete in this case the e-mail and do not disclose its contents to any person. We don't accept liability for any errors, omissions, delays of receipt or viruses in the contents of this message which arise as a result of e-mail transmission.


       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.