VOGONS


First post, by arviza

User metadata
Rank Newbie
Rank
Newbie

Hi, I have problem, when I execute myfile.asm it shows that relative jump out of range.

Cek_huruf MACRO HURUF        ;Macro untuk mengecheck password
CMP PASS[DI],HURUF ;Compare Inputan dengan Huruf password
JNE Salah
INC DI
ENDM

Clrscr MACRO ;Macro untuk ClearScreen
MOV AL,03H
MOV AH,00H
INT 10H
ENDM

.MODEL SMALL
.DATA

PASS DB 0
tpat DB 'Masukkan Password $'
FAL DB 'Password tidak benar, silahkan masukkan kembali password $'
RIG DB 'Password Benar, Masuk ke Program Utama $'
STP DB '(Tekan "Esc" untuk Keluar): $'
CON DB 'Yakin untuk keluar?(Y/N)? $'
CRE DB '>>Anggota Kelompok 16: Lauren, Arviza, Heraldus Panji Arikson, Arnaldo H Saragi, Rizqy Pratama R, T Ar Rizqi, Luthfi A<<$'
ALE DB 'Tekan tombol apapun untuk menghentikan program'

.CODE
.STARTUP

Home:
Clrscr

MOV AH,09H
MOV DX,OFFSET tpat ;Kalimat permintaan pemasukkan password
INT 21H
MOV DX,OFFSET STP ;Kalimat pemberitahuan Esc untuk keluar program
INT 21H

Input:
MOV AH,07H
INT 21H

CMP AL,0DH ;Tombol Enter untuk memulai proses
JE Proses
CMP AL,1BH ;Tombol Esc untuk menghentikan program
JE Stop

CMP AL,21H ;Batasan input hanya untuk symbol, angka dan huruf saja
JBE Input

MOV PASS[DI],AL ;Memindahkan segala inputan ke String PASS
INC DI

MOV AH,02H ;Menambahkan tanda * untuk tiap inputan
MOV DL,'*'
INT 21H

JNE Input

Proses: ;Proses pengecekan inputan password
CMP DI,7 ;Pengecekan jumlah inputan password
JNE Salah
Show last 66 lines
		
MOV DI,0
Cek_huruf 'e'
Cek_huruf 'l'
Cek_huruf 'e'
Cek_huruf 'k'
Cek_huruf 't'
Cek_huruf 'r'
Cek_huruf 'o'

Benar:
Clrscr
MOV AH,09H
MOV DX,OFFSET RIG ;Kalimat pemberitahuan bahwa password benar
INT 21H

JMP Credit ;Lompat ke credit

Salah:
Clrscr

MOV DI,0

MOV AH,09H
MOV DX,OFFSET FAL ;Kalimat pemberitahuan bahwa password salah
INT 21H
MOV DX,OFFSET STP
INT 21H

JMP Input

Stop:
Clrscr

MOV DI,0

MOV AH,09H
MOV DX,OFFSET CON ;Konfirmasi keluar program
INT 21H

Ba: MOV AH,07H
INT 21H

CMP AL,'N' ;Compare dengan "N"
JE Home
CMP AL,'n' ;Compare dengan "n"
JE Home

CMP AL,'Y' ;Compare dengan "Y"
JE Credit
CMP AL,'y' ;Compare dengan "y"
JNE Ba

Credit:
MOV AH,09H
MOV DX,OFFSET CRE ;Kalimat berisikan nama-nama anggota kelompok
INT 21H

MOV AH,09H
MOV DX,OFFSET ALE ;Menahan Program sementara
INT 21H
END
.EXIT


DOSBOX say :

**ERROR** myfile.asm(105) relative jump out of range by 002FH

**ERROR** myfile.asm(107) relative jump out of range by 0033H

can you help me to solve this problem ?

Reply 1 of 6, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Your assembler says that, not DOSBox. Anyway: The type of jump you are using cannot jump that far.

1+1=10

Reply 2 of 6, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

replace
CMP AL,'N' ;Compare dengan "N"
JE Home
CMP AL,'n' ;Compare dengan "n"
JE Home

CMP AL,'Y' ;Compare dengan "Y"
with
CMP AL,'N' ;Compare dengan "N"
JE jmpHome
CMP AL,'n' ;Compare dengan "n"
JNE chkY
jmpHome:
JMP Home
chkY:
CMP AL,'Y' ;Compare dengan "Y"

Reply 3 of 6, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Some assemblers automatically create a short and near jump if the coded short jump is out of range, unless instructed not to do that. MASM 6.x is one assembler that will. Anyway, this thread would be better suited to somewhere other than a DOSBox area.

Reply 4 of 6, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

[Thread moved to Milliways Section]

Reply 5 of 6, by arviza

User metadata
Rank Newbie
Rank
Newbie

THREAD CLOSED

Reply 6 of 6, by Kreshna Aryaguna Nurzaman

User metadata
Rank l33t
Rank
l33t

The comments in your code are in Bahasa Indonesia. Just when I thought I'm the only Indonesian in this board....

Never thought this thread would be that long, but now, for something different.....
Kreshna Aryaguna Nurzaman.