Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Darkc0der Darkc0der is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 598
Rep Power: 14
Darkc0der mempunyai hidup yang Normal
Default (tolong dibantu)

gan ane punya sample program asembly yang tidak jalan

mohon dibantu ya dimananya progrmam ne tidak jalan.





ini progrmnya



SCRIPT:

ctk_kar macro

lea dx, #1

mov ah, 09h

int 21h

#em



input macro

mov ah, 01h

int 21h

sub al, 30h

mov bh, al

mov ah, 01h

int 21h

sub al, 30h

mov bl, al

mov dl, 03Ah

mov ah, 02h

int 21h

#em



output macro

add bl, 30h

mov ah, 02h

int 21h

#em



kali macro

mul cl

mov [si], al

inc si

#em

org 100h

jmp mulai

cba db 13, 10, '_______________________________$'

cb0 db 13, 10, '| No| MK |SKS |Nilai$'

cbb db 13, 10, '_______________________________$'

cb1 db 13, 10, '| 1 |MK1 |4 |$'

cb2 db 13, 10, '| 2 |MK2 |1 |$'

cb3 db 13, 10, '| 3 |MK3 |3 |$'

cb4 db 13, 10, '| 4 |MK4 |2 |$'

cb5 db 13, 10, ' IPK: $'



proses: cmp cl, 04h

je mk1

cmp cl, 03h

je mk2

cmp cl, 02h

je mk3

jmp mk4



mk1: kali

jmp dua

mk2: kali

jmp tiga

mk3: kali

jmp empat

mk4: kali

jmp jumlah



mulai: xor dx, dx

mov cx, 0FFh

mov si, 120h

ctk_kar cba

ctk_kar cb0

ctk_kar cbb



satu: xor bx, bx

xor dx, dx

ctk_kar cb1

input

mov cl, 04h

jmp dec_nilai

dua: ctk_kar cb2

input

mov cl, 03h

jmp dec_nilai

tiga: ctk_kar cb3

input

mov cl, 02h

jmp dec_nilai

empat: ctk_kar cb4

input

mov cl, 01h

jmp dec_nilai



dec_nilai: cmp bh, 09h

je sembilan

cmp bh, 08h

je delapan

cmp bh, 07h

je tujuh

jmp enam



sembilan: mov dl, 41h

mov ah, 02h

int 21h

mov al, 04h

jmp proses



delapan: mov dl, 42h

mov ah, 02h

int 21h

mov al, 03h

jmp proses



tujuh: mov dl, 43h

mov ah, 02h

int 21h

mov al, 02h

jmp proses



enam: mov dl, 44h

mov ah, 02h

int 21h

mov al, 01h

jmp proses



jumlah: dec si

mov bh, [si]

dec si

mov bl, [si]

add bh, bl

dec si

mov bl, [si]

add bh, bl

dec si

mov bl, [si]

add bh, bl

mov al, bh

mov cl, 0Ah

div cl

mov [si], ah

inc si

mov [si], al

ctk_kar cb5

mov dl, [si]

add dl, 30h

mov ah, 02h

int 21h

mov dl, 02Eh

mov ah, 02h

int 21h

dec si

mov dl, [si]

add dl, 30h

mov ah, 02h

int 21h

akhir: int 20h



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 04:16 PM.


no new posts