There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot browser bsod computer cpu crash css dell desktop driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware missing monitor network networking outlook outlook 2003 outlook 2007 outlook express password popups problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Learning Assembler


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
pawitter's Avatar
Junior Member with 3 posts.
 
Join Date: Jan 2005
Experience: Computer Illiterate
27-Jan-2005, 05:51 PM #1
Learning Assembler
Hello,
I have been a MAINFRAME assembler programmer for quite a few years and I have decided to learn how to code in assembler on the PC. I have downloaded a free compiler / linker (GoAsm) and read a few notes on PC assembler. Different tutorials seem to present different commands which I find odd as I would have thought that assembler is assembler. For example, one of the commands shown is MOV DX, SEG myvariable. However, the compiler throws this out. Therefore, I have created my first PC assembler pgm which crashes my PC faster than ever before. Great. Can anyone give me any resons why.... ?
Code:
.DATA 
FirstString DB "Is this a great pgm$" 
;
.CODE 
START:
LEA DX, FirstString              ;offset from current segment         
MOV AH, 9	     	;VALUE OF 9h in AH for 'write to screen'	
INT 21h			;call dos
MOV AX, 4C00h		;parm 4c for 'return from dos' 
INT 21h			;call dos 
RET
Shadow2531's Avatar
Distinguished Member with 2,629 posts.
 
Join Date: Apr 2001
27-Jan-2005, 11:47 PM #2
Try Nasm. I don't know assembly much at all, but Nasm has been the easiest to mess with.

hello.asm
Code:
org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
msg db 'Hello, World!',0Dh,0Ah,'$'
nasm hello.asm -o hello.exe

That produces a 27 Byte Hello World com file. (with an exe extension).
IMM's Avatar
IMM IMM is offline
Distinguished Member with 3,156 posts.
 
Join Date: Feb 2002
28-Jan-2005, 02:17 AM #3
Never seen that assembler.
What's the memory model in what you wrote ?
If you write 8086/88 code using the 16 bit registers such as dx rather than the later processors with 32 bit registers like edx - you'll have to watch near vs. far etc. for where you place segments.
There should be .processor directive available in that one ?

Here's a start (good windows pdf or chm book)
http://webster.cs.ucr.edu/AoA/Windows/
or this one has a link to 16 bit editions and a variety of assemblers
http://webster.cs.ucr.edu/AoA/

-------
I guess I didn't ask how ASSUME was used to set sections - eg:
assume ds:DATA
to use constructs like lea dx,ds:[whatever] but you will figure out the register pairs for addresses when you look at the memory models.

You're REALLY going to enjoy differing register widths and leaving flat memory behind for this segmented architecture :-)

Last edited by IMM : 28-Jan-2005 07:26 AM.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:12 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.