Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6824573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:55:03+00:00 2026-05-26T21:55:03+00:00

I am new to Assembly, but not new to programming and how it works

  • 0

I am new to Assembly, but not new to programming and how it works in general. Because I know quite a few languages already, I decided to make my first ASM program calculate the SHA-1 hash of input files. I already have many of the separate parts worked out, but there are two parts I am having trouble with; one I will ask for help with here.

Basically, I am confused over the concepts of Big and Little endian numbers and how to represent them in ASM. To quote from the SHA-1 Psuedocode:

append length of message (before pre-processing), in bits, 
as 64-bit big-endian integer

The only things that come to mind is to, for example represent the number 1 as:

[63 0's]1

Or

1[63 0's]

Or

[31 0's] 1 [32 0's]

Basically my thought so far is basically:

mov    eax,  message ;Move message to be hashed into eax
shl    eax,  64      ;Shift message over enough bits to store 64-bits
or     eax,  msglen  ;Adds message length to the very end of message

This is most likely wrong, as this all uses 32-bit registers therefore shifting left 64-bits would create a huge overflow but that is just another problem I have yet to work out.

I think I’ve gone way off track, but basically my question is is the above code a correct way to append a big-endian integer? Or do I have it backwards, or am I just completely off on everything, etc. Not sure if this makes sense, too tired.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:55:04+00:00Added an answer on May 26, 2026 at 9:55 pm

    The binary representation of the number 1 as a big-endian 64-bit integer is

    <- Start of message                                   End of message ->
    
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
    
    ^ big (most significant) end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to Objective-C, Cocoa, and compiled languages in general so forgive my ignorance: UIImage
I am completely new to web services, but not new to Delphi. I am
I'm kinda new to WPF and .Net programming in general. I have downloaded this
I started assembly (nasm) programming not too long ago. Now I made a C
I'm new to programming in any sort of assembly, and since I've heard that
Our codebase where I work is .NET 2.0. For our new assembly/DLLs/web applications I
I am relatively new to assembly language. I have found so many tutorials that
Hello I am new to assembly and I'm struggling to get a two-part program
I'm new here same as I'm new with assembly. I hope that you can
string exeFile = (new System.Uri(Assembly.GetEntryAssembly().CodeBase)).AbsolutePath; string exeDir = Path.GetDirectoryName(exeFile); string fileName = Path.Combine(exeDir, @..\..\xml\SalesOrderXMLData.csv.xml);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.