Page 1 of 1
Does anyone know assembly? newbie here!
Posted: Fri Nov 12, 2004 5:35 am
by yosuke
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!
Re:Does anyone know assembly? newbie here!
Posted: Fri Nov 12, 2004 5:53 am
by Solar
Thank you!
Posted: Fri Nov 12, 2004 6:36 am
by Yosuke
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!
Re:Does anyone know assembly? newbie here!
Posted: Fri Nov 12, 2004 10:10 am
by beyondsociety
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.
Doesn't diferent assamlers have a litle different syntax? thank you!
Yes, they do.