From: n8wxs@arrl.net (Jeff Campbell)
Subject: Re: What does this Code Do? PDP-11 Please Help?
Date: 18 Mar 2004 11:39:01 -0800 [thread overview]
Message-ID: <1a40a0b2.0403181139.17730032@posting.google.com> (raw)
In-Reply-To: 7tj6c.51050$TxJ.28277@news04.bloor.is.net.cable.rogers.com
"newsgroup" <blah@rogers.com> wrote in message news:<7tj6c.51050$TxJ.28277@news04.bloor.is.net.cable.rogers.com>...
> PDP-11
>
> I just need to know what it does I am slightly lost :-(
>
> MOV R1, -(R6)
> MOV R0, R1
> DEC R0
> BGT 3016
> MOV R1, R0
> MOV (R6)+, R1
> RTS R7
> MUL #1, R0
>
> Please let me know if anyone can sorta make out whats going on here?
MOV R1, -(R6) push r1 onto stack
MOV R0, R1 copy r0 to r1
DEC R0 subtract one from r0
BGT 3016 branch to location 3016 if r0's contents are greater than zero
MOV R1, R0 copy r1 to r0, restores r0's contents
MOV (R6)+, R1 pop stack into r1, restores r1's contents
RTS R7 return from subroutine using the program counter, r7, for linkage
MUL #1, R0 multiple r0 by 1
HTH,
Jeff Campbell
n8wxs@arrl.net
next prev parent reply other threads:[~2004-03-18 19:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-18 15:44 What does this Code Do? PDP-11 Please Help? newsgroup
2004-03-18 19:39 ` Jeff Campbell [this message]
2004-03-18 20:07 ` John Laird
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox