I'm Starting DEBUG (Assembly) Tutorials

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nitt
Posts: 218
Joined: 22 Apr 2011 02:43

I'm Starting DEBUG (Assembly) Tutorials

#1 Post by nitt » 03 Sep 2011 17:51

The DEBUG command has to be one of the neatest commands ever to be on computers. Sadly, it's 16bit, so it's not on 64bit computers. And they never wrote a 32bit version, Microsoft just decided to drop it.

The first tutorial is here:
http://www.youtube.com/watch?v=mWeh3_ITG7M

The tutorials planned to be maid so far are:

Assembly Tutorial 1 - Introduction And Data Storage
Assembly Tutorial 2 - Hello, World!
Assembly Tutorial 3 - Pause Until Key Press
Assembly Tutorial 4 - Retrieving User Key Press
Assembly Tutorial 5 - Writing An Assembly File For DEBUG
Assembly Tutorial 6 - Getting User Input
Assembly Tutorial 7 - Adding And Subtracting Registers
Assembly Tutorial 8 - More On Jumps
Assembly Tutorial 9 - Clearing The Screen
Assembly Tutorial 10 - Tagging Dollar Signs On Strings
Assembly Tutorial 11 - Command Line Arguments
Assembly Tutorial 12 - Creating/Deleting Files
Assembly Tutorial 13 - Reading/Writing Files
Assembly Tutorial 14 - Creating/Deleting Folders
Assembly Tutorial 15 - Changing The Console Color
Assembly Tutorial 16 - Displaying Console-Space Pixels
Assembly Tutorial 17 - Cursor Positioning
{and more to come}

I've finished about half of these, so far. And on Monday I think I'll do a couple more.


Here is an example of using DEBUG:

1. Open notepad
2. Copy and paste in this code:

Code: Select all

a 100
mov si, 0
mov ah, 09
mov dx, 300
int 21
mov ah, 3f
mov dx, 200
int 21
jmp 120

a 120
mov cl, [200+si]
cmp cl, 20
jl 160
add si, 1
jmp 120

a 160
mov byte [200+si], 24
mov ah, 09
mov dx, 320
int 21
mov ah, 09
mov dx, 200
int 21
mov ah, 02
mov dl, 21
int 21
mov ah, 02
mov dl, 0d
int 21
mov ah, 02
mov dl, 0a
int 21
mov ah, 09
mov dx, 340
int 21
mov ah, 08
int 21
int 20

a 200

a 300
db 'What is your name: $'

a 320
db 'Hello, $'

a 340
db 'Press any key to continue . . .$'

rcx
399
n hello.com
w
quit




3. Save the file to your desktop as "hello.asm"
4. Open up the Command Prompt
5. Type in "cd desktop" and press enter
6. Type in "debug < hello.asm" and press enter
7. DONE!

Now just look at your desktop, and you should see a "HELLO.COM" file on your Desktop. Double click it, and see something like this:

Code: Select all

What is your name: john
Hello, john!
Press any key to continue . . .



You may think this code looks extremely difficult. Well, actually, it's not. That's why I'm starting these tutorials, so people can learn Assembly and how to use the DEBUG command to write COM files.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: I'm Starting DEBUG (Assembly) Tutorials

#2 Post by Ed Dyreen » 04 Sep 2011 10:27

'
Do you have these tutorials as documents ?
I'd like to save them on my pc otherwise they are pretty useless as I tend to forget rapidly.
It's a lot easier to browse and search documents than youtubes, they are also a lot smaller.

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

Re: I'm Starting DEBUG (Assembly) Tutorials

#3 Post by nitt » 04 Sep 2011 20:57

Ed Dyreen wrote:'
Do you have these tutorials as documents ?
I'd like to save them on my pc otherwise they are pretty useless as I tend to forget rapidly.
It's a lot easier to browse and search documents than youtubes, they are also a lot smaller.


Take notes.

Post Reply