Hello All!
I am learning C++ about year now, but I want to start learning assembly! I'm using Linux and I have nasm compiler! Does anyone know any newbie friendly tutorial on assembler? Thank you!
Does anyone know assembly? newbie here!
Re:Does anyone know assembly? newbie here!
Every good solution is obvious once you've found it.
Thank you!
Thank you very much!
But I have try to compile some asm example source code with nasm, but nasm shows me errors:
h.asm:3: error: label or instruction expected at start of line
code:
#MAKE_COM# ; instruct compiler to make COM file.
ORG 100h ; directive required for a COM program.
MOV AX, 0B800h ; set AX to hexadecimal value of B800h.
MOV DS, AX ; copy value of AX to DS.
MOV CL, 'A' ; set CL to ASCII code of 'A', it is 41h.
MOV CH, 01011111b ; set CH to binary value.
MOV BX, 15Eh ; set BX to 15Eh.
MOV [BX], CX ; copy contents of CX to memory at B800:015E
RET ; returns to operating system.
Doesn't diferent assamlers have a litle different syntax? thank you!
But I have try to compile some asm example source code with nasm, but nasm shows me errors:
h.asm:3: error: label or instruction expected at start of line
code:
#MAKE_COM# ; instruct compiler to make COM file.
ORG 100h ; directive required for a COM program.
MOV AX, 0B800h ; set AX to hexadecimal value of B800h.
MOV DS, AX ; copy value of AX to DS.
MOV CL, 'A' ; set CL to ASCII code of 'A', it is 41h.
MOV CH, 01011111b ; set CH to binary value.
MOV BX, 15Eh ; set BX to 15Eh.
MOV [BX], CX ; copy contents of CX to memory at B800:015E
RET ; returns to operating system.
Doesn't diferent assamlers have a litle different syntax? thank you!
Re:Does anyone know assembly? newbie here!
You need to add a label to the beginining of your code for nasm to compile your assembly language source.
Code: Select all
ORG 100h ; directive required for a COM program.
begin:
MOV AX, 0B800h ; set AX to hexadecimal value of B800h.
MOV DS, AX ; copy value of AX to DS.
MOV CL, 'A' ; set CL to ASCII code of 'A', it is 41h.
MOV CH, 01011111b ; set CH to binary value.
MOV BX, 15Eh ; set BX to 15Eh.
MOV [BX], CX ; copy contents of CX to memory at B800:015E
RET ; returns to operating system.
Yes, they do.Doesn't diferent assamlers have a litle different syntax? thank you!