|
-
Apr 3rd, 2005, 09:22 AM
#1
Thread Starter
Lively Member
Drawing a box
Hi guys!
Im facing a problem how to draw a box in the middle of the screen. If the input i entered is 7, then it should draw a box 7x7 in the middle. The calculation should be:
79-7 = 77/2=36 <---to get the culumn
24-7 = 17/2 =8.5 <---to get the row
now for the row, should i use 8 or 9 to get the coordinate? if i do use 8 or 9, will the assembly round it up to 8 or 9? Thanks!
Anime is what i LIVE for, BREATH for, and DIE for!
-
Apr 3rd, 2005, 11:02 AM
#2
Re: Drawing a box
Maybe its just that I haven't programmed a line of ASM code longer then I have VB or C (which is about 6 months), but I have no idea what you want help with. Maybe including your code to do this would help?
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 3rd, 2005, 09:28 PM
#3
Thread Starter
Lively Member
Re: Drawing a box
Hi «°°phReAk°°»! Thanks for your reply. I haven't write any code to calculate the coordinate for drawing a box in the middle. But im trying to find out how do i round up the row coordinate because it has a double value (8.5). I cant just point the row cursor at 8.5. I need to round it up to 8 or 9 to point the cursor and get (8,36) or (9,36). Once i get the coordinate, i need to print 7 times to the right and 7 times below to draw a box.
I hope you still get what i meant already. Thanks.
Anime is what i LIVE for, BREATH for, and DIE for!
-
Apr 5th, 2005, 03:47 AM
#4
Re: Drawing a box
All I could find was this. Should round your number out.
Code:
sar eax,cl ; ? Arithmetic shift, last bit shifted into carry
sbb ebx,ebx ; U EBX = (Carry) ? -1 : 0
mov edx,eax ; V
sar edx,31 ; U EDX = (EAX < 0) ? -1 : 0
and ebx,edx ; U EBX = (Carry && EAX < 0)? -1 : 0
sub eax,ebx ; U
Hope that helped.
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|