Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Defining an array under Dos debug

Zorro26Zorro26 Member Posts: 22
Hi,

Is there any way of defining an array inside Dos debug ?
I know you can code assembly language but how to define an array ?
Thanks in advance.

Comments

  • BretBret Member Posts: 114
    DEBUG can be used as a "quick and dirty" Assembler, but if I were doing anything very complicated (like anything with Arrays), I wouldn't use DEBUG. It would just get way too confusing, and mistakes are difficult to locate and fix.

    I would use a "real" Assembler (MASM, NASM, FASM, A86, etc.), and would probably set up the array using STRUCtures. It's possible that at least one of the Assemblers actually has some sort of multi-dimensional Array structure built into it already, but I don't think so.
  • m34tb34tm34tb34t Member Posts: 25
    at the debug prompt you can use 'F'
    Fill "F range list"

    for example "F cs:100 200 1 2 3 4"
    fills 256 bytes from cs:100 to cs:200 to the pattern 1,2,3,4 (4 bytes)

    debug also supports the DB DW commands when entering assembly code

    for example:
    [code]
    A 100
    ASM MOV AX,ABCD"
    DB 'This is a string',0,'$'
    DW 1,2,3,4,5,6,7,8
    [/code]

    but you must manually keep track of all the offsets...

    you can also write code in the form of a debug script and compile it by piping it into debug like:

    "debug < myscript.whatever"

    remember to set the name with 'N' and use RCX to set CX to the size to write before using 'W' to write and 'Q' to quit in your script...
    [code]
    A 100
    MOV AH,4C
    INT 21

    RCX
    4
    N EXITONLY.COM
    W
    Q
    [/code]
    you must have the blank line in the script before RCX to exit assembly mode...

    debug can be fun but for anything serious I say FASM/NASM....
Sign In or Register to comment.