Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 7th, 2012, 08:26 PM
Codefacker5062 Codefacker5062 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 3 Codefacker5062 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 18 m 31 sec
Reputation Power: 0
Assembly-ShowFileTime

Code:
INCLUDE Irvine32.inc

.data
Time WORD 1010100001111b	; it will be displayed as 10:16:15

.code
main PROC
	call Clrscr

	mov  ax, Time	
	call ShowFileTime
		exit
main ENDP
ShowFileTime PROC

	push ebx
	push edx
	mov ax,Time 
	
	and eax,00FFh
	and ebx,00FFh
	and edx,00FFh

	call WriteDec
	call DumpRegs
	
	
	; ---------------------------------------------

	mov al,':'	; display a ":"
	call WriteChar
	and eax,00FFh
	and ebx,00FFh
	and edx,00FFh

	call WriteDec
	call DumpRegs
	
	
	
	; ---------------------------------------------

	mov al, ':'	; display a ":"
	call WriteChar

	and eax,00FFh
	and ebx,00FFh
	and edx,00FFh

	call WriteDec
	call DumpRegs
	call Crlf

	pop edx
	pop ebx
	ret
ShowFileTime ENDP
END main

Suppose the time field of a file directory entry uses bits 0-4 for the seconds, bits 5-10 for the minutes, and bits 11-15 for the hours (24-hour clock). For example, the following binary value indicates a time of 02:16:07, in hh:mm:ss format:
00010 010000 00111
Write a procedure named ShowFileTime that receives a binary file time value in the AX
register and displays the time in hh:mm:ss format

So i read your rules and i do very so much realize you do not do homework. But i just do not know were to start i have done searching but im just not quite shure what im even looking for. So if someone could just push me in the right direction it would be greatly appreciated and if i could give more information as to what im doing, need done, or anything else please let me know.

Thanks Ahead

Reply With Quote
  #2  
Old May 8th, 2012, 08:27 AM
OmegaZero OmegaZero is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2007
Posts: 737 OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 31 m 16 sec
Reputation Power: 928
Thinking on these may help:

Can you work out what time a certain bit pattern represents by hand?
What steps did you take to do that?

Do you understand the bit-shift instructions (SAL,SAR,SHL,SHR)?
And the bitwise logical instructions (AND,OR,XOR)?

What does this code do?
Code:
mov ax, 11110000b
shr ax, 4


What does this code do?
Code:
mov ax, 11010101b
and ax, 00001111b
__________________
sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

Reply With Quote
  #3  
Old May 8th, 2012, 04:00 PM
Codefacker5062 Codefacker5062 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 3 Codefacker5062 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 18 m 31 sec
Reputation Power: 0
Thanks so much shortly after reading this i figured out exactly what it was i needed to do. So i thank you greatly!!!!!

Now i have a question.. Do i post my final result for other people with this homework assignment or would that be considered doing it for someone?

Just let me know and when i finish up i will or will not post it.

Reply With Quote
  #4  
Old May 9th, 2012, 07:21 AM
OmegaZero OmegaZero is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: May 2007
Posts: 737 OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level)OmegaZero User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 31 m 16 sec
Reputation Power: 928
For homework assignments you shouldn't post complete solutions. Hopefully any other/future students with your assignment will gain the same benefit by figuring out the solution themselves.

In other cases though, the code or some description of what worked is helpful to people who find the post in the future. Especially if many possible solutions are posted.

Reply With Quote
  #5  
Old May 9th, 2012, 07:47 PM
Codefacker5062 Codefacker5062 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 3 Codefacker5062 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 18 m 31 sec
Reputation Power: 0
Alright well for future homework assignment people i found the Rotate command to help greatly with the Shr/Shl Commands.
rol- Roll Left
ror- Roll Right

So basically:
If we are starting with the commands and functions i set in my code then..
Code:
mov ax,time
rol ax,4

This Basically takes 1010100001111 and rotates it like a tank so:
101010000111 becomes 1000011111010 (1010 is shifted to back like a tank would rolling forward and the "4" is how many times it rotates)
So these will be needed and you need to know When you Rotate or Shift its permanent throughout the script so you need to reset it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Assembly-ShowFileTime

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap