Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

assembly code find error

38 views
Skip to first unread message

Own Muhammad

unread,
Jul 10, 2023, 6:02:24 PM7/10/23
to

[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

R.Wieser

unread,
Jul 11, 2023, 3:52:47 AM7/11/23
to
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


Kerr-Mudd, John

unread,
Jul 11, 2023, 5:53:04 AM7/11/23
to
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.

R.Wieser

unread,
Jul 11, 2023, 7:38:12 AM7/11/23
to
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


Just_Craig

unread,
Aug 2, 2023, 8:00:51 AM8/2/23
to

R.Wieser

unread,
Aug 2, 2023, 10:49:36 AM8/2/23
to
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


0 new messages