• assembly code find error

    From Own Muhammad@21:1/5 to All on Mon Jul 10 12:39:48 2023
    [org 0x0100]

    jmp start

    section data

    name db'Name:Ali shan',0

    vuid db'VUID :bc210410288',0

    vuid_asc db'vuid sorted:001122488'
    ,0
    vuid_desc db'vuid sorted:884221100',0

    Current_values db vuid-vuid



    section text
    start;
    mov ah,0
    mov al,3
    int 0x10

    mov ah,0x0e
    mov si,name
    call print_string_color

    mov al,0x0d
    int 0x10
    mov al,0x0a
    int 0x10
    mov si,current_values
    call print_string_color

    mov ax,0
    mov es,ax
    cli
    mov word[es:9*4],kbisr
    mov [es:9*4+2],cs
    sti
    l1:
    mov ah,0
    int 0x16
    cmp al,27
    jne l1
    mov ax,0x4c00
    int 0x21

    kbisr:
    push ax
    push es
    mov ax,0xb800
    mov es,ax
    in al,0x60
    cmp al,0x2a
    je.left_shift_pressed
    cmp al,0x36
    je.right_shift_pressed

    mov ax,0
    int 0x10
    jmp.end

    .left_shift_pressed:
    mov ax,0
    int 0x10
    mov ah,0x0e
    mov si,name
    call print_string_color

    mov al,0x0d
    int 0x10
    mov al,0x0a
    int 0x10
    mov si,vuid
    call print_string_color

    mov al,0x0d
    int 0x10
    mov al,0x0a
    int 0x10
    mov si,vuid_desc
    call print_string_color

    jmp end
    .right_shift_pressed:
    mov ax,0
    int 0x10
    mov ah,0x0e
    mov si,name
    call print_string_color

    mov al,0x0d
    int 0x10
    mov al,0x0a
    int 0x10

    mov si,vuid
    call print_string_color
    mov al,0x0d
    int 0x10
    mov al,0x0a
    int 0x10

    mov ah,0x0e
    mov si,vuid_asc
    call print_string_color

    .end:
    mov al,0x20
    out 0x20,al
    pop es
    pop ax
    iret
    print_string_color:
    lodsb
    cmp al,0
    je.done
    mov ah,0x0e
    mov bh,0
    int 0x10
    jmp priny_string_color

    .done:
    ret

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Tue Jul 11 08:30:27 2023
    Own Muhammad,

    [snip code]

    I think you forgot to include the explanation to what the code is supposed
    to do and what it does instead (what the problem is). And ofcourse also
    what you did yourself to find the problem.

    Start explaining with why you are intercepting int 9 (but not restoring it
    <-- which just /might/ be the whole problem ....).

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerr-Mudd, John@21:1/5 to R.Wieser on Tue Jul 11 10:42:20 2023
    On Tue, 11 Jul 2023 08:30:27 +0200
    "R.Wieser" <address@nospicedham.is.invalid> wrote:

    Own Muhammad,

    [snip code]

    I think you forgot to include the explanation to what the code is supposed
    to do and what it does instead (what the problem is). And ofcourse also what you did yourself to find the problem.

    Start explaining with why you are intercepting int 9 (but not restoring it <-- which just /might/ be the whole problem ....).

    There's at least 2 syntax/spelling errors in the code as posted, just from
    a quick glance.

    It looks as if someone is trying to hack together some code from
    something borrowed from elsewhere with not much understanding of what it's (supposed) to do.
    --
    Bah, and indeed Humbug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Tue Jul 11 13:28:21 2023
    John,

    with not much understanding of what it's (supposed) to do.

    ... Almost as if the code is an assignment from a teacher who tries to
    figure out how much the student picked up from his tutoring.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Just_Craig@21:1/5 to R.Wieser on Wed Aug 2 04:58:51 2023
    On Tuesday, 11 July 2023 at 13:38:12 UTC+2, R.Wieser wrote:
    John,
    with not much understanding of what it's (supposed) to do.
    ... Almost as if the code is an assignment from a teacher who tries to
    figure out how much the student picked up from his tutoring.

    Regards,
    Rudy Wieser

    i suspect as much - https://www.studocu.com/row/document/virtual-university-of-pakistan/introduction-to-assembly-language/org-0x0100-well/64920331

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Aug 2 16:46:48 2023
    Just_Craig,

    ... Almost as if the code is an assignment from a teacher who tries to
    figure out how much the student picked up from his tutoring.

    Regards,
    Rudy Wieser

    i suspect as much - https://www.studocu.com/row/document/virtual-university-of-pakistan/introduction-to-assembly-language/org-0x0100-well/64920331

    Thats a good find. :-)

    Though I assumed that the posted code was provided by the teacher, to see if the students would be able to figure out which mistakes where made in it and fix them (spelling as well as method and missing/extra commands).

    In regard to the link, I only see the "scroll a window in the screen" INT 10
    , AX=0x0600 call. - which isn't even part of the solution (the result are supposed to be on fixed lines on the screen).

    I must say that the part "it prints your VUID in the ascending order" is ... iffy to me (just "display 'hello world' " would have done as well and would
    not be confusing). On the other hand, it shows that the poster didn't overthink that part, and just put it into a string (instead of going for a sorting routine). Point for the poster I guess.

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)