RE: A83: Running asm Programs...


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

RE: A83: Running asm Programs...




Did you copy the loader to a save place in memory, before calling it??? the
program you run should not overwrite the loader...


-----Oorspronkelijk bericht-----
Van: yhean [mailto:yhean@mailcity.com]
Verzonden: zaterdag 8 april 2000 18:55
Aan: assembly-83@lists.ticalc.org
Onderwerp: Re: A83: Running asm Programs...

 

I am having another problem... :(
The code I load in memory does exactly what the pseudocode you wrote does,
but when the program I want to load is bigger (again) than the 'shell', it
execute without any problem but crash when it exits, because in fact, when
the pseudocode swaps the bytes, it overwrites the 'shell' that had already
be swapped!
Did I forgot something?

Jean


>The code you put in memory should do the folowing things:
>
>[ -- start pseudocode -- ]
>
>push registers
>call swapbytes
>call $9327
>call swapbytes
>pop registers
>return              [ return to shell ]
>
>swapbytes:
>  temp = size
>  ptr1 = $9327
>  ptr2 = ptr_to_file
>
>  loop:
>    A = (ptr1)
>    (ptr1) = (ptr2)
>    (prt2) = A
>    temp = temp - 1
>    ptr1 = ptr1 + 1
>    ptr2 = ptr2 + 1
>  while temp<>0 goto loop
>return
>
>[ -- end of pseudocode -- ]
>
>Notes: 
>- this way of loading asm-files screwes up the VAT (while running the
>program not all pointers in the VAT are correct)
>- to run SOS programs you should use the SOS load-routine (or a
look-a-like:
>SwapByte can be used from SOS programs, some programs pop some regs which
>are pushed here, lib-pointers point to space directly after the loader, so
>the loader can't be any larger)



Send FREE April Fool's Greetings to your friends!
http://www.whowhere.lycos.com/redirects/American_Greetings.rdct