Current location: Hot Scripts Forums » Programming Languages » Other Languages » assembly language easy, need help


assembly language easy, need help

Reply
  #1 (permalink)  
Old 04-07-09, 10:38 PM
duke7575 duke7575 is offline
New Member
 
Join Date: Apr 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
assembly language easy, need help

Given below is a C function (empty) and a corresponding assembly code generated by some
C compiler.
void
empty(short n, int src, int dest)
{ if (n == 1) print_result();
else empty(n-1,dest,src);
}
_empty: link a6, #0
cmp.w #1, 8(a6)
bne L1
jsr _print_result
jmp L2
L1: move.l 10(a6), -(sp)
move.l 14(a6), -(sp)
move.w 8(a6), d0
subq.l #1, d0
move.w d0, -(sp)
jsr _empty

L2:

L3: unlk a6

rts

Just please help me out asap
I need help with
(a) Drawing a diagram illustrating the contents of the top part of the stack, as seen by function
empty.
(b) Giving a sequence of assembly instructions that can be added between the labels L2 and
L3 to perform the call: empty(n,src-1,dest+1)
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
about assembly language mobiseek Other Languages 0 03-30-09 01:19 AM
Assembly Language Help please nito28 Other Languages 0 02-05-09 09:58 PM
assembly language anupamsr Hot Scripts Forum Questions, Suggestions and Feedback 9 12-31-08 10:45 AM
How to build a binary tree in assembly language? phingphing Other Languages 0 11-04-08 07:15 AM
Assembly Language question jessicayan Other Languages 1 02-13-07 03:07 PM


All times are GMT -5. The time now is 03:45 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.