are you sure nasm and masm are different? i know nasm uses intel syntax and i thought masm did too. oh well. and your right gcc by default uses at&t syntax, but i think that can be switched, and if it cant it only applies to the asm keyword. i learned from the dr. paul carter website that you can assemble an asm file then compile it with a c file using gcc
Yes, I am sure that NASM and MASM are different. Here is an example:
MASM Syntax:
test db 12h
mov dx, offset test
; MASM requires the "offset" keyword here, due to
; this being 16-bit address
mov al, test
; MASM remembers variable types
NASM Syntax:
test db 12h
mov dx, test
; 32 bit address so its fine
mov al, byte [test]
; need to specify the size of the move, as well as
; that you are moving the contents of "test"
@a k n maybe I am misunderstanding you, though processor state is saved by the OS scheduler upon jumping between different user mode programs. The user shouldn't be concerned about manipulating different registers since the compiler is a seperate running process. Its data would be restored upon resuming execution.
ok so i have Masm32 editor on my computer, so which editor has the easiest syntax to understand? also would making a side scroller in asm be easier than C++?
I downloaded Nasm but its just a cmd promp i dont know what to do.
also why do they use so much different syntax? you would think that all computers having the same assembly code would make it easier to find devs for.
Yep you got it a little wrong ,
i am talking about behaving with the compiler and not the OS , if you are going to mess up a register inside inline assembly then you got to restore it too by either saving them on the stack and manually restoring them or by specifying what registers you are going to mess up (more info on the HOWTO i gave).
@nt
I'm pretty sure the MASM uses the intel syntax just like NASM , what's different is microsoft added some extra stuff making simpler things complicated . except the "macro" and "preprocessor" stuff the syntax is pretty similar.
For the record , gas (gnu assembler) uses the AT&T syntax by default which you can change with a directive.
ya its there but it says it cant open it for some reason. My assembly file is on my desktop does that matter? so i need to add any variables to the enviornment path?
I tried running a sample program and that worked fine. but my program wont run, i click Project>run program and nothing happens
ok i just copied some other code in and it works now but my cmd window just flashes and i cant see the message, whats the assembly version of cin.get()?