Re: A83: Can you check this code:


[Prev][Next][Index][Thread]

Re: A83: Can you check this code:




Nice program, but if I made a change it applies for [most] instances
throughout your code, about the placement [?]  I can't help you, try Trey or
one of the other die hard asm.  I am still learning.

-Phelan 'Amen' Wolf

Alan C Johnson wrote:

> You really don't have to check this: it is a lot of code.  I would really
> appreciate it if did, though.
>
> The point of it is to display Master M and bounce it off the sides of the
> screen.  All of the stuff at the begining is to make it A-Shel
> compatible.  I managed to make it stable, the only problems are that the
> words aren't in the right place and they don't move.
>
> Also, I used register 'a'  a lot to make sure the instructions worked.
> I'm sure I didn't need it at least half of the time.
>
> Thanks so much if you help.
>
> GetKey1:
>         call    _getkey
>         cp      05h
>         jp      z,Init
>         jp      nz,GetKey1

change this to jp GetKey1

> Init:
>         ld      a,29
>         ld      b,a
>         ld      a,29
>         ld      c,a
>         ld      a,1
>         ld      d,a

ok, do this:

ld b,29  ;load 29 into b
ld c,b    ;load 29(b) into c
ld d,1    ;load 1 into d

> Check1:
>         ld      a,l
>         cp      d

what is d set at, did you set that in init

>         jp      z,D1
>         ld      a,2
>         cp      d
>         jp      z,D2
>         ld      a,3
>         cp      d
>         jp      z,D3
>         ld      a,4
>         cp      d
>         jp      z,D4
>

what happens if a does not equal d?

> D1:
>         ld      a,b
>         inc     a
>

skip ld a,b   just do inc b

>         ld      b,a
>         ld      a,c
>         inc     a
>         ld      c,a
>         cp      a
>         jp      z,DCC1
> D2:
>         ld      a,b
>         dec     a
>

skip ld a,b  just use dec b

>   ld      b,a
>         ld      a,c
>         inc     a
>         ld      c,a
>         cp      a
>         jp      z,DCC1
> D3:
>         ld      a,b
>         dec     a
>         ld      b,a
>         ld      a,c
>         dec     a
>         ld      c,a
>         cp      a
>         jp      z,DCC1
> D4:
>         ld      a,b
>         inc     a
>         ld      b,a
>         ld      a,c
>         dec     a
>         ld      c,a
>         cp      a
>         jp      z,DCC1
> DCC1:
>         ld      a,55
>         cp      c
>         jp      z,DC1
>         jp      nz,DCC2
> DCC2:
>         ld      a,58
>         cp      b
>         jp      z,DC2

>         jp      nz,DCC3
>

just use jp DCC3

> DC2:
>         ld      d,3
> DCC3:
>         ld      a,0
>         cp      c
>         jp      z,DC3
>         jp      nz,DCC4
>

just use jp DCC4

> DC3:
>         ld      d,4
> DCC4:
>         ld      a,0
>         cp      b
>         jp      z,DC4
>         jp      nz,GetKey2
> DC4:
>         ld      d,1
> Getkey2:
>         call    _getkey
>         cp      05h
>         jp      z,Exit
>         jp      nz,Display
> Exit:
>         call    _clrlcdfull
>         ld      hl,0000h
>         ld      (CURROW),hl
>         ret
> Title:
>  .db "Word Mover Plus",0
> Author:
>  .db "By Mastermind",0
> Message:
>  .db "Master M",0       ;Feel free to change this
>
> .end
> END
>
> _____________________________________________________________________
> You don't need to buy Internet access to use free Internet e-mail.
> Get completely free e-mail from Juno at http://www.juno.com
> Or call Juno at (800) 654-JUNO [654-5866]




Follow-Ups: References: