Shop OBEX P1 Docs P2 Docs Learn Events
backup loop with put — Parallax Forums

backup loop with put

ArchiverArchiver Posts: 46,084
edited 2002-02-23 19:42 in General Discussion
Heinz-

I think you want:

backup:
for b25 = 50 to 74
put b25,b0(b25 - 50)
next

That should store b0 through b24 in scratchpad locations 50 through
74.

Regards,

Steve

H Schwenk GMX wrote:

> If I wont to save all variables in the scratch Ram
> on the address 50 to 74 (stamp 2p)
> can I use this subroutine
> backup:
> for b25 = 50 to 74
> put b25,b0(b25)
> next
> return
> dos the compiler understand that I wont to store
> b0 in the ram on the address 50
> b1 in the ram on the address 51...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-02-23 17:51
    Hi
    I am not sure if I understand well ????
    Somebody maybe like to tell me?
    If I wont to save all variables in the scratch Ram
    on the address 50 to 74 (stamp 2p)
    can I use this subroutine
    backup:
    for b25 = 50 to 74
    put b25,b0(b25)
    next
    return
    dos the compiler understand that I wont to store
    b0 in the ram on the address 50
    b1 in the ram on the address 51
    b2 in the ram on the address 52
    and so on ???

    Thanks Heinz
  • ArchiverArchiver Posts: 46,084
    edited 2002-02-23 19:42
    > for b25 = 50 to 74
    > put b25,b0(b25)
    >next

    Yes, that will store 25 RAM bytes in the scratchpad.
Sign In or Register to comment.