Ok, I'm pretty sure this is a 16-bit code, but I am a problem finding a debugger that would debug this .asm code
I am currently taking an assembly language class with a lazy prof. who suggest us to program in .com and our code  should something like this

cseg segement byte "code"
assume cs:cseg
org 100h
.
.
.
.
cseg ends


Worst of all, only instruction class was given was to google our questions, and since Assembly language isn't that popular, it's been hell trying to find a easy to understand tutorial page or find one at all.

which debugger out there that would output the result line by line like how the book explains it, such as: mov ah, 12...etc, so i can start programming my mid-term assignment.

BTW, i'm trying to teach myself with the text assembly language for intel base comp by kip Irvine.
Posted on 2007-03-17 23:18:15 by goldy
which debugger out there that would output the result line by line like how the book explains it, such as: mov ah, 12...

debug.exe

Or maybe you mean a disassembler? Like IDA?
Posted on 2007-03-18 00:11:46 by sinsi
Yes, I'd recommend the free version of IDAPRO - debugger is just one feature of this application.

debug.exe is quite ugly and primitive.
Posted on 2007-03-18 00:51:26 by Homer
Hrm, I don't think the free versions has the debugger? And the debugger is 32-bit only afaik, anyway.

I'm not sure if there's any free 16-bit debuggers around that are much better than debug.com - LADsoft GRDB is a step up, but unless a lot has happened since I last played with it, there's still a lot of stuff missing before it's nice-and-cuddly.
Posted on 2007-03-18 10:57:14 by f0dder
Thanks, im pretty sure that is what I will need. Now Is there a program that would assemble/link an .asm into a .com or .exe file? I try doing that with cmd. But, could get it to do it. Maybe anyone could direct me to a tutorial on that?
Posted on 2007-03-18 11:13:26 by goldy
There's plenty of assemblers around :) - the question is whether your professor expects you to use a specific one, and will fail you if your .asm doesn't build with that assembler.

Imho the best suited assembler for doing .com development would be one of {fasm, yasm, nasm} , since they're all free, don't have weird license agreements, and can output directly without needing a linker. The traditional assemblers to use for a assembly course would be TASM or MASM, but tasm is all-but-dead and masm either comes as a "free" version with a not-so-acceptable license, or you pay big $ for Visual Studio to get an unrestricted version.
Posted on 2007-03-18 11:23:41 by f0dder
Does the lot in one package, and is pure 16 bit malt made from organic DOS hops.

16bit integrated
Assembler
Debugger
Interpreter

http://www.btinternet.com/~btketman/

I'm going to have to change my name to ketmanspammerman at this rate.
:D
Posted on 2007-03-18 11:24:08 by eek

I'm going to have to change my name to ketmanspammerman at this rate.
:D

*grin* :)

It's not free, though, is it? What limitations does the demo version have?
Posted on 2007-03-18 12:25:46 by f0dder

There's plenty of assemblers around :) - the question is whether your professor expects you to use a specific one, and will fail you if your .asm doesn't build with that assembler.

Imho the best suited assembler for doing .com development would be one of {fasm, yasm, nasm} , since they're all free, don't have weird license agreements, and can output directly without needing a linker. The traditional assemblers to use for a assembly course would be TASM or MASM, but tasm is all-but-dead and masm either comes as a "free" version with a not-so-acceptable license, or you pay big $ for Visual Studio to get an unrestricted version.



he has given us no restrictions on how we are to create a program, and I'm sure that he is not expect half of us to get a working program by the end of this month. What i'm having trouble I can't even get a .asm source code from a book to assemble to a .com. assemble a copy and paste program... how am i gonna write my own.

I don't expect him to fail anyone for not handing in a non working program, considering less than half of the students show up to class each night.

I'll getting the benefit of the doubt that as long i hand in something I'll get a C, even a non working program, but that is not what I want.
Posted on 2007-03-18 18:25:59 by goldy
You can't save your source code.

I think it is possible to save up to about five pages max unless you get the unlock program.
There's a "mystuff" bit to do that and I think it saves to a .ket file.

Otherwise it's 100% functional, you can write, debug, run stuff on the interpreter  and assemble anything a newbie would want, like .com files.

I only do asm as a hobby, I doubt if I could retain my sanity if it was a full time job.
Its been great for holding my hand along the way, especially since I only do asm intermittently.

It also runs fine on an old HP200LX I have, so I can do stuff outside...if the Sun ever decides to shine again...I'm still waiting on my share of global warming for this year...
Posted on 2007-03-18 18:37:18 by eek
ok, just downloaded Yasm, and have no idea how to get it to run. (I grew up after the DOS era).

I think i should use microsoft cmd's debug tool? that would be the easist to understand and get running, also, that is what my prof. have suggest us do.

So I understand that I have to install some kind of package in order to assemble/debug .asm through cmd?
Posted on 2007-03-18 18:42:26 by goldy
This is another one I've seen which could be useful if all you want to do is put a teeny com file together.

