Go Back  Xtreme Visual Basic Talk > Other Languages > Miscellaneous Languages > Assembly Language: Transposing This Souce Code


Reply
 
Thread Tools Display Modes
  #1  
Old 04-18-2004, 05:21 AM
Silv3rSurf3r_20 Silv3rSurf3r_20 is offline
Regular
 
Join Date: Aug 2002
Posts: 90
Question Assembly Language: Transposing This Souce Code


Good Day All,

I have a problem. I'm new to assembly programming and i have no idea how i'm gonna do this task. I need to write a program in assembly language and i'm not familiar with the syntax but i've written the pseudocode for it. I was wondering if anyone could help me transpose this.

set x=y=0
loop 3 times
z = get valid digit from the keyboard
draw suqare of size z at (x,y)
y = y+z
end loop

I need to do this in intel x8086. i'm not too sure how to pass values in a parameter list in assembly language. do i use a stack for that?

any amount of help will be greatly appreciated.

Cheers.
Reply With Quote
  #2  
Old 04-18-2004, 02:15 PM
Iceplug's Avatar
Iceplug Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
Default

Yes, it is recommended to use a stack when making function calls in ASM:
Example:
Code:
MOV ax, 50
MOV bx, 20
MOV cx, 20
CALL ADDER
...
ADDER:
; Only using dx to show that you can preserve registers this way.
  PUSH dx
  MOV dx, cx
  ADD dx, bx
  ADD dx, ax
  MOV ax, dx
  POP dx
RET
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
Reply


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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code within Code KermitDFrog General 0 11-28-2003 09:15 PM
ASP Code Generator cliff_m01 Web Programming 1 10-21-2003 12:11 PM
A tuffy for Code GURUS... ghs215 General 18 06-27-2001 02:35 PM
Lines of code orufet General 6 06-25-2001 12:45 AM
How could i call a function api i generated in vb visualbasic700e General 4 12-10-2000 05:53 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->