Re: Wanted: Subroutine call example

2001-09-17 Thread Gregor Purdy
> skip( "label constants unimplemented in assembler", 1 ); > set I4, 42 > set I5, HERE > jumpI5 > set I4, 1234 > HERE: > print I4 > end HERE will be relative, so what you'll really get is * - HERE (where * is the PC for the set command). Then, when you jump (whi

Re: Wanted: Subroutine call example

2001-09-17 Thread Dan Sugalski
At 11:04 PM 9/17/2001 +0100, Simon Cozens wrote: >On Mon, Sep 17, 2001 at 05:52:19PM -0400, Dan Sugalski wrote: > > >Which is really going to screw up backpatching. :( > > > > Maybe. I don't think it's as big a deal as you might think it is, since we > > vector through a register, and you can just

Re: Wanted: Subroutine call example

2001-09-17 Thread Simon Cozens
On Mon, Sep 17, 2001 at 05:52:19PM -0400, Dan Sugalski wrote: > >Which is really going to screw up backpatching. :( > > Maybe. I don't think it's as big a deal as you might think it is, since we > vector through a register, and you can just patch the register load. The reason I started looking

Re: Wanted: Subroutine call example

2001-09-17 Thread Dan Sugalski
At 10:37 PM 9/17/2001 +0100, Simon Cozens wrote: >On Sun, Sep 16, 2001 at 01:03:17PM -0500, Brian Wheeler wrote: > > Its not going to work, if I understand it correctly. I tried doing it > > (even set up the symbol '*' to mean the current PC) and do it, but it > > seems the ops take a relative of

Re: Wanted: Subroutine call example

2001-09-17 Thread Simon Cozens
On Sun, Sep 16, 2001 at 01:03:17PM -0500, Brian Wheeler wrote: > Its not going to work, if I understand it correctly. I tried doing it > (even set up the symbol '*' to mean the current PC) and do it, but it > seems the ops take a relative offset. Take jump_i, for example: > > /* JUMP Ix */ > MA

Re: Wanted: Subroutine call example

2001-09-17 Thread Dan Sugalski
At 12:50 PM 9/17/2001 -0400, Gregor N. Purdy wrote: >I wonder... What could I add to Jako so that it could be used to >implement a simple PMC type? How much more architecture work needs to >be done before we could start having simple examples that use PMC >registers? Not much at the moment. PMCs

Re: Wanted: Subroutine call example

2001-09-17 Thread Dan Sugalski
At 11:49 AM 9/17/2001 -0500, Brian Wheeler wrote: >On Mon, 2001-09-17 at 11:20, Gregor N. Purdy wrote: > > > > It would also be helpful to have jump_ic and absjump_ic, rather than > > > > having to load these things into registers. > > > > > > You can use branch_ic for this. absjump is probably a

Re: Wanted: Subroutine call example

2001-09-17 Thread Gregor N. Purdy
On Mon, 2001-09-17 at 12:32, Dan Sugalski wrote: > At 12:20 PM 9/17/2001 -0400, Gregor N. Purdy wrote: > >Brian -- > > > > It would also be helpful to have jump_ic and absjump_ic, rather than > > > > having to load these things into registers. > > > > > > You can use branch_ic for this. absjump i

Re: Wanted: Subroutine call example

2001-09-17 Thread Brian Wheeler
On Mon, 2001-09-17 at 11:20, Gregor N. Purdy wrote: > > I agree that jsr/ret are what I really want, but I'm dying to play > with baby subroutines in jako, and I think I could play enough games > with a properly understood jump_i and some assembler magic to make > them work. I now have jump.pasm

Re: Wanted: Subroutine call example

2001-09-17 Thread Dan Sugalski
At 12:20 PM 9/17/2001 -0400, Gregor N. Purdy wrote: >Brian -- > > > It would also be helpful to have jump_ic and absjump_ic, rather than > > > having to load these things into registers. > > > > You can use branch_ic for this. absjump is probably a bad idea since it > > appears the return value o

Re: Wanted: Subroutine call example

2001-09-17 Thread Gregor N. Purdy
Brian -- > > I also did 'vi t/jump.list'. With these hard-coded relative offsets, I > > think the program should be producing the desired output, but it > > doesn't. If it did, I could do some tricks in jakoc and/or assemble.pl > > to create a pseudo-op for jumping to any label, and another for >

Re: Wanted: Subroutine call example

2001-09-17 Thread Brian Wheeler
On Sun, 2001-09-16 at 14:26, Gregor N. Purdy wrote: > Brian -- > > > Its not going to work, if I understand it correctly. I tried doing it > > (even set up the symbol '*' to mean the current PC) and do it, but it > > seems the ops take a relative offset. Take jump_i, for example: > > Taking th

Re: Wanted: Subroutine call example

2001-09-16 Thread Gregor N. Purdy
Brian -- > Its not going to work, if I understand it correctly. I tried doing it > (even set up the symbol '*' to mean the current PC) and do it, but it > seems the ops take a relative offset. Take jump_i, for example: Taking this into account, I modivied jump.pasm and fixed the offsets. I tes

Re: Wanted: Subroutine call example

2001-09-16 Thread Brian Wheeler
On Sun, 2001-09-16 at 11:51, Gregor N. Purdy wrote: > All -- > > > Anyone care to post a subcall.pasm example file that shows the > > implementation of a subroutine and a call to it? I was thinking > > of starting from euclid.pasm (since it has two args), but I'm > > not sure I understand what th

Re: Wanted: Subroutine call example

2001-09-16 Thread Gregor N. Purdy
All -- > Anyone care to post a subcall.pasm example file that shows the > implementation of a subroutine and a call to it? I was thinking > of starting from euclid.pasm (since it has two args), but I'm > not sure I understand what the calling convention is really > supposed to look like... Here

Re: Wanted: Subroutine call example

2001-09-16 Thread Dan Sugalski
On 16 Sep 2001, Gregor N. Purdy wrote: > All -- > > Anyone care to post a subcall.pasm example file that shows the > implementation of a subroutine and a call to it? I was thinking > of starting from euclid.pasm (since it has two args), but I'm > not sure I understand what the calling convention

Wanted: Subroutine call example

2001-09-16 Thread Gregor N. Purdy
All -- Anyone care to post a subcall.pasm example file that shows the implementation of a subroutine and a call to it? I was thinking of starting from euclid.pasm (since it has two args), but I'm not sure I understand what the calling convention is really supposed to look like... Regards, -- G