http://www.emu8086.com/

Posted on 2007-03-19 05:19:43 by eek

So I understand that I have to install some kind of package in order to assemble/debug .asm through cmd?

to assemble, all you need is yasm executable ("yasm-0.5.0.exe").

If you are going to do DOS coding, then just create test.asm with this content:
org 100h

;display 'x' character
mov dl, 'x'
mov ah, 2
int 21h

;end
int 20h


and compile it:
yasm.exe test.asm -o test.com
.

Then you can run test.com
Posted on 2007-03-19 09:24:44 by vid


So I understand that I have to install some kind of package in order to assemble/debug .asm through cmd?

to assemble, all you need is yasm executable ("yasm-0.5.0.exe").

If you are going to do DOS coding, then just create test.asm with this content:
org 100h

;display 'x' character
mov dl, 'x'
mov ah, 2
int 21h

;end
int 20h


and compile it:
yasm.exe test.asm -o test.com
.

Then you can run test.com


today I had time to test this out.. I tried it using the dos and 32bit compiler of yasm. Once i created the .com file and double click it and it opens the cmd and close again (as if it crashed).. something  I did wrong or something i forgot?
Posted on 2007-03-22 15:28:41 by goldy
Without an indication to wait prior to program exit... the program will exit immediately. This is the standard for DOS applications and batch files on Windows. You can override this in the program properties or by going into command/cmd.exe first and then executing.

You can also add a int16h wait routine. I recommend this one for your particular situation.
Posted on 2007-03-22 16:11:16 by SpooK

Without an indication to wait prior to program exit... the program will exit immediately. This is the standard for DOS applications and batch files on Windows. You can override this in the program properties or by going into command/cmd.exe first and then executing.

You can also add a int16h wait routine. I recommend this one for your particular situation.


ok that int 16h function kept the cmd open but nothing was display. Anyway, i though i try using yasm to compile an asm file i found on the internet which proven to work, but as i complied it I get a bunch of repeating error messages  such as "instruction expected after label", and "redefinition of 'cseg'.... and other. I was wondering if for that code i need a specific complier?
Posted on 2007-03-22 21:44:06 by goldy
It depends on the code. From your mention of "cseg", it sounds like MASM code.

Anyway, between YASM and NASM... NASM is the more proven assembler, try downloading it instead and give another go at your code.

Here is a translated example for you to try in NASM.


  ;Very important to specify 16-bit operands/addresses ;)
org 0x100

;display 'n' character
mov dl, 'n'
mov ah, 2
int 0x21

xor ax,ax
int 0x16

int 0x20


and assemble it:


nasm -f bin -o test.com test.asm


Good luck :)

PS: If you really want to have some fun... check this gem of boredom from my past. This next example fills the screen randomly and displays a message in the center. I don't recommend to run it if you are prone to epileptic seizures induced by rapidly changing color patterns :P



ORG 0x100

;Switch to VGA Mode 13 (320x200)
mov ax,0x0013
int 0x10

;Display "something"
DISPLAY:
xor ax,ax
int 0x1A
mov WORD,dx
mov bx,0xA000
mov gs,bx
xor cx,cx
.update:
pusha
mov ax,0x1301
mov bx,0x0007
mov cx,MSG.len-MSG
mov dx,0x0D04
mov bp,MSG
int 0x10
mov ax,0x0B00
int 0x21
cmp al,0
je .time
jmp Exit
.time:
xor ax,ax
int 0x1A
cmp dx,WORD
je .time
mov WORD,dx
popa
xor bx,bx
.write:
call Random
mov cx,WORD
mov BYTE,cl
inc bx
cmp bx,0xFA00
jne .write
jmp .update

;Wait for key
xor ax,ax
int 0x16
mov ax,0x0100
int 0x21

mov ax,0x0900
mov dx,CHR
int 0x21

;Restore Display to 80x25 and Exit
Exit:
mov ax,0x0002
int 0x10
mov ax,0x4C00
int 0x21

;Generate a Random Number in CL
Random:
pusha
mov ax,WORD
mov bx,WORD
mov cx,ax
mul WORD
shl cx,1
shl cx,1
shl cx,1
add ch,cl
add dx,cx
add dx,bx
shl bx,1
shl bx,1
add dx,bx
add dh,bl
mov cl,5
shl bx,cl
add ax,1
adc dx,0
mov WORD,ax
mov WORD,dx
mov bx,WORD
xor ax,ax
xchg ax,dx
div bx
xchg ax,dx
mov WORD,ax
popa
ret

MSG DB "Feel my 8-bit epileptic wrath >:@"
.len
CHR DB 0,'$'
TICK DW 0
RANGE DW 0x00FF
RANDNUM DW 0x0000
CONSTANT DW 0x8405
SEED1 DW 0
SEED2 DW 0
Posted on 2007-03-22 22:11:18 by SpooK