From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,b821506a14cb3adc X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 2004-03-18 11:39:01 PST Path: archiver1.google.com!postnews2.google.com!not-for-mail From: n8wxs@arrl.net (Jeff Campbell) Newsgroups: comp.sys.dec Subject: Re: What does this Code Do? PDP-11 Please Help? Date: 18 Mar 2004 11:39:01 -0800 Organization: http://groups.google.com Message-ID: <1a40a0b2.0403181139.17730032@posting.google.com> References: <7tj6c.51050$TxJ.28277@news04.bloor.is.net.cable.rogers.com> NNTP-Posting-Host: 209.190.8.140 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1079638741 2586 127.0.0.1 (18 Mar 2004 19:39:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 18 Mar 2004 19:39:01 +0000 (UTC) Xref: archiver1.google.com comp.sys.dec:17920 "newsgroup" 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