Hi friends, I am a newbie to Assembly Language programming, I don't know whats the equivalent Assembly code for NASM compiler and moreover is there any compiler available for ubuntu so that I can run my TASM code as it is?

Here is my simple code that works fine in TASM

.model small
.stack 100h
   b1 db 100    ; b1=100, b1 is stored in 0 th offset of data segment
   b2 db 20     ; b2=20
   b3 db 40     ; b3=40
   sum db ?     

   MOV ax,@data
   MOV ds,ax
   MOV ah,b1    ; ah=b1 i.e ah=100
   ADD ah,b2    ; ah+=b2 i.e ah=ah+20
   ADD ah,b3    ; ah+=b3
   MOV sum,ah   ; sum=ah

Edited by b1izzard: n/a

7 Years
Discussion Span
Last Post by b1izzard

That 16bit code in the .code section will/should work with any 16bit assembler that uses Intel syntax which NASM/NASMX uses... What you need to find out is the differences in sections between TASM and NASM, and the differences in the header of the asm files. FASM works on Linux, you might want to look into that, or use GAS or something similar (EWWWW AT&T syntax), either way (FASM or NASM) you will need some modifications.


Does anyone have used 'YASM', the user manual tells that the compiler supports #TASM #NASM #GAS syntax but I am unable to use it.

Got installed NASM but dont know how to change the above program to compile without any errors!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.