Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 7th, 2013, 3:49 AM   #1
kayxxx
Newbie
 
Join Date: Feb 2013
Posts: 6
Rep Power: 0 kayxxx is on a distinguished road
guys...

mov ah, 0
sub al, 30h
push ax
mov ax, 10d
mul bx
pop bx
add bx, ax

i need help can someone explain this? thank you!
kayxxx is offline   Reply With Quote
Old Jun 7th, 2013, 9:06 AM   #2
Ancient Dragon
Achieved Level 70

 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 4,345
Rep Power: 10 Ancient Dragon will become famous soon enoughAncient Dragon will become famous soon enough
Re: guys...

what do you need explaining? The individual statements or the logic?
__________________
PFO's FAQ is here
Forum Rules

There is no cow level (Diablo III)
If you never push yourself you will never improve (Diablo III)
Ancient Dragon is offline   Reply With Quote
Old Jun 9th, 2013, 6:05 PM   #3
sixstringartist
Programming Guru

 
Join Date: Jun 2005
Posts: 1,333
Rep Power: 13 sixstringartist will become famous soon enough
Post Re: guys...

Quote:
Originally Posted by kayxxx View Post
mov ah, 0
sub al, 30h
push ax
These three instructions say
1. Store zero in register ah (this is the high byte of the ax register)
2. Subtract 0x30 from al ( here we dont know what al is. presumably there are more instructions that happen previously that you did not post).

3. Store ax on the stack. (ax holds the result of the subtraction.

Can you do the rest?
sixstringartist is offline   Reply With Quote
Old Jun 11th, 2013, 11:03 AM   #4
kayxxx
Newbie
 
Join Date: Feb 2013
Posts: 6
Rep Power: 0 kayxxx is on a distinguished road
Re: guys...

Quote:
Originally Posted by sixstringartist View Post
These three instructions say
1. Store zero in register ah (this is the high byte of the ax register)
2. Subtract 0x30 from al ( here we dont know what al is. presumably there are more instructions that happen previously that you did not post).

3. Store ax on the stack. (ax holds the result of the subtraction.

Can you do the rest?



hi sir thank you yes there are more instruction if its ok to you that you can help me to explain the every statement of the prog.. sir? i need to know because sometimes i read a assembly language tutorials but sometimes i cant understand well why that happen.. thats why i post this because i know somebody ccan help me.. and i think that's you sir.. this is the codes.. so that i can understand well thank you sir for your concern sir.



model small
.stack
org 100
.data
year db 10,13, "Year: $"
leapmsg db 10, 13, "That is a leap year! $"
notleapmsg db 10, 13, "That is not a leap year! $"
.code

start:

mov ax, @data
mov ds, ax

lea dx, year
mov ah, 09h
int 21h

call InputProc


leapTrue:

lea dx, leapmsg
mov ah, 09h
int 21h
jmp close

leapFalse:

lea dx, notleapmsg
mov ah, 09h
int 21h
jmp close

close:

mov ah, 4ch
int 21h


Proc InputProc


mov ah, 01h
int 21h
cmp al, 0dh
je FirstTest

mov ah, 0
sub al, 30h
push ax
mov ax, 10d
mul bx
pop bx
add bx, ax
jmp inputProc

call FirstTest
ENDP

Proc FirstTest

mov ax, bx
push ax
mov bx, 4
div bx
cmp dx, 0
je SecondTest
jmp leapFalse

RET
EndP

Proc SecondTest
pop ax
push ax
mov bx, 100
div bx
cmp dx, 0
je ThirdTest
jmp leapTrue
EndP

Proc ThirdTest

pop ax
mov bx, 400
div bx
cmp dx, 0
je leapTrue
jmp leapFalse

EndP

end start
kayxxx is offline   Reply With Quote
Old Jun 12th, 2013, 10:23 AM   #5
kayxxx
Newbie
 
Join Date: Feb 2013
Posts: 6
Rep Power: 0 kayxxx is on a distinguished road
Re: guys...

Quote:
Originally Posted by Ancient Dragon View Post
what do you need explaining? The individual statements or the logic?
sir individual statement. sir hope you can help me with my problem so that i can understand well
kayxxx is offline   Reply With Quote
Old Jun 12th, 2013, 10:26 AM   #6
sixstringartist
Programming Guru

 
Join Date: Jun 2005
Posts: 1,333
Rep Power: 13 sixstringartist will become famous soon enough
Re: guys...

Have you looked at x86 ASM tutorials? If you are unsure of how to start understanding the code above you should start with smaller examples and build up.

This tutorial here is one of the best. http://win32assembly.programminghori...tutorials.html

It is very old though so some aspects are out of date.
sixstringartist is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
i need a Little Help guys :( NoobProgramer Java 13 Aug 12th, 2011 7:40 AM
Plz Help me guys :( Krishnan Java 2 Aug 12th, 2011 12:17 AM
Hey Guys Eric the Red Coder's Corner Lounge 1 Jan 10th, 2008 2:51 AM
Hi Guys. First Time Poster shayne434 Coder's Corner Lounge 12 Mar 18th, 2005 3:08 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:08 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC