emprit

asm

Dec 8th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. cetak_string MACRO string
  2.     MOV AH,09
  3.     LEA DX,string
  4.     int 21h
  5. ENDM
  6.  
  7. cetak_input MACRO input
  8.     MOV AH,09
  9.     LEA DX,input
  10.     int 21h
  11. ENDM
  12.  
  13. terima_input MACRO input
  14.     MOV AH,09
  15.     LEA DX,input
  16.     int 21h
  17. ENDM
  18.  
  19.  
  20. .MODEL SMALL
  21. .CODE
  22. ORG 100h
  23.  
  24. mulai :
  25.     JMP proses
  26.     Kal0 DB 'Isi Data Mahasiswa : $'
  27.     Kal1 DB 'Nim Anda : $'
  28.     Kal2 DB 'Nama Anda : $'
  29.     Kal3 DB 'Cetak Data [y/t] : $'
  30.     Kal4 DB 'Keluar[y/t] : $'
  31.  
  32.     nim DB 15,?,15 DUP(?)
  33.     nama DB 30,?,30 DUP(?)
  34. proses :
  35.     cetak_string Kal0
  36.     call ganti_brs
  37.     cetak_string Kal1
  38.     terima_input nim
  39.     call ganti_brs
  40.     cetak_string Kal2
  41.     terima_input nama
  42.     call ganti_brs
  43.     call ganti_brs
  44.     cetak_string Kal3
  45.  
  46.     call terima_kar
  47.     cmp al,79h
  48.     je cetak
  49.  
  50. tanya :
  51.     call ganti_brs
  52.     cetak_string Kal4
  53.     call terima_kar
  54.     cmp al,79h
  55.     je selesai
  56.     call ganti_brs
  57.     jne proses
  58. selesai :
  59.     int 20h
  60. cetak :
  61.     call ganti_brs
  62.     cetak_input nim
  63.     call ganti_brs
  64.     cetak_input nama
  65.     call ganti_brs
  66.     jmp tanya
  67.  
  68. ganti_brs PROC NEAR
  69.     MOV AH,02h
  70.     MOV DL,0Ah
  71.     INT 21h
  72.     MOV DL,0Dh
  73.     int 21h
  74.     RET
  75. ganti_brs ENDP
  76.  
  77. terima_kar PROC NEAR
  78.     MOV DL,[BX]
  79.     MOV AH,02h
  80.     int 21h
  81. terima_kar ENDP
  82.  
  83. end mulai
Advertisement
Add Comment
Please, Sign In to add comment