Member Avatar for b1izzard

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

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.

Member Avatar for b1izzard

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!

Member Avatar for b1izzard

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

hi please help I'm having proble with my program, I'm using GUI Turbo Assembler

here is the code:

;define the INFO data structure
;

INFO STRUC

NAMES DB 32 dup(?) ;reserve 32 bytes for a name
STREET DB 32 dup(?) ;reserve 32 bytes for a street address
CITY DB 16 dup(?) ;reserve 32 bytes for a city
STATE DB 2 dup(?) ;reserve 32 bytes for a state
ZIP DB 5 dup(?) ;reserve 32 bytes for a zipcode

INFO ENDS

NAME1 INFO <'Bob Smith', '123 Main Street', 'Wanda', 'OH', '44444'>
NAME2 INFO <'Steve Doe', '222 Moose Lane', 'Miller', 'PA', '18100'>
NAME3 INFO <'Jim Dover', '303 Main Street', 'Orender', 'CA', '90000'>

please help thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.