forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Retrieving HiWord, LoWord etc. in plain VDS

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 737
Location: The Netherlands

PostPosted: Fri Aug 01, 2003 2:55 am    Post subject: Retrieving HiWord, LoWord etc. in plain VDS Reply with quote

Code:

#-----------------------------------------------------------------------------#
#                                                                             #
# Byte and Word Conversion in plain VDS                                       #
#                                                                             #
# Author: Tommy Sools                                                         #
#                                                                             #
# Copyright: Public Domain                                                    #
#                                                                             #
#-----------------------------------------------------------------------------#

  #define function,hibyte
  #define function,lobyte
  #define function,makeword
  #define function,hiword
  #define function,loword
  %A = %Ahigh byte of $3022 = @hibyte($3022)@cr()
  %A = %Alow byte of $3022 = @lobyte($3022)@cr()
  %A = %Amakeword with $30 and $22 = @makeword($30,$22)@cr()
  %A = %Ahigh word of $80251305 = @hiword($80251305)@cr()
  %A = %Alow word of $80251305 = @loword($80251305)@cr()
  %A = %Amakelong with $8025 and $1305 = @makelong($8025,$1305)@cr()
  info %A
  exit
:hibyte
  rem %1 = word value
  exit $@substr(@strdel(@hex(%1,4),1,-4),1,2)
:lobyte
  rem %1 = word value
  exit $@substr(@strdel(@hex(%1,4),1,-4),3,4)
:makeword
  rem %1 = high byte value
  rem %2 = low byte value
  exit $@strdel(@hex(%1,2),1,-2)@strdel(@hex(%2,2),1,-2)
:hiword
  rem %1 = long integer value
  exit $@substr(@strdel(@hex(%1,8),1,-8),1,4)
:loword
  rem %1 = long integer value
  exit $@substr(@strdel(@hex(%1,8),1,-8),5,8)
:makelong
  rem %1 = high word value
  rem %2 = low word value
  exit $@strdel(@hex(%1,4),1,-4)@strdel(@hex(%2,4),1,-4)

Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 01, 2003 1:16 pm    Post subject: Reply with quote

Excellent code. Thumbs Up
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1054
Location: India

PostPosted: Fri Aug 01, 2003 2:03 pm    Post subject: Reply with quote

Nice one Tommy. I knew about hi and lowords from mindpower. But this added to my knowledge. If a dll needs very fast data like for sound processing a dll for doing calculations may be slightly better i think but for usual applications this is excellent.
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group