9

Вопрос по assembly, x86, nasm – undefined

Error: User Rate Limit Exceeded

  • I don't seem to be able to assign the pathname to a valid register(Or maybe incorrect syntax)

  • I need to be able to execute the other program after the first one (could be either) started its execution.

Error: User Rate Limit Exceeded

mov ax,cs ; moving code segment to data segment
mov ds,ax

mov ah,1h ; here I read from keyboard
int 21h
mov dl,al

cmp al,'1' ; if 1 jump to LOADRUN1 
JE LOADRUN1 

cmp al,'2' ; if 2 jump to LOADRUN2 
JE LOADRUN2

LOADRUN1:
    MOV AH,4BH
    MOV AL,00
    LEA DX,[PROGNAME1] ; Not sure if it works
    INT 21H


LOADRUN2:
    MOV AH,4BH
    MOV AL,00
    LEA DX,[PROGNAME2] ; Not sure if it works
    INT 21H

; Here I define the bytes containing the pathnames
PROGNAME1 db 'C:\Users\Usuario\NASM\Adding.exe',0 
PROGNAME2 db 'C:\Users\Usuario\NASM\Substracting.exe',0

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

  • Is not an overlay.
  • I'm using NASM 16 bits, Windows 7 32 bits.
  • Error: User Rate Limit Exceeded

    от Jean Carlos Suárez Marranzini
  • Error: User Rate Limit Exceededcan'tError: User Rate Limit ExceededliterallyError: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от Jean Carlos Suárez Marranzini
  • Error: User Rate Limit Exceeded

    от Jean Carlos Suárez Marranzini
  • Error: User Rate Limit Exceeded

    от
  • Error: User Rate Limit Exceeded

    от Jean Carlos Suárez Marranzini
  • Error: User Rate Limit Exceeded

    от Jean Carlos Suárez Marranzini
  • Error: User Rate Limit Exceededint 21hError: User Rate Limit ExceededabsolutelyError: User Rate Limit Exceeded

    от Daniel Kamil Kozar
  • Error: User Rate Limit Exceeded

    от Jean Carlos Suárez Marranzini
  • 7

    Error: User Rate Limit Exceeded

    need

    100h

    org 100h
    
    section .data
    exename db "C:\hello.com",0
    exename2 db "C:\nasm\nasm.exe",0
    cmdline db 0,0dh
    

    org100hexenameexename2cmdlinedb 0,0dh-h -x 3db 8," -h -x 3",0dh

    dummy times 20 db 0
    
    paramblock dw 0
    dw cmdline
    dw 0 ; cmdline_seg
    dw dummy ; fcb1
    dw 0 ; fcb1_seg
    dw dummy ; fcb2
    dw 0 ; fcb2_seg
    

    dummyparamblockcmdlinedummy

    section .text
    entry:
        mov     ax,             cs
        mov     [paramblock+4], ax
        mov     [paramblock+8], ax
        mov     [paramblock+12],ax
    

    paramblockCS = DS = ES = SScs

    mov     ax, 4a00h
    mov     bx, 50
    int     21h
    

    No memory availableAH=4AhbxESCS

        mov     ax, 0100h
        int     21h
        cmp     al, '1'
        je      .prog1
        cmp     al, '2'
        je      .prog2
        jmp     .end
    
    .prog1:
        mov     dx, exename
        jmp     .exec
    
    .prog2:
        mov     dx, exename2
    

    DX

    .exec:
        mov     bx, paramblock
        mov     ax, 4b00h
        int     21h
    

    EXECAH=4BhALDS:DXES:BXparamblockEXEC

    .end:
        mov     ax,     4c00h
        int     21h
    

    execAH=4Ch

    vulture-

  • 4

    Error: User Rate Limit Exceeded

    Format of EXEC parameter block for AL=00h,01h,04h:
    
    Offset  Size    Description     (Table 01590)
    00h    WORD    segment of environment to copy for child process (copy caller's
    environment if 0000h)
    02h    DWORD   pointer to command tail to be copied into child's PSP
    06h    DWORD   pointer to first FCB to be copied into child's PSP
    0Ah    DWORD   pointer to second FCB to be copied into child's PSP
    0Eh    DWORD   (AL=01h) will hold subprogram's initial SS:SP on return
    12h    DWORD   (AL=01h) will hold entry point (CS:IP) on return
    

    <pre>/</pre>

    You will have to set up such a parameter block and point ES:BX to it's address.

    global [email protected]
    
    ; WinExec(char *lpCmdLine, int uCmdShow)
    extern [email protected]
    
    [section .code]
    [email protected]:
        ; ... read input and jump to loadrun1 or loadrun2 here
    
    loadrun1:
        push dword 1
        push dword progname1
        call [email protected]
        ret
    
    loadrun2:
        push dword 1
        push dword progname2
        call [email protected]
        ret
    
    [section .data]
        progname1 db 'C:\Users\Usuario\NASM\Adding.exe',0 
        progname2 db 'C:\Users\Usuario\NASM\Substracting.exe',0