3.1
Menggunakan Procedure untuk ‘Ular Lari Lurus’
Listing
program:
.model small
.code
org 100h
proses:
call cetak_U
call cetak_L
call cetak_A
call cetak_R
call cetak_Z
call cetak_L
call cetak_A
call cetak_R
call cetak_I
call cetak_Z
call cetak_L
call cetak_U
call cetak_R
call cetak_U
call cetak_S
int 20h
cetak_U proc near
mov ah,02h
mov dl,'U'
int 21h
ret
cetak_U endp
cetak_L proc near
mov ah,02h
mov dl,'L'
int 21h
ret
cetak_L endp
cetak_A proc near
mov ah,02h
mov dl,'A'
int 21h
ret
cetak_A endp
cetak_R proc near
mov ah,02h
mov dl,'R'
int 21h
ret
cetak_R endp
cetak_Z proc near
mov ah,02h
mov dl,' '
int 21h
ret
cetak_Z endp
cetak_I proc near
mov ah,02h
mov dl,'I'
int 21h
ret
cetak_I endp
cetak_$ proc near
mov ah,09h
mov dl,10
int 21h
ret
cetak_$ endp
cetak_S proc near
mov ah,02h
mov dl,'S'
int 21h
ret
cetak_S endp
end proses
ret
3.1
Menggunakan Procedure untuk Penulisan Nama dan NIM
Listing program:
.model
small
.code
org
100h
proses:
call
cetak_N
call
cetak_A
call
cetak_M
call
cetak_A
call
cetak_':'
call
cetak_Z
call
cetak_J
call
cetak_O
call
cetak_S
call
cetak_A
call
cetak_P
call
cetak_A
call
cetak_T
call
cetak_Z
call
cetak_S
call
cetak_I
call
cetak_M
call
cetak_A
call
cetak_N
call
cetak_G
call
cetak_U
call
cetak_N
call
cetak_S
call
cetak_O
call
cetak_N
call
cetak_G
call
cetak_%
call
cetak_x
call
cetak_N
call
cetak_I
call
cetak_M
call
cetak_':'
call
cetak_Z
call
cetak_1
call
cetak_2
call
cetak_0
call
cetak_8
call
cetak_0
call
cetak_1
call
cetak_0
call
cetak_4
call
cetak_3
int
20h
cetak_N
proc near
mov ah,02h
mov dl,'N'
int 21h
ret
cetak_N endp
cetak_A
proc near
mov ah,02h
mov dl,'A'
int 21h
ret
cetak_A endp
cetak_M
proc near
mov ah,02h
mov dl,'M'
int 21h
ret
cetak_M endp
cetak_':'
proc near
mov ah,02h
mov dl,':'
int 21h
ret
cetak_':' endp
cetak_Z proc near
mov ah,02h
mov dl,' '
int 21h
ret
cetak_Z endp
cetak_J
proc near
mov ah,02h
mov dl,'J'
int 21h
ret
cetak_J endp
cetak_O
proc near
mov ah,02h
mov dl,'O'
int 21h
ret
cetak_O endp
cetak_S
proc near
mov ah,02h
mov dl,'S'
int 21h
ret
cetak_S endp
cetak_P
proc near
mov ah,02h
mov dl,'P'
int 21h
ret
cetak_P endp
cetak_T
proc near
mov ah,02h
mov dl,'T'
int 21h
ret
cetak_T endp
cetak_I
proc near
mov ah,02h
mov dl,'I'
int 21h
ret
cetak_I endp
cetak_G
proc near
mov ah,02h
mov dl,'G'
int 21h
ret
cetak_G endp
cetak_U
proc near
mov ah,02h
mov dl,'U'
int 21h
ret
cetak_U endp
cetak_%
proc near
mov dl,10
int 21h
ret
cetak_% endp
cetak_x
proc near
mov dl,13
int 21h
ret
cetak_x endp
cetak_1
proc near
mov ah,02h
mov dl,'1'
int 21h
ret
cetak_1 endp
cetak_2
proc near
mov ah,02h
mov dl,'2'
int 21h
ret
cetak_2 endp
cetak_0
proc near
mov ah,02h
mov dl,'0'
int 21h
ret
cetak_0 endp
cetak_8
proc near
mov ah,02h
mov dl,'8'
int 21h
ret
cetak_8 endp
cetak_4
proc near
mov ah,02h
mov dl,'4'
int 21h
ret
cetak_4 endp
cetak_3
proc near
mov ah,02h
mov dl,'3'
int 21h
ret
cetak_3 endp
end
proses
ret
Tidak ada komentar:
Posting Komentar