From owner-freebsd-questions@FreeBSD.ORG Fri Jun 12 10:44:43 2015 Return-Path: Delivered-To: freebsd-questions@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86A6DC62 for ; Fri, 12 Jun 2015 10:44:43 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [IPv6:2607:f8b0:4001:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483B31988 for ; Fri, 12 Jun 2015 10:44:43 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: by igbpi8 with SMTP id pi8so9144052igb.1 for ; Fri, 12 Jun 2015 03:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KfTufNPkw/USI98vH4IlDZW1cQOxZdxlk/xIxwGvp2w=; b=G94jnWVIierHG9EUiLbprvj4HDh7pU1ypjzbHL+YXG5eE5v3LH2eMUdTqPppYUbt/t ythze1nKh4AQG36h82cE6pZuDcM8+ENDvY47dXdGlw50YopgV/Ed8oVZ+QFQmMFjiAss 8i5ha3hNK3XrSXMvNjF1ivP42DeS7QpXPr6jxrr05eCGHWC/Yozp1E2IRs7aezjdpPkX 6OhOu4d1skPk0h072ZQeoFt4gGzYgwgJWi+mmuFDQdlxeE7FtqbJ3MjQpOfGVOMrRLsn SyzyHpvT0LZ11J/UQ3KcoxeSjuDhSvgOPagY1GvsY7Ig3e8g0q3bDxnCfax1GrOfl1S+ q6pQ== MIME-Version: 1.0 X-Received: by 10.107.7.37 with SMTP id 37mr16815906ioh.28.1434105882409; Fri, 12 Jun 2015 03:44:42 -0700 (PDT) Received: by 10.65.15.33 with HTTP; Fri, 12 Jun 2015 03:44:42 -0700 (PDT) In-Reply-To: References: <731c3f79950e679799b5f8078a5ba7f0@kathe.in> <917AE52A-45E0-42CB-A6A8-40BAAE318CC9@gmail.com> <1c5f3e6e3cafb9022d257afcce1757b3@kathe.in> <6ee4e8712a7499dd3d703e540f46059b@kathe.in> <23f251dd1a66d0a88ed041ae2593cb98@kathe.in> <6228039c427b13187bfdf347b1771b10@kathe.in> Date: Fri, 12 Jun 2015 03:44:42 -0700 Message-ID: Subject: Re: randall hyde's high level assembly! From: Mehmet Erol Sanliturk To: mayuresh@kathe.in Cc: Matthew Pherigo , FreeBSD Questions Mailing List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2015 10:44:43 -0000 On Fri, Jun 12, 2015 at 3:27 AM, Mayuresh Kathe wrote: > On 2015-06-12 15:44, Mehmet Erol Sanliturk wrote: > >> On Fri, Jun 12, 2015 at 3:02 AM, Mayuresh Kathe >> wrote: >> >> On 2015-06-12 15:11, Mehmet Erol Sanliturk wrote: >>> On Thu, Jun 11, 2015 at 11:37 PM, Mayuresh Kathe >>> >>> wrote: >>> >>> On 2015-06-12 11:24, Mehmet Erol Sanliturk wrote: >>> On Thu, Jun 11, 2015 at 10:45 PM, Mayuresh Kathe >>> >>> wrote: >>> >>> On 2015-06-12 11:04, Mehmet Erol Sanliturk wrote: >>> On Thu, Jun 11, 2015 at 9:29 PM, Mayuresh Kathe >>> wrote: >>> >>> hi matthew, >>> >>> no luck, I got the following message; >>> root@www:~ # pkg install hla >>> Updating FreeBSD repository catalogue... >>> FreeBSD repository is up-to-date. >>> All repositories are up-to-date. >>> pkg: No packages available to install matching 'hla' have been >>> found in the repositories >>> >>> `uname -a` gives me the following; >>> FreeBSD www.kathe.in [1] [1] [1] [1] 10.1-RELEASE-p10 FreeBSD >>> 10.1-RELEASE-p10 >>> #0: Wed May 13 06:54:13 UTC 2015 >>> root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC >>> amd64 >>> >>> `freebsd-version` gives me the following; >>> 10.1-RELEASE-p11 >>> >>> anything i might be doing wrong? >>> >>> ~mayuresh >>> >>> On 2015-06-12 09:26, Matthew Pherigo wrote: >>> Hey Mayuresh, >>> >>> There's actually a port in the tree already! 'pkg install hla' >>> >>> --Matt >>> >>> On Jun 11, 2015, at 5:52 AM, Mayuresh Kathe >>> wrote: >>> >>> has anyone been successful at working with randall hyde's high >>> level assembly toolkit under freebsd 10.x? >>> http://www.plantation-productions.com/Webster/ [2] [2] [2] [2] >>> claims >>> to >>> have a >>> pre-built archive, but one that fails to assemble the binaries. :( >>> >>> ~mayuresh >>> >>> _______________________________________________ >>> >>> Is hla able to generate 64-bit machine code for amd64 ? >>> >>> It seems that it is for 32-bits , i.e. i386 . >>> >>> i have been able to run and test 'hla' under amd64 systems running >>> ubuntu. >>> any particular reason why it will not run under freebsd 64-bit? >>> one of the things that could be a problem might be the "assembler" >>> itself, i couldn't find "gas" or an equivalent under freebsd. >>> >>> ~mayuresh >>> >>> Can you use Nasm ? >>> >>> CD /USR/PORTS/DEVEL/NASM >>> MAKE INSTALL >>> >>> http://forum.nasm.us/index.php?topic=3D1283.0 [3] [3] [3] >>> >>> thanks for that tip mehmet, much appreciate it. >>> >>> i hadn't known about "nasm", looking it up led me to a book on >>> assembly language programming by jeff duntemann, which seems to be >>> a >>> lot more realistic than the one by randall hyde. >>> >>> again, thanks a million mehmet. :) >>> >>> ~mayuresh >>> >>> 64 bits operating systems are different from 32 bits operating >>> systems >>> . >>> >>> During working with assemblers , it is necessary to distinguish >>> this >>> feature . >>> >>> In a 64 bits operating system , if 32 bits programs will be used , >>> it >>> is necessary to have 32 bits libraries and support by the operating >>> system . >>> >>> This means that you can not execute 32 bits programs in a 64 bits >>> operating system without such support . >>> >>> In the following page : >>> >>> http://www.duntemann.com/assembly.html [4] [4] >>> >>> read >>> >>> "If You Have a 64-Bit PC..." >>> >>> the especially . >>> >>> "64-Bit PC" is misleading : It should be "64-Bit Operating System" >>> . >>> >>> Both Intel and AMD x86 processors mainly support both 32 and 64 bit >>> operating systems : They are able to execute 32 and 64 bit >>> instructions . >>> >>> Therefore , important points are bit size of ( 32 or 64 ) operating >>> system , and handling capability of this feature by compilers and >>> availability of libraries , and support by the operating system . >>> >>> It is necessary to have information about 64 bit assembly >>> programming >>> in an 64 bit operating system . >>> >>> >>> >> http://www.amazon.com/Introduction-Intel-Assembly-Language-Programming/d= p/1478119209/ref=3Dpd_sim_14_1?ie=3DUTF8&refRID=3D15NZ1SBWCZAMH1X6KPZG >> >>> [5] >>> [5] >>> >>> Introduction to 64 Bit Intel Assembly Language Programming for >>> Linux: >>> Second Edition Paperback =E2=80=93 June 23, 2012 >>> by Benjamin Ray Seyfarth (Author) >>> >> >> mehmet, thanks for the link to that book by benjamin ray seyfarth. >> >> my objective for learning assembly was to understand the inner >> workings of the machine, but i guess that could get accomplished with >> a good understanding of "machine organization". >> >> randall hyde's "write great code (vol 1)" is an excellent book on >> "machine organization", just that one of the languages used for >> example code is 'hla' and hence my inquiry into support for running >> 'hla' under freebsd. >> >> best, >> >> ~mayuresh >> >> Using a widely adopted and supported by a community assembler such as >> "nasm" is much better than using a special purpose assembler ( for me >> with very useless statement kinds ) such as "hla" is a better approach >> when portability and maintainability of written sources over time is >> considered . >> >> I have look at the "hla" many times and come to a conclusion "never >> use it" . >> >> If a high level language is required , "C" may be used . >> > > yes, agreed about the impractical nature of 'hla', but for me, it's an > educational tool, just like scheme. > i am yet to see a lot of large industrial grade software applications > written in scheme, except perhaps "emacs". ;) > btw, how did you get 'hla' to work under freebsd? was it under the 10.x > series? > > ~mayuresh > > I never use assembly programming . For a 64 bit code generation program I will use "nasm" . Even as an educational tool , do not waste your time and efforts by using "hla" . Select "nasm" if you need to use an assembler exactly and use "C" as much as possible for low level hardware programming . Always use "Standard" definitions for programming languages , avoid "extensions" and "modifications" just like escaping from a very dangerous poisonous snake . Over time , all of such "extensions" will be a very difficult to rescue yourself "nightmare" . Thank you very much . Mehmet Erol Sanliturk