1.RANGKAIAN SIMULASI [kembali]
CODE_SEG SEGMENT
ASSUME CS:CODE_SEG,DS:CODE_SEG,SS:CODE_SEG,ES:CODE_SEG
ORG 100H
start: jmp mulai
porta equ 00h
portb equ 01h
portc equ 02h
cw equ 03h
awal db ?
VAR1 DB ?
DATA DB 7FH,41H,41H,41H,3EH,00H ; D data dalam
; define byte
; <ukurannya 1 byte>
DB 7EH,09H,09H,09H,7EH,00H ; A
DB 7FH,09H,19H,29H,46H,00H ; R
DB 7FH,30H,18H,30H,7FH,00H ; W
DB 7FH,00H ; I
DB 26H,49H,49H,49H,32H,00H ; S
DB 3EH,41H,41H,41H,3EH,00H ; O
DB 7FH,02H,04H,08H,7FH,00H ; N
akhir db ?
mulai:
Mov AX, CS
Mov DS, AX
Xor AX, AX
Mov ES, AX
Mov SS, AX
Lea SI, Awal
Lea CX, Akhir
Mov DI, SI
Sub CX, SI
Cld
Rep Movsb
Mov SP,800h
Xor AX,AX
Mov DS,AX
mov al,82h ; init ppi
mov dx,cw ; pada 80H MODE = 0
out dx,al ; port AC = output, B = input
tampil:
CALL huruf
JMP tampil
huruf PROC NEAR
mov AH,00h ;MENENTUKAN BARIS
MOV SI,00H ;tentukan data yang akan diambil
mov VAR1,20 ;counter untuk lop1
LEA BX,DATA ;pindahkan data ke bx, maka
; bx=7FH,bx+1=41H,bx+2=41H..... dst
LOP: MOV DX,porta
MOV AL,BYTE PTR[BX+SI]
OUT DX,AL
CALL OUT
inc AH ;NAIKKAN BARIS
INC SI ;NAIKKAN DATA
CALL DELAY
dec VAR1
CMP VAR1,00H
JNE LOP
CALL DELAY
RET
huruf ENDP
OUT PROC NEAR ;prosedur pengambilan baris
MOV DX,portc
MOV AL,AH
OUT DX,AL
RET
OUT ENDP
DELAY PROC NEAR
MOV CX,10 ; 1ffh
LAGI: PUSH CX
MOV CX,10 ; 18h
LOOP $
POP CX
LOOP LAGI
RET
DELAY ENDP
ORG 40F0H
DB 0EAH
DW 0100H
DW 0FBF0H
CODE_SEG ENDS
END start
HLT ; halt!
Tidak ada komentar:
Posting Komentar