Hi, I'm a student in a CIS 335 class, Assembly language programming for intel based computers.  I have a Macbook pro and it has suited me well for programming...until now.  All of the software that comes with our book is Windows based and, though I have Vista installed too, I would like to know if there are Mac equivalents for assembly, linking and debugging.  I tried using my usual editor, Emacs, which has support for .asm files, but I don't know how to compile them.  If anyone has compiled, linked and debugged .asm files on an Intel-based Mac, can you please let me know how and what programs you used?
Thank you in advance.
zhespelt@gmail.com

//================== assign1.asm =====================
.model small
.stack 100h

.data
area1  dw    0123h
area2  db    -7

      .code
prog1: mov    ax,@data
      mov    ds,ax      ;set ds to point to data segment
      mov    ax,area1
      add    ax,00cah  ;immediate data
      mov    bl,area2
      mov    bh,07h
      add    bx,ax
      mov    cx,bx
      sub    bh,area2
      sub    cx,ax
      mov    ah,4ch    ;exit program
      int    21h
      end    prog1

//================== terminal output using 'as' =============
$ as assign1.asm
assign1.asm:1:Unknown pseudo-op: .model
assign1.asm:1:Rest of line ignored. 1st junk character valued 115 (s).
assign1.asm:2:Unknown pseudo-op: .stack
assign1.asm:2:Rest of line ignored. 1st junk character valued 49 (1).
assign1.asm:5:no such instruction: `area1 dw 0123h'
assign1.asm:6:no such instruction: `area2 db -7'
assign1.asm:8:Unknown pseudo-op: .code
assign1.asm:9:invalid char '@' beginning operand 2 `@data'
assign1.asm:10:too many memory references for `mov'
assign1.asm:10:no such instruction: `set ds topointtodatasegment'
assign1.asm:11:too many memory references for `mov'
assign1.asm:12:too many memory references for `add'
assign1.asm:12:no such instruction: `immediate data'
assign1.asm:13:too many memory references for `mov'
assign1.asm:14:too many memory references for `mov'
assign1.asm:15:too many memory references for `add'
assign1.asm:16:too many memory references for `mov'
assign1.asm:17:too many memory references for `sub'
assign1.asm:18:too many memory references for `sub'
assign1.asm:19:too many memory references for `mov'
assign1.asm:19:no such instruction: `exit program'
assign1.asm:20:junk `h' after expression
assign1.asm:20:suffix or operands invalid for `int'
assign1.asm:21:no such instruction: `end prog1'
$
//================== end =============
Posted on 2008-05-21 15:56:37 by zhespelt
It looks like you are attempting to assembly MASM (Intel Syntax) code through GAS (AT&T Syntax).

You can change GAS to accept Intel Syntax, but you'd probably want to use something that is more appropriate, such as NASM.
Posted on 2008-05-21 19:08:04 by SpooK
Posted on 2008-05-21 19:53:58 by SpooK
Another option is to run your Windows in VMWare Fusion or Parallels. This way you can actually try Win32 programming as well if you have any interest in it.

What I personally do is basically have Windows running in text mode (cmd) in a small window on OS X Leopard desktop. So I can run assembly code written for DOS/Windows.

Worked quite well for me.
Posted on 2008-05-22 14:11:26 by timojaask