Skip to content

becauro/leap-year-asm-x86-64bits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leap-year

This small software just checks whether a given year is a leap year. I created it just for assembly x86 logical practical.

Intro

I trick a way to convert 4 bytes string input, which are contiguous hex ASCII codes put together.

Most tutorial out there just use 1 byte input ASCII number in assembly x86, but, since a year number is 4 bytes length, I had solve it by myself.

P.s: Yeah, I know I could use some C libs along; or Assembly libs (e.g Irvine, Along32), but I was interested to work on asm code ONLY on this project.

Prerequisites (...which are what I used. You mighty use whatever you wanto thought)

  • Gnu/Linux ( at least that is the OS I've used here )
  • nasm
  • ld (from binutils. It's already buit-in Gnu/Linux, however you can also use it in Windows by use MinGw framework or Cygwin)

How to build it

Once inside the project folder:

nasm -felf64 src.asm -o prog.o

ld prog.o -o prog.elf

or ... if your GNU/Linux owns the "make" tool --- most distro does --- just type:

make

How to run it

./prog.elf

===

Some suggestions ? Please, let me know ;-)

Bye !

About

Just check if a given year is a leap year

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published