954,479 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

TASM to NASM!!!

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

;sum=b1+b2+b3
.model small
.stack 100h
.data
   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 ?     

.code
   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
end
ravi89
Junior Poster
114 posts since Jun 2009
Reputation Points: 11
Solved Threads: 13
 

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.

GunnerInc
xor eax, eax
Team Colleague
79 posts since Jan 2011
Reputation Points: 38
Solved Threads: 13
 

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!

ravi89
Junior Poster
114 posts since Jun 2009
Reputation Points: 11
Solved Threads: 13
 

I solved the problem by just using 'Wine'+'8086 emulator'.

ravi89
Junior Poster
114 posts since Jun 2009
Reputation Points: 11
Solved Threads: 13
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: