how i start Assembler?

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 3597 Views - Last Post: 18 June 2018 - 01:23 PM

#1 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

how i start Assembler?

Posted 01 April 2018 - 06:50 AM

i need understand what i need to know and more.
yes i have read: http://www.dreaminco...etting-started/
- it's Assembler or Assembly?
- very of them:
FASM - http://flatassembler.net/
GAS - http://www.gnu.org/software/binutils/
GoASM - http://www.godevtool.com/
HLA - http://216.92.238.133/Webster/
JWasm - http://www.japheth.de/JWasm.html
MASM32 - http://www.masm32.com/
NASM - http://www.nasm.us/
PoASM - http://www.smorgasbordet.com/pellesc/
RosASM - http://rosasm.freefo....org/portal.php
Sol_Asm - http://www.oby.ro/sol_asm/index.html
TASM - Old and outdated
yasm - http://yasm.tortall.net/

they are different one from another?
(i'm not speaking about CPU's or OS)

- i have Code Blocks how can i add i connect the Assembler to it?

Is This A Good Question/Topic? 0
  • +

Replies To: how i start Assembler?

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14867
  • View blog
  • Posts: 59,319
  • Joined: 12-June 08

Re: how i start Assembler?

Posted 01 April 2018 - 07:30 AM

Assembler is typically the compiler.
Assembly is a language. (though, of course, folk can mix and match because they are weird).

I believe you can use Codblocks as an IDE for any number of assembly compilers.
Was This Post Helpful? 1
  • +
  • -

#3 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: how i start Assembler?

Posted 01 April 2018 - 07:38 AM

but how can i use Assembler on Code Blocks?
PS: i have RadASM, but i can't compiler :(
maybe i need config more
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14867
  • View blog
  • Posts: 59,319
  • Joined: 12-June 08

Re: how i start Assembler?

Posted 01 April 2018 - 07:45 AM

Check their help files to set it up:
http://wiki.codebloc...he_build_system
or this
https://www.wikihow....NASM-on-Windows
Was This Post Helpful? 1
  • +
  • -

#5 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: how i start Assembler?

Posted 01 April 2018 - 08:24 AM

finally i add an IDE working: https://dman95.githu...SM/english.html
the problem is that i don't have 1 code that works just for print "hello world" :(
%include "io.inc"

section .text
global CMAIN
CMAIN:
    ;write your code here
    xor eax, eax
    ret
   section	.text
   global _start     ;must be declared for linker (ld)
	
_start:	            ;tells linker entry point
   mov	edx,len     ;message length
   mov	ecx,msg     ;message to write
   mov	ebx,1       ;file descriptor (stdout)
   mov	eax,4       ;system call number (sys_write)
   int	0x80        ;call kernel
	
   mov	eax,1       ;system call number (sys_exit)
   int	0x80        ;call kernel

section	.data
msg db 'Hello, world!', 0xa  ;string to be printed
len equ $ - msg     ;length of the string 

executes but nothing happens. i even tried use the CMD for see if i get the string, but nothing happens.
what you can tell me?
Was This Post Helpful? 0
  • +
  • -

#6 sepp2k   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2728
  • View blog
  • Posts: 4,369
  • Joined: 21-June 11

Re: how i start Assembler?

Posted 02 April 2018 - 07:38 AM

int 0x80 is a Linux syscall. I previously got the impression that you're using Windows, so you should replace that accordingly.
Was This Post Helpful? 1
  • +
  • -

#7 turboscrew   User is offline

  • D.I.C Lover
  • member icon

Reputation: 171
  • View blog
  • Posts: 1,107
  • Joined: 03-April 12

Re: how i start Assembler?

Posted 02 April 2018 - 10:24 AM

GAS uses AT&T syntax by default, and it's usually used in Unix/Linux systems.

Also, I think Unix/Linux environments are different from Windows environments in other ways too, like the 'main' call convention and command line parameters.

If you are working on Windows, it's better to stick with assemblers meant for Windows.
Like

Quote

global _start ;must be declared for linker (ld)


ld is the (GNU-)linker in Unix/Linux.
Was This Post Helpful? 1
  • +
  • -

#8 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: how i start Assembler?

Posted 02 April 2018 - 10:47 AM

how can i change several codes if i continue with several problems:
1 - find an IDE;
2 - the code must be compatible with Windows and IDE compiler
Was This Post Helpful? 0
  • +
  • -

#9 turboscrew   User is offline

  • D.I.C Lover
  • member icon

Reputation: 171
  • View blog
  • Posts: 1,107
  • Joined: 03-April 12

Re: how i start Assembler?

Posted 03 April 2018 - 11:59 AM

I think Code::blocks is really meant for C/C++ and Fortran and the assembly is compiled (usually) by GCC.
There are switches (I think) to make GCC to accept Intel-syntax instead of (its native) AT&T syntax, but there are some differencies:
that assembly is handled as compiled C code and run from cinit (C runtime = crt0). That changes, for instance, the command line argument handling and maybe some library call conventions. Also, GCC may optimize the assembly you have written, since it thinks it's really compiling C-code.

I'd suggest you should go with MASM32 (oldish), NASM or FASM. I think they are most popular, and there are a lot more information available, if you run into problems. With "official Windows way" there are problems, because Microsoft has pretty much dropped the support for even C, not to mention assembly.

I guess MS still uses MASM under the hood of their C toolchain (that still can be used, but needs to be installed separately - I vaguely recall). To my understanding (I may be wrong), their currently supported languages are bytecode-compiled and executed by the virtual bytecode machine embedded within .NET.
Was This Post Helpful? 1
  • +
  • -

#10 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: how i start Assembler?

Posted 03 April 2018 - 01:06 PM

i'm so sorry been dummy, but i really need more help:
- can you give me a link for an Assembly with IDE?(for windows)
normaly i found the things, but i'm lost :(
Was This Post Helpful? 0
  • +
  • -

#11 turboscrew   User is offline

  • D.I.C Lover
  • member icon

Reputation: 171
  • View blog
  • Posts: 1,107
  • Joined: 03-April 12

Re: how i start Assembler?

Posted 07 April 2018 - 11:53 AM

Something like these...?

http://www.visualmasm.com/
http://fresh.flatassembler.net/
Was This Post Helpful? 1
  • +
  • -

#12 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: how i start Assembler?

Posted 07 April 2018 - 12:14 PM

thank you so much.
these tutorial: https://www.tutorial...asic_syntax.htm
is for Windows or Linux?
Was This Post Helpful? 0
  • +
  • -

#13 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: how i start Assembler?

Posted 07 April 2018 - 12:47 PM

i'm tired getting programs and tutorials incompatibles :(
Was This Post Helpful? 0
  • +
  • -

#14 sepp2k   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2728
  • View blog
  • Posts: 4,369
  • Joined: 21-June 11

Re: how i start Assembler?

Posted 07 April 2018 - 03:33 PM

If you look at the "Local Environment Setup" section of that tutorial, you'll see that it lists "A copy of Linux operating system" as one of the requirements. Plus it uses int 0x80, which, as I said, is a Linux (as well as other Unix-likes, I think) syscall, so it's not going to work on Windows.

After some googling, I've found this tutorial/book. I dion't know how good it is, but it specifically mentions Windows, so it should at least work for you.
Was This Post Helpful? 1
  • +
  • -

#15 Cambalinho   User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 762
  • Joined: 04-March 12

Re: how i start Assembler?

Posted 07 April 2018 - 03:41 PM

thank you so much for all
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2