Re: debug and the newbe



On Aug 28, 5:28 pm, "Jean Pierre Daviau" <O...@xxxxxxxxxx> wrote:
"SpooK" <ke...@xxxxxxxxxxx> a écrit dans le message de news:
1188322687.526706.115...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On Aug 28, 12:29 pm, "Jean Pierre Daviau" <O...@xxxxxxxxxx>
wrote:
Hi everybody,

Please tell me whats wrong with that small dot com
----
-a 100
0DF1:0100 mov ah,09
0DF1:0102 mov dx, 107
0DF1:0105 int 21
0DF1:0107 "Allo"

Using that Interrupt function requires the string to be
terminated
with $. Also, it looks like your program will crash since there
is no
means to exit the program and the program flows directly into
the
data. Here is a more appropriate example, written in NASM.

ORG 0x100
[BITS 16]

;Print the String
mov ah,9
mov dx,MSG
int 0x21

;Exit to DOS
mov ax,0x4C00
int 0x21

;The Message to Print
MSG DB 'Allo$'

Assemble this example with NASM using the flat binary format
(-f bin)
and make sure it assembled file has the .com extension.

for sure this worked. Does it means I should use nasm already?

If you want. It is probably your best bet if you want to continue
doing some 16-bit development, there are plenty of 16-bit NASM
examples spread out throughout the internet, namely in the operating
system (boot-sector) development arena.

What is the meaning of 4C00 ?

But I was trying debug . . .
-a 100
0D65:0100 mov ax,9
0D65:0103 mov ax,120
0D65:0106 int 21
0D65:0108 mov ax, 4c00
0D65:010B int 21
0D65:010D int 20
f 010d 0119 90
-e 120 "Allo$"
-a 128
0D65:0120 jnz 108
0D65:0126 int 20
f 0126 0130 90

n huh.com
r ax:
60
w

Well, it shows that you are using both INT 0x21, Function 0x4C and INT
0x20. INT 0x20 is the legacy "exit" function for the original MS-DOS
and, AFAIK, it offers no return code. INT 0x21, Function 0x4C is the
same mechanism, except the return code that is provided in AL is
returned. In this case, AL is set to zero and that returns a code of
zero... a general indication of program success. If you do not need to
use return codes, then simply use INT 0x20.

I suggest sticking your head in http://www.ctyme.com/rbrown.htm and
learning what the BIOS/DOS (i.e. Real Mode) interrupts do.

It also seems that you are generally unaware of assembly language
programming basics. Go ahead and start reading the AoA 16-bit DOS
Edition found at http://webster.cs.ucr.edu/AoA/DOS/index.html

.



Relevant Pages

  • Re: newbie questions
    ... MOV AH,4EH; ... instruction operands must be the same size" this error is in line " INT 21H", because it points everything whats after mov dx, offset mask. ... X86 addresses *always* involve a segment register, ... The examples in your book will need some alteration to work with Nasm. ...
    (alt.lang.asm)
  • Re: CSpinButtonCtrl, CTabCtrl transparent oder im Edelstahllook ?
    ... einen Transparent Blit, kann mit der GDI nur über umwegen erreichen, ... TransparentBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, ... mov edi, CDraw.m_pTmp ...
    (microsoft.public.de.vc)
  • Re: questions from a newbie
    ... Nobody has given me reasons to use as, nasm, or others and why. ... O_DIRECTORY equ 00200000Q ... mov ebx,texmfdir ... int 80h ...
    (alt.lang.asm)
  • [NT] Multiple Windows XP Kernel Vulnerability Allow User Mode Programs To Gain Kernel Privileges
    ... Kernel Privileges ... entry with a pointer to your code and execute an INT n instruction. ... DWORD NotUsed; // Never accessed by the kernel ... mov ecx,esp ...
    (Securiteam)
  • Re: Disassembler questions
    ... I have been recently trying to see how some simple c programs translate ... int main{ ... mov edx,len ... nasm is adding padding to the end of the section. ...
    (comp.lang.asm.x86